knowledge-agent-template

作者 vercel-labs已验证

Open source file-system and knowledge based agent template. Build AI agents that stay up to date with your knowledge base

996
Stars
129
Forks
TypeScript
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/vercel-labs/knowledge-agent-template

快速入门

使用 knowledge-agent-template 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

Knowledge Agent Template banner


Knowledge Agent Template
Open source file-system and knowledge based agent template.

Template. Fork it, customize it, and deploy your own file-system based AI agent.

Deploy with Vercel


Open source file-system and knowledge based agent template. Build AI agents that stay up to date with your knowledge base — grep, find, and cat across your sources, no embeddings, no vector DB. Plug any source (GitHub repos, YouTube transcripts, custom APIs) and deploy as a chat app, a GitHub bot, a Discord bot, or all at once.

Features

File-Based Search — No Embeddings Needed

No vector database. No chunking pipeline. No embedding model. Agents use grep, find, and cat inside isolated sandboxes to search across all your sources. Results are deterministic, explainable, and instant. Zero infrastructure overhead.

Multi-Platform Bots — One Agent, Everywhere

Write your agent once, deploy it on the web chat, GitHub Issues, Discord - and soon Slack, Linear, and more. Powered by pluggable adapters via the Chat SDK. Adding a new platform is a single adapter file.

Built-in Admin Panel

Full admin interface out of the box: usage stats, error logs, user management, source configuration, and content sync controls. No need for external dashboards or third-party monitoring.

AI-Powered Admin Agent

Ask your app about itself. "What errors happened in the last 24 hours?", "Show token usage by model", "Which endpoints are slowest?" — the admin agent has access to internal tools like query_stats, query_errors, run_sql, and chart to answer operational questions in natural language.

Smart Complexity Router

Every incoming question is classified by complexity (trivial → complex) and routed to the right model. Simple questions go to fast, cheap models. Hard questions go to powerful ones. Cost optimization happens automatically, no manual rules to maintain.

Real-Time Tool Visualization

The chat UI shows what the agent is doing in real time: which files it's reading, which commands it's running, and how long each step takes. No black box.

Shareable Conversations

Share any conversation with a single click. Generates a public read-only link with full metadata — author, title, and the complete exchange.

Shared Sandbox Pool

Sandboxes are pooled across users and conversations. When a chat starts, it connects to an already-running sandbox instead of creating a new one — startup in under 100ms. If none is available, a pre-built snapshot spins one up in 1–3s. Sandboxes are read-only with blocked dangerous commands, and automatically shared so multiple agents search the same up-to-date content without duplicating resources.

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                        Your AI Application                      │
│                     (Discord bot, GitHub bot, etc.)             │
└─────────────────────────────────┬───────────────────────────────┘
                                  │
                                  ▼
┌─────────────────────────────────────────────────────────────────┐
│                          @savoir/sdk                            │
│              AI SDK compatible tools (bash, bash_batch)         │
└─────────────────────────────────┬───────────────────────────────┘
                                  │ API calls
                                  ▼
┌─────────────────────────────────────────────────────────────────┐
│                         apps/app                                │
│                    (Unified Nuxt Application)                   │
│  ┌─────────────┐  ┌──────────────┐  ┌────────────────────────┐  │
│  │   Sandbox   │  │   Content    │  │   Vercel Workflows     │  │
│  │   Manager   │  │     Sync     │  │   (scheduled sync)     │  │
│  └──────┬──────┘  └──────┬───────┘  └────────────────────────┘  │
└─────────┼────────────────┼──────────────────────────────────────┘
          │                │
          ▼                ▼
   ┌────────────┐   ┌─────────────┐
   │   Vercel   │   │   GitHub    │
   │   Sandbox  │   │  Snapshot   │
   │            │   │    Repo     │
   └────────────┘   └─────────────┘

Packages

PackageDescription
@savoir/sdkAI SDK compatible tools for agents
@savoir/agentAgent core: router, prompts, tools, types
apps/appUnified Nuxt app (chat UI + API + bots)

Quick Start

Using the SDK

import { generateText } from 'ai'
import { createSavoir } from '@savoir/sdk'

const savoir = createSavoir({
  apiUrl: process.env.SAVOIR_API_URL!,
  apiKey: process.env.SAVOIR_API_KEY,
})

const { text } = await generateText({
  model: yourModel, // any AI SDK compatible model
  tools: savoir.tools, // bash and bash_batch tools
  maxSteps: 10,
  prompt: 'How do I configure authentication?',
})

console.log(text)

Deploy to Vercel

Deploy with Vercel

Self-hosting

# Clone the repository
git clone https://github.com/vercel-labs/knowledge-agent-template.git
cd knowledge-agent-template

# Install dependencies
bun install

# Configure environment variables
cp apps/app/.env.example apps/app/.env
# Edit .env with your configuration

# Start the app
bun run dev

Required environment variables:

# Authentication
BETTER_AUTH_SECRET=your-secret        # Secret for signing sessions/tokens
GITHUB_CLIENT_ID=...                  # GitHub OAuth app client ID
GITHUB_CLIENT_SECRET=...              # GitHub OAuth app client secret

# AI (optional — only needed for local dev, Vercel uses OIDC automatically)
# AI_GATEWAY_API_KEY=...              # Vercel AI Gateway API key

# Sandbox
# NUXT_GITHUB_SNAPSHOT_REPO=org/repo  # Optional default (can be set from admin sandbox UI)
# NUXT_GITHUB_TOKEN=ghp_...           # Optional fallback override (GitHub App is the default path)

See ENVIRONMENT.md for the full list of environment variables.

Customization

Knowledge Agent Template is designed as a reusable template. See the Customization Guide for how to:

  • Rename your instance (name, icon, description)
  • Add content sources (GitHub repos, YouTube channels, custom)
  • Add custom AI tools
  • Add bot adapters (Slack, Linear, etc.)
  • Customize AI prompts
  • Theme the UI
  • Deploy to production

AI-assisted customization: The project includes local skills in .agents/skills/ (add-tool, add-source, add-bot-adapter, rename-project). You can delegate these tasks to an AI agent — e.g. "Follow the rename-project skill to rename this to MyDocs" — instead of doing them manually.

Configuration

Sources are managed through the admin interface at /admin. You can add GitHub repositories and YouTube channels as knowledge sources, then trigger a sync from the UI.

Sources can also be listed programmatically via the SDK (savoir.client.getSources()).

See SOURCES.md for detailed source configuration options.

How It Works

For the full technical deep-dive, see Architecture.

  1. Sources in Database: Sources are stored in SQLite via NuxtHub, managed through the admin interface
  2. Content Aggregation: Sources (GitHub repos, YouTube transcripts, custom APIs, etc.) are synced to a snapshot repository via Vercel Workflow
  3. Sandbox Creation: When an agent needs to search, the API creates/recovers a Vercel Sandbox with the snapshot repo cloned
  4. File-based Search: The SDK bash and bash_batch tools execute grep/find/cat commands in the sandbox to search and read content
  5. AI Integration: Tools are compatible with the Vercel AI SDK for seamless integration with any LLM

Bots

Knowledge Agent Template includes built-in bot integrations powered by the Vercel Chat SDK:

  • GitHub Bot: Responds to mentions in GitHub issues and PRs. Uses a GitHub App for authentication and webhooks.
  • Discord Bot: Responds to mentions and continues conversations in threads. Uses the Discord API.

Both bots use the same AI agent and knowledge base as the chat interface. Want to add your own? See Adding a Bot Adapter.

Development

# Install dependencies
bun install

# Start the app in dev mode
bun run dev

# Build all packages
bun run build

# Run tests
bun run test

# Lint and fix
bun run lint:fix

Built With

Contributing

See CONTRIBUTING.md for how to get involved.

License

MIT

常见问题

What is knowledge-agent-template?

knowledge-agent-template is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by vercel-labs. Open source file-system and knowledge based agent template. Build AI agents that stay up to date with your knowledge base. It has 996 GitHub stars.

Is knowledge-agent-template safe to use?

Yes. knowledge-agent-template passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install knowledge-agent-template?

Clone the repository with "git clone https://github.com/vercel-labs/knowledge-agent-template" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is knowledge-agent-template written in?

knowledge-agent-template is primarily written in TypeScript. It is open-source under vercel-labs on GitHub, so you can review or fork the full source.

Are there alternatives to knowledge-agent-template?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh knowledge-agent-template against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情