Skip to content

kanna12580/kk-knowledge-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

Frontend demo 1

Frontend demo 2

Codex MCP knowledge base tool call:

MCP demo 1

MCP demo 2

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.
  • .txt file 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.

About

轻量级知识库系统,支持知识库管理、文本/txt 上传、语义检索、流式返回,并将检索能力封装为 MCP Server,供 Agent 调用。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors