# knowledge-rag MCP server

> Indexes local documents and code so an AI client can search them with hybrid BM25 and vector retrieval plus cross-encoder reranking.

- Repository: https://github.com/lyonzin/knowledge-rag
- Page: https://hostedmcp.org/servers/lyonzin/knowledge-rag
- Transport: —
- Stars: 306
- License: MIT

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `KNOWLEDGE_RAG_DIR` | no | no |  |
| `KNOWLEDGE_RAG_SINGLE_INSTANCE` | no | no |  |

## Tools (13)

- `search_knowledge`
- `get_document`
- `search_similar`
- `evaluate_retrieval`
- `list_documents`
- `list_categories`
- `get_index_stats`
- `add_document`
- `update_document`
- `remove_document`
- `add_from_url`
- `reindex_documents`
- `get_reindex_status`

## FAQ

### Does knowledge-rag need Docker, a database server or an API key?

No. It runs as one Python process with embedded ChromaDB and FastEmbed ONNX models, so no Docker, database server or API key is required.

### How does knowledge-rag search work?

It runs BM25 keyword search and vector search, fuses the rankings with weighted reciprocal rank fusion, then reranks the top candidates with a cross-encoder.

### Does knowledge-rag work offline?

Yes, once the roughly 150 MB of models are cached, indexing and search work offline.

### Does knowledge-rag re-index files when they change?

Yes. A watcher re-indexes changed files in the documents folder after 10 seconds without new changes.

### How many tools and file types does knowledge-rag support?

It exposes 13 MCP tools and handles 33 file types, including code files and notebooks.
