kb
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., "@kbSearch the knowledge base for grid-scale battery safety before fetching new sources."
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.
kb — the fetch-once knowledge base for AI agents
Check before fetching. Save after fetching. Never re-fetch. Never fabricate.
AI agents repeatedly download the same documents, forget what they learned, and
invent dates or authors when asked to save notes. kb adds a local discipline
layer that makes the desired loop explicit:
question → search the library → hit: read and answer
└── miss: fetch externally → save → answerWhy kb?
Problem | Typical knowledge base | kb |
Check before an external fetch | Prompt convention |
|
Duplicate documents | Often stored twice | Three-layer dedup with merge-on-conflict |
Missing source metadata | Agent may guess | Blank stays blank; metadata is verbatim |
Scanned PDFs | Easy to treat as readable | Marked |
Chinese search | Often needs embeddings | SQLite FTS5 trigram + short-query fallback |
Infrastructure | API keys and vector DBs | One local SQLite file |
No embeddings. No API keys. No vector database. Just Python, SQLite, six MCP tools, a CLI, and a localhost web console.
Related MCP server: Open Brain Knowledge MCP Server
30-second quick start
git clone https://github.com/zonion088-design/kb.git
cd kb
python -m venv .venv
# macOS/Linux: source .venv/bin/activate
# Windows: .venv\\Scripts\\Activate.ps1
pip install -r requirements.txt
python kb.py init
python examples/seed_demo.py
python kb.py search "储能系统"The demo data is clearly fictional and safe to delete. Re-running the seed script demonstrates duplicate detection instead of creating second copies.
Connect it to an agent
Claude Code:
claude mcp add kb -- python /absolute/path/to/kb/mcp_kb_server.pyClaude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"kb": {
"command": "python",
"args": ["/absolute/path/to/kb/mcp_kb_server.py"]
}
}
}Then load the operating rules into your agent instructions:
@/absolute/path/to/kb/KB_RULES.mdThe six MCP tools
Tool | Result |
| Search documents with compact snippets and metadata filters |
| Check whether a source document is already present |
| Read the full document with truncation and OCR warnings |
| Save fetched research text and source metadata |
| Archive a local file and extract supported PDFs |
| Inspect totals, document types, and OCR backlog |
The write path deduplicates by source external_id, file SHA-256, and a
title/date suspected-duplicate check. Existing records are merged by filling
empty fields; existing values are not overwritten.
Try the web console and CLI
python server.py # http://127.0.0.1:8643
python kb.py --help # init / add-text / add-file / search / get / stats / ...The localhost console gives humans editing and deletion controls while the MCP tools keep agents on the append-and-search path.
Honest limitations
Keyword search, not semantic search: this is intentional and keeps the default local and dependency-light.
OCR is detected and flagged; OCR processing is not included.
Single user, one machine; no auth, sync, or multi-tenant server.
PDF extraction quality depends on
pypdfand the source file.
Development
python -m unittest discover -s tests -vSee CONTRIBUTING.md for focused contributions and KB_RULES.md for the design contract. The roadmap lives in docs/ROADMAP.md.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory for AI agents. Search and store durable facts, preferences and decisions.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Universal persistent memory and knowledge retrieval layer for AI agents and LLMs.
Persistent memory for AI agents. Search, store, and recall across sessions.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables LLMs to manage file-based knowledge bases with dual storage (Markdown + SQLite). Supports creating, searching, and organizing articles across multiple knowledge bases with full-text search capabilities.4 npm3MIT
- FlicenseAqualityDmaintenanceA persistent, cross-session knowledge base for AI agents that indexes session history into a searchable SQLite database with full-text search, enabling recall of past sessions, stored knowledge, and summaries.10-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search, read, and traverse a local knowledge base of Markdown files using full-text search and relationship graph, reducing token usage.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to store, search, and manage persistent memories, todos, kanban boards, reminders, and progress trackers in a local SQLite database.Apache 2.0