auto-knowledge-base
This MCP server is an intelligent knowledge management system for engineering agents. It provides:
Search: Perform hybrid BM25 + vector semantic search with optional LLM reranking over the knowledge base. Filter by tags, project, role, or current task for context-aware retrieval (
knowledge_search,knowledge_relevant).Learn and organize: Import knowledge (text, code, docs); the LLM automatically extracts structured metadata (title, summary, tags, type, relationships). Knowledge can be staged for review before committing (
knowledge_learn,knowledge_learn_staged).Lifecycle management: Confirm staged entries, manage knowledge decay and refresh via FSRS-6 spaced repetition, enable role-based knowledge diffusion and activation, and run decay sweeps.
Monitoring and configuration: Check knowledge base status (entry counts, type distribution, LLM connection) and view LLM configuration without secrets (
knowledge_status,knowledge_config).Operational tools: Export/import for backup, audit operations, and identify knowledge gaps.
Self-contained architecture: Uses in-process SQLite with FTS5 and ONNX for embeddings, requiring no external services.
Planned integration for automatic discovery of research papers from arXiv to enrich the knowledge base.
Planned integration for automatic discovery of repositories and projects from GitHub to enrich the knowledge base.
Allows using a local Ollama instance as the LLM backend for knowledge processing, with OpenAI-compatible API.
Integrates with OpenAI's API to enable LLM-powered semantic understanding, knowledge extraction, and relevance reasoning.
Planned storage backend to replace JSON file storage for more robust and scalable knowledge persistence.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@auto-knowledge-base 学习关于React hooks的最佳实践"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Quick Start
# 1. Install
git clone https://github.com/guyeyouhun/auto-knowledge-base.git
cd auto-knowledge-base
npm install # installs deps + auto-downloads embedding model (~55MB)
npm run build
node dist/install.js # creates .env template
# 2. Configure LLM (needed for rerank/synthesis)
# Edit .env:
LLM_BASE_URL=https://api.openai.com/v1
LLM_API_KEY=sk-...
LLM_MODEL=gpt-4o
# 3. Start
node dist/index.js # runs as MCP server over stdioNo additional services. No embedding server, no vector database, no Python runtime. BM25 and vector search both run in-process with SQLite + ONNX.
Related MCP server: Open WebUI Knowledge Base MCP Server
Usage
# Store knowledge → staging
knowledge_learn(content: "Vite uses Rollup for production bundling", title: "Vite Build")
# Confirm → committed
knowledge_confirm(id: "550e8400-e29b-41d4-a716-446655440000")
# Search (BM25 + vector hybrid + LLM rerank)
knowledge_search(query: "vite rollup")
# Role-aware knowledge push
knowledge_relevant(role: "frontend", task: "configure build tooling")
# Export backup
knowledge_exportCore Architecture
Layer | Technology |
Retrieval | FTS5 BM25 → cosine similarity → LLM rerank |
Embedding | Process-internal ONNX via |
Storage | SQLite + WAL + FTS5 + relation graph + vector columns |
Spaced repetition | FSRS-6 for retention optimization |
Knowledge diffusion | Role-based BFS activation |
Search pipeline
query → BM25 FTS5 → vector cosine rerank
→ if BM25 < limit: vector similarity scan → results
→ (optional) LLM rerank + synthesisEvery stage degrades gracefully. No single failure blocks the response.
Knowledge lifecycle
learn (staging) → confirm (confirmed) → FSRS decay → frozen
↓
refresh queue → content-digester re-digestMCP Tools
Core (4)
Tool | Description |
| BM25 + vector hybrid + LLM rerank |
| Store knowledge (staging), auto-dedup |
| staging → confirmed |
| Role-based diffusion + BFS activation |
Configuration (2)
Tool | Description |
| Role entry nodes, diffusion depth |
| View LLM configuration |
Operations (5)
Tool | Description |
| FSRS-6 decay sweep |
| JSON backup / restore |
| Operation log |
| Statistics (truth, temperature, relations, embeddings) |
Feedback (3)
Tool | Description |
| Request re-digestion (content-digester integration) |
| Report knowledge gaps, triggers auto-digest |
| Query gap records by status/role |
Configuration
Only the LLM needs to be configured (in .env):
LLM_BASE_URL=http://localhost:11434/v1
LLM_API_KEY=your-api-key
LLM_MODEL=gpt-4oThe embedding model (fastembed + BGESmallZH) is automatically downloaded during npm install to knowledge/models/. No embedding configuration needed.
Development
npm test # 157 tests, 21 files
npm run test:watch # watch mode
npm run build # tsc + copy schemaDesign
Available Tools
6 toolsknowledge_configA
查看 LLM 配置信息(不暴露密钥)。
Inputs: no named parameters.
knowledge_learnC
导入知识到知识库。LLM 会自动提取结构化信息(标题、摘要、标签、关系)。
Inputs: content (required), type, title, project, +2 more.
knowledge_learn_stagedA
暂存待确认知识。存入 staging 区域,需要确认后才正式入库。
Inputs: content (required), source.
knowledge_relevantC
获取与当前任务相关的知识。基于任务描述和关键词返回最匹配的条目。
Inputs: task (required), keywords, project, currentFile, +1 more.
knowledge_searchA
搜索知识库,支持语义理解。返回匹配的知识条目和综合说明。
Inputs: query (required), tags, project, limit.
knowledge_statusA
知识库状态概览:条目数量、类型分布、LLM 连接状态。
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
知识检索入口有 knowledge_search 和 knowledge_relevant 两个高度重叠的工具,都用于返回匹配条目,容易造成误选。knowledge_learn 和 knowledge_learn_staged 的边界相对清楚,但整体仍存在一些模糊地带。
所有工具都有 knowledge_ 前缀且使用 snake_case,整体风格统一。不过 knowledge_relevant 缺少动词,status 和 config 是名词,与 search/learn 这类动词命名不完全一致。
6 个工具对于一个知识库服务器来说是合理的规模,覆盖了检索、导入、暂存、状态和配置查看等核心能力,没有冗余臃肿。
知识导入和检索是完整的,但 knowledge_learn_staged 明确表示需要确认后才正式入库,却没有对应的确认或拒绝工具,形成工作流死角。同时缺少删除、更新等知识库生命周期管理能力。
Maintenance
Related MCP Connectors
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
The knowledge base your AI reads and writes, under your rules — over MCP, EU-hosted.
Personal knowledge base MCP server with semantic search, auto-categorization, metadata extraction
Cross-vendor AI memory over MCP. One semantic store, readable and writeable from every MCP client.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn advanced MCP server providing RAG-enabled memory through a knowledge graph with vector search capabilities, enabling intelligent information storage, semantic retrieval, and document processing.49 npm47MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that exposes Open WebUI Knowledge Bases as tools and resources, enabling AI assistants to search and access knowledge bases.4MIT
- AlicenseAqualityBmaintenanceMCP server for managing and searching multi-tenant knowledge bases backed by SQLite with FTS5, enabling AI agents to persist and retrieve content via full-text search.132MIT
- AlicenseNot gradedqualityDmaintenanceA knowledge base MCP server backed by Qdrant vector database with local embeddings for semantic search and document management.3 npm1ISC