
kanna12580/kk-knowledge-agent
Developer tools轻量级知识库系统,支持知识库管理、文本/txt 上传、语义检索、流式返回,并将检索能力封装为 MCP Server,供 Agent 调用。
Overview
轻量级知识库 Agent 项目,支持知识库管理、文本/txt 上传、分块向量化、语义检索、流式返回,并通过 MCP Server 暴露给 Agent 调用。 Frontend knowledge base and document workflow: - Knowledge base CRUD with pagination. - Direct text document upload. - .txt file upload. - Chunking and local multilingual embedding. - ChromaDB semantic retrieval. - SSE streaming search. - MCP tool: search_knowledge_base. - Basic tests with pytest. Follow AGENTS.md for the phased implementation plan. See docs/LOCAL_INSTALLATION.md for detailed Backend, Frontend, and MCP Server setup. - Add Docker Compose for one-command local deployment. - Replace SQLite with PostgreSQL for production usage. - Replace ChromaDB with Qdrant or Milvus for larger vector workloads. - Add PDF/DOCX upload. - Add BM25 + vector hybrid retrieval and rerank support. - Add answer generation with citation highlights.
README
kk-knowledge-agent
轻量级知识库 Agent 项目,支持知识库管理、文本/txt 上传、分块向量化、语义检索、流式返回,并通过 MCP Server 暴露给 Agent 调用。
Architecture
Frontend
|
| HTTP
v
Backend API
|
+--> SQLite
+--> ChromaDB
+--> sentence-transformers
Agent / Claude Code / OpenClaw / Hermas Agent
|
| MCP Tool Call
v
MCP Server
|
| HTTP
v
Backend API
Repository Layout
backend/ FastAPI API service
frontend/ React + Vite demo app
mcp-server/ MCP adapter server
examples/ Demo txt documents
AGENTS.md Phased development guide for Codex/Agent
Demo Screenshots
Frontend knowledge base and document workflow:
Codex MCP knowledge base tool call:
Local Setup
Backend
cd backend
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
copy .env.example .env
uvicorn app.main:app --reload --port 8000
API docs:
http://localhost:8000/docs
Frontend
cd frontend
npm install
npm run dev
Demo app:
http://localhost:5173
MCP Server
cd mcp-server
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
copy .env.example .env
python server.py
MCP config example:
{
"mcpServers": {
"kk-knowledge": {
"command": "python",
"args": ["mcp-server/server.py"]
}
}
}
MVP Scope
- Knowledge base CRUD with pagination.
- Direct text document upload.
.txtfile upload.- Chunking and local multilingual embedding.
- ChromaDB semantic retrieval.
- SSE streaming search.
- MCP tool:
search_knowledge_base. - Basic tests with pytest.
Development Order
Follow AGENTS.md for the phased implementation plan.
Local Installation
See docs/LOCAL_INSTALLATION.md for detailed Backend, Frontend, and MCP Server setup.
Future Improvements
- Add Docker Compose for one-command local deployment.
- Replace SQLite with PostgreSQL for production usage.
- Replace ChromaDB with Qdrant or Milvus for larger vector workloads.
- Add PDF/DOCX upload.
- Add BM25 + vector hybrid retrieval and rerank support.
- Add answer generation with citation highlights.
Install
This server does not publish a one-line install command.
Open the repository installation guideConfiguration
{
"mcpServers": {
"kk-knowledge": {
"command": "python",
"args": ["mcp-server/server.py"]
}
}
}