1. Conduid
  2. RAG
  3. Knowledge Rag
MCP server · RAG

Knowledge Rag

Local RAG server for Claude Code, Cursor and other MCP clients: hybrid BM25 + vector search with cross-encoder reranking on by default, 13 MCP tools, 33 file types including code, re-indexing on file changes. One Python process with embedded ChromaDB and FastEmbed ONNX: no Docker, database server or API key; offline after the first model download.

79Good

Scored 19 hours ago · breakdown

About Knowledge Rag

Knowledge Rag is an MCP server published by lyonzin in the RAG category: local RAG server for Claude Code, Cursor and other MCP clients: hybrid BM25 + vector search with cross-encoder reranking on by default, 13 MCP tools, 33 file types including code, re-indexing on file changes. One Python process with embedded ChromaDB and FastEmbed ONNX: no Docker, database server or API key; offline after the first model download. Conduid read 13 tools from its source: add_document, add_from_url, evaluate_retrieval, get_document, get_index_stats, get_reindex_status and 7 more. It is published to PyPI as knowledge-rag and runs with uvx.

The repository has 308 stars and 51 forks, is licensed MIT, and its last commit was on 28 Nov 2026. The latest release is v5.1.0 (14 Nov 2026): Minor release. Nothing breaking on upgrade, and existing indexes need no reindex. Most of it answers six reports from one large installation (a whole drive as documents_… It follows v5.0.1 (6 Nov 2026), and the 5 most recent releases go back to v4.11.0 (4 Oct 2026). It passes 4 of the 5 static checks Conduid ran on the repository; it does not pass Dependencies pinned. Its topics include bm25, chromadb, fastembed, knowledge-base, local-ai and privacy.

Install

uvx
uvx knowledge-rag
pip
pip install knowledge-rag
From source
git clone https://github.com/lyonzin/knowledge-rag

Tools (13)

add_documentSaves text as a file under `documents/` and indexes it
ParameterTypeDescription
categorystringCategory stored with the document (default: general). Any name is accepted, but search_knowledge() filters only by configured categories (category_mappings values, keyword_routes keys, general), and update_document() or re-indexing the file detects it again from the path through category_mappings. list_categories() shows the categories in use.
content *stringFull text content of the document (markdown supported)
filepath *stringRelative path within documents directory (e.g., "security/new-technique.md"). The subdirectory should match the category.
add_from_urlFetches an http(s) page, strips the HTML, saves it as Markdown with a provenance marker and indexes it
ParameterTypeDescription
categorystringCategory stored with the document and the folder it is saved in; default: general. Being part of the path, it must stay inside documents_dir: a value such as ../outside returns a "Filepath rejected" error. Any other name is accepted, but search_knowledge() filters only by configured categories (category_mappings values, keyword_routes keys, general), and update_document() or re-indexing the file detects it again from the path through category_mappings. list_categories() shows the categories in use.
titlestringOptional document title. Auto-detected from the page's <title> tag if omitted.
url *stringFull URL to fetch (https:// required). The page must be publicly accessible.
evaluate_retrievalReports MRR@5 and Recall@5 for your own query → expected file pairs
ParameterTypeDescription
test_cases *stringJSON string array of test cases. Each item requires "query" (search string) and "expected_filepath" (path of the document that should appear in top-5 results). Example: [{"query": "suid exploit", "expected_filepath": "security/suid.md"}]
get_documentReturns the full content of one indexed file
ParameterTypeDescription
filepath *stringRelative path to the document within the documents directory (e.g., "security/technique.md"). Must be an indexed file — use search_knowledge() to find the filepath by topic first, or browse list_documents(), which returns one page at a time (see its offset).
get_index_statsDocument and chunk counts, embedding model, BM25 status, cache hit rate, watcher status, HNSW self-recall probe
get_reindex_statusReports the progress of a background reindex
list_categoriesLists categories, derived from folder paths, with document counts
list_documentsLists indexed documents, 100 per page by default (up to 200 with `limit`), paged with `offset`
ParameterTypeDescription
categorystringOptional category filter, matched exactly against each document's category; an empty string, like omitting it, lists every document, and a category without documents returns an empty page (total 0). Call list_categories() to see the categories that hold documents.
limitintegerMaximum number of documents to return (default: 100, max: 200).
offsetintegerNumber of matching documents to skip (default: 0). For the next page, call again with offset + count until offset reaches total.
reindex_documentsIncremental by default; `force` re-embeds every file, `full_rebuild` builds and swaps a staging collection; runs in the background
ParameterTypeDescription
forceboolean
full_rebuildboolean
resumeboolean
remove_documentRemoves a document's chunks from the index, and optionally the file
ParameterTypeDescription
delete_filebooleanIf True, permanently deletes the file from disk in addition to removing from the index (default: False).
filepath *stringPath to the document file. Must be an indexed document — list_documents() lists indexed paths, one page at a time.
search_knowledgeHybrid BM25 + vector search with cross-encoder reranking; filters by category, folders (`include_folders`, `exclude_folders`) and `min_score`
ParameterTypeDescription
categorystringOptional category filter. Accepts the categories the server is configured with (category_mappings values and keyword_routes keys) plus general; an empty string, like omitting it, searches every category, and any other value returns an error that lists the valid ones. Call list_categories() first to see which categories hold documents and how many.
exclude_foldersarrayOptional recursive directory exclusions, applied before candidate selection. Exclusions override inclusions. Paths use / or \\, have exact component boundaries, and cannot be absolute, contain '..', or resolve outside documents_dir. Maximum 32 each.
hybrid_alphanumberBalance between semantic and keyword search. 0.0 = keyword-only (best for exact technical terms like CVE IDs or tool names), 0.3 = balanced default, 1.0 = semantic-only (best for conceptual or natural-language queries). While the keyword index is not built (a reindex, a document write or the lexical index migration holds the index, or its build failed), a keyword-only search returns an error that says why, with a suggestion, instead of reporting no results.
include_foldersarrayOptional list of directories relative to documents_dir, recursively included before candidate selection (e.g. ["manuals/product-a", "runbooks"]). Omit for all folders.
max_resultsintegerMaximum number of results (default: 5, capped by search.max_results).
min_scorenumberMinimum score (0.0–1.0) a result needs to be returned; default 0.0 returns all results. Scores are min-max normalized per query over its candidates: the best scores 1.0 and the weakest 0.0, while a single candidate or candidates that all tie score 1.0. On the hybrid path (results labeled hybrid, semantic or keyword) the candidates are the returned results, so any min_score above 0 drops at least the weakest one unless all tie; fts5 results are BM25 scores normalized over up to max(3 * max_results, 20) hits, so even the weakest returned one can score well above 0.0. It is not an absolute relevance bar.
query *stringSearch query text (1–3 keywords recommended; phrase queries also work)
search_methodstringDispatch selector (v4.8.2+). One of ``"auto"`` (router picks FTS5 fast-path for lexical queries when enabled, hybrid otherwise), ``"hybrid"`` (force hybrid path — kill switch for suspected router misclassification), or ``"fts5"`` (force FTS5 fast-path — debug/testing; errors out when the feature is disabled or the index is not ready). Default ``"auto"`` preserves pre-v4.8.2 behavior byte-for-byte when the fast-path is disabled in config.
snippet_modebooleanWhen true (default), truncates content to ~500 characters from the start of the matching chunk, at a natural break point, and adds a content_length field with the full size. Use get_document() to fetch full content when needed. Set to false to return the full content, which can include adjacent chunks; match_offset, when present, is where the match starts.
search_similarFinds documents similar to an indexed file
ParameterTypeDescription
filepath *stringPath to the reference document (must already be indexed — list_documents() lists indexed paths, one page at a time). E.g., "security/technique.md"
max_resultsintegerNumber of similar documents to return (default: 5, max: 20)
update_documentReplaces a document's content and re-indexes it
ParameterTypeDescription
content *stringNew full-text content to replace the existing content entirely
filepath *stringFull or relative path to the document file. Must be an already-indexed file — list_documents() lists indexed paths, one page at a time.

Security checks

  • ✓README presentThe repository's README runs to about 7.5K words.
  • ✓License declaredThe repository declares the MIT license.
  • ✓Tests presentA test suite exists in the repository.
  • !Dependencies pinnedNo lockfile. Installs can pull different code over time.
  • ✓No dynamic code executionScanned 25 source files and found no eval, dynamic Function or shell execution.

1 check has not been run yet.

Releases

v5.1.0v5.1.0 — Path-level watcher, non-blocking BM25 and orphan cleanup · 14 Nov 2026Minor release. Nothing breaking on upgrade, and existing indexes need no reindex. Most of it answers six reports from one large installation (a whole drive as `documents_dir`, about 610,000 chunks). Thank you, @MagnetoPause. Highlights…
v5.0.1v5.0.1 — Skills installer, npx forwarding and the CUDA memory fix · 6 Nov 2026Patch release. Nothing breaking on upgrade, and existing indexes need no reindex. Highlights Skills installer: `knowledge-rag skills install|uninstall|status` installs the 10 usage skills on Linux, macOS and Windows from a pip install or…
v5.0.0v5.0.0 — Paged list_documents, index safety and merge-blocking CI gates · 6 Nov 2026Upgrade note (BREAKING) `list_documents` now returns at most 100 documents by default (up to 200 with `limit`), together with `total`, `offset` and `limit`. To list everything, call it again with `offset` increased by `count` until…
v4.11.1v4.11.1 — Fresh-install startup fix and Windows-safe state writes · 25 Oct 2026What's Changed fix(tools): accept explicit null for optional str arguments by @vishalhabib99 in https://github.com/lyonzin/knowledge-rag/pull/236 ci(release): publish multi-arch Docker image (amd64 + arm64) by @viniciussantos45 in…
v4.11.0v4.11.0 — Cloud-sync data_dir guard · 4 Oct 2026Cloud-sync `data_dir` guard Preflight now detects when `paths.data_dir` lives under a cloud-sync folder and aborts startup with an actionable error before ChromaDB opens — preventing the native crash + auto-repair wipe loop that silently…

README

The repository's README runs to about 7.5K words, fetched 12 days ago. The original in the repository is authoritative.

Read full README
Questions

About Knowledge Rag

How do I install Knowledge Rag?

Run uvx knowledge-rag, then add the server to your MCP client's configuration.

Is Knowledge Rag safe to use with an AI agent?

Its trust score is 79 out of 100 (good). It passes 4 of the 5 static checks Conduid ran on the repository; it does not pass Dependencies pinned. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Knowledge Rag still maintained?

Yes — the latest release is v5.1.0 (14 Nov 2026), and the last commit was 4 days ago. The repository has 308 stars and 3 open issues.

What tools does Knowledge Rag provide?

Conduid read 13 tools from the source: add_document, add_from_url, evaluate_retrieval, get_document, get_index_stats, get_reindex_status, list_categories, list_documents and 5 more. 10 of them publish their parameters, listed under Tools above.

What license is Knowledge Rag released under?

The repository declares the MIT license. That applies to the latest release, v5.1.0, as well.