The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Knowledge Rag listing page.
Hybrid search · Cross-encoder reranking · 35 file formats · 100% local · Zero cloud · Enterprise-grade plumbing built-in.
Quick Start · Why knowledge-rag · Compare · Enterprise Features · Docs
Chart updated daily by GitHub Action
Most RAG frameworks fall into one of three traps: (1) they require you to ship your data to a cloud API, (2) they hand you 300 building blocks and 0 opinionated defaults, or (3) they bundle RAG as a 5% feature of a much bigger platform you didn't ask for.
knowledge-rag does one thing well: it is the MCP-native local RAG server that Claude Code, Cursor, Windsurf, VS Code, Cline, Gemini CLI and Zed can search out of the box — with enterprise plumbing (bearer auth, Prometheus metrics, rate limiting, health probes, structured JSON logging, zero-downtime reindex) that no other RAG-focused OSS ships built-in.
🔒 100% local, 0% cloudYour files never leave the machine. No vendor lock-in, no data-residency headache, no forced cloud dependency. LGPD / GDPR / HIPAA compliant by architecture — because there is nothing to comply about when nothing leaves. |
🚀 Zero-friction setup
|
🛡️ Production-grade OSS7-pillar quality gate on every PR (35+ automated checks), 9-cell OS×Python CI matrix (Linux + Windows + macOS × 3.11/3.12/3.13), nightly chaos + 50K-iteration soak + mutation testing. 700+ tests. 0 known regressions. |
💰 Zero ongoing costNo token bills. No SaaS tier. No paid features hidden behind a wall. MIT license, forever. Runs on the laptop you already have — GPU optional, CPU works fine with FastEmbed ONNX. |
We audited 16 popular RAG frameworks and platforms (LlamaIndex, LangChain, ChromaDB, Weaviate, Qdrant, RAGFlow, LightRAG, DSPy, GraphRAG, Haystack, RAG-Anything, kotaemon, txtai, llmware, Dify, open-webui, FastGPT) so you can pick honestly.
Legend: ✅ built-in · 🟡 plugin / paid tier / partial · ❌ not available · ⚠️ license or default concern
| Dimension | 🎯 knowledge-rag | LlamaIndex | LangChain | Haystack | RAGFlow | txtai | open-webui | Dify | Qdrant |
|---|---|---|---|---|---|---|---|---|---|
| 100% local, zero cloud | ✅ | 🟡 | ✅ | 🟡 | 🟡 | ✅ | ✅ | 🟡 | 🟡 |
| MCP native (Claude/Cursor) | ✅ 13 tools | 🟡 pkg | 🟡 adapter | 🟡 wrapper | 🟡 add-on | ✅ | ✅ consumer | ✅ | ❌ |
| Hybrid BM25 + semantic | ✅ 128× faster | 🟡 | 🟡 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Cross-encoder rerank | ✅ builtin | ❌ | 🟡 | ✅ | ✅ fused | ❌ | ✅ | 🟡 | 🟡 |
| Bearer auth builtin | ✅ | ❌ | ❌ | ❌ core | ❌ | 🟡 | ✅ RBAC | ✅ OAuth2 | ✅ |
Prometheus /metrics | ✅ | ❌ | ❌ | ❌ core | ❌ | ❌ | ✅ OTel | ❌ | ✅ |
| Rate limiting | ✅ sliding-window | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ |
Health probes (/health) | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | 🟡 | 🟡 | ✅ |
| Structured JSON logging | ✅ opt-in | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ OTel | 🟡 | ✅ |
| Zero-downtime reindex | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
| Async background reindex | ✅ + polling | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | 🟡 |
| GPU CUDA optional | ✅ 12 auto | ❌ | 🟡 | ✅ | ✅ | ✅ | ✅ | 🟡 | 🟡 |
| File formats builtin | ✅ 20 | 0 (LlamaParse=$) | 50+ plugins | ✅ 36+ | 8+ | ? | ? | ~10 | ❌ |
| Setup < 5 min POC | ✅ pip 1-liner | ✅ | ✅ | ✅ | ❌ 16GB RAM | ✅ | ✅ docker | ✅ docker | ✅ |
| Nightly chaos + soak + mutation | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| License | ✅ MIT | MIT | MIT | Apache-2.0 | Apache-2.0 | Apache-2.0 | ⚠️ preserving | ⚠️ restrictive | Apache-2.0 |
The 5 dimensions where knowledge-rag is unique: health probes + JSON logging + Prometheus + rate limit + bearer auth simultaneously built-in on an OSS RAG-focused MCP server. Zero-downtime reindex + async background reindex + nightly chaos/soak/mutation are documented on nobody else's README.
Pick your integration path — knowledge-rag ships the same server through every channel.
Drop your PDFs, markdown, code files into documents/. Restart your MCP client. Ask it:
That's it. First query loads the ONNX embedding model (~200MB, one-off download). Subsequent queries are cached and hit sub-second latency.
curl http://your-host:8179/health → 200 + JSON payloadhttp://your-host:9179/metricsAuthorization: Bearer your-secret-tokenFull installation guide with all 5 methods, 8 MCP client configurations, and GPU setup: docs/INSTALLATION.md →
Installing knowledge-rag gives your agent 13 MCP tools. It does not tell the agent when to use them. That is what the skills/ folder solves — drop-in behavioural skills for Claude Code, Cursor, Windsurf, Cline, Zed, VS Code Copilot that turn "AI with access to RAG" into "AI that actually uses RAG first".
10 skills, MIT licensed, organized by kind:
| # | Skill | What it does |
|---|---|---|
| 1 | rag-check-first | Search the corpus before answering any technical claim |
| 2 | rag-cite-sources | Every claim ships with path:line citations |
| 3 | rag-onboard-context | First interaction of a session probes what is indexed |
| 4 | rag-deep-dive | 3-step drill: search → fetch → find similar |
| 5 | rag-web-fallback | Only hit the web when local RAG comes back empty |
| 6 | rag-troubleshoot | Bug / error → RAG first for prior fixes |
| 7 | rag-code-review | Review consults ADRs / patterns before commenting |
| 8 | rag-index-decisions | After a decision, index it back — close the feedback loop |
| 9 | rag-security-first | Security tasks: MITRE / CVE / runbook first |
| 10 | rag-evaluate-quality | Weekly checkup — MRR@5 · Recall@5 · Precision@5 |
Install — pick the shortest path for your machine:
Both restart-Claude-Code and you are done. Option 2 supports --project, --only rag-check-first,rag-cite-sources, --dry-run, --help.
For Cursor, Windsurf, Cline and full manual instructions → skills/README.md · Full catalog with skill chains → skills/CATALOG.md
Once installed, your AI agent gets these 13 tools automatically:
| Tool | Purpose |
|---|---|
search_knowledge | Hybrid semantic + BM25 with cross-encoder rerank |
get_document | Retrieve full content of one document |
search_similar | Find documents similar to a reference |
evaluate_retrieval | Measure MRR@5 · Recall@5 · Precision@5 |
add_document | Index a new document via MCP |
update_document | Re-index a changed document |
remove_document | Drop a document + all its chunks |
add_from_url | Fetch, sanitize, and index a URL |
list_documents | Enumerate indexed documents |
list_categories | Auto-tagged by folder path |
get_index_stats | Corpus size, cache hit rate, embedding dim |
reindex_documents | Smart incremental OR nuclear rebuild |
get_reindex_status | Live progress polling (async reindex) |
Full API reference with parameter details, return schemas, examples: docs/API.md →
Every RAG framework claims "production-ready." Here is what knowledge-rag ships in the OSS core, verified by regression tests, that competitors either paywall, plugin-ify, or simply don't have.
Security
|
Observability
|
Scale & performance
|
Reliability
|
Preset: cybersecurity.yaml · 8 categories · 200+ routing keywords · 69 query expansions
Ingest MITRE ATT&CK, threat reports, exploit writeups, incident reports. Search from Claude Code with search_knowledge("privilege escalation windows") and get instant recall across your entire corpus. Air-gapped — nothing leaves the laptop.
Preset: developer.yaml · 9 categories · 150+ routing keywords · 50+ expansions
Replace Confluence hunting. Ingest architecture docs, ADRs, runbooks, code, API specs. Devs ask their AI agent "how do we authenticate the payment service" and get the exact ADR + implementation file citation.
Preset: research.yaml · 9 categories · 100+ routing keywords · 40+ expansions
Index arXiv papers, lab notebooks, dataset documentation. Semantic search finds papers by intent, not just keywords — cross-encoder reranking surfaces the actually-relevant one instead of five that share a term.
Preset: general.yaml · blank slate, pure semantic search
Deploy via SSE on a single VM. 40+ users authenticated via bearer token, rate-limited, Prometheus-monitored, /health probes wired to your load balancer, JSON logs shipped to Datadog. No cloud calls. Meets LGPD, GDPR, HIPAA data-locality requirements by design.
Verified at scale: production reproduction on a 5 889-doc / 75 016-chunk corpus with concurrent queries during a nuclear rebuild — zero downtime, zero errors (see CHANGELOG v4.8.3).
End-to-end view of how MCP clients, the retrieval pipeline, storage, and enterprise plumbing connect. Every arrow is a real code path — nothing pictured here is aspirational.
Reading the diagram (top → bottom):
WWW-Authenticate), then rate limiter (sliding window).@rate_limited + @instrument — Prometheus counts every call, rate limiter enforces RPM+burst, both zero-cost when disabled.search_knowledge checks the query cache first; cache miss routes through the Query Router (regex classifier) to either the FTS5 fast-path (lexical) or the hybrid pipeline (BM25 + semantic + RRF + cross-encoder rerank).index_metadata.json for durable state.documents/, 35 parsers handle each format, chunker respects language boundaries, FastEmbed ONNX generates embeddings, SHA256 deduplicates, and a staging swap performs zero-downtime rebuilds with rollback-on-failure./metrics, structured JSON logs, /health payload — attaches to the same instrumentation points, no code changes required.config.yaml (with 5 domain presets) controls every subsystem — no environment variable spaghetti, no hardcoded paths.Complete architecture — 4 detailed Mermaid diagrams (System Overview · Query Flow · Document Ingestion · hybrid_alpha effect): docs/ARCHITECTURE.md
Every parser is chunk-aware — Markdown splits at ## headers, code splits at function/class boundaries, notebooks skip base64 outputs, PDFs use PyMuPDF, spreadsheets extract sheet-by-sheet. 33 formats are enabled by default; the 2 MetaTrader formats are opt-in (add to documents.supported_formats in config.yaml).
| # | Format | Extension | Parser | Default | Notes |
|---|---|---|---|---|---|
| 1 | Markdown | .md | Section-aware (splits at ##) | Yes | Headers preserved as chunk boundaries |
| 2 | Plain Text | .txt | Fixed-size chunking | Yes | 1000 chars + 200 overlap |
| 3 | .pdf | PyMuPDF extraction | Yes | Text-based PDFs only (no OCR) | |
| 4 | Word | .docx | python-docx | Yes | Headings preserved as markdown |
| 5 | Excel | .xlsx | openpyxl | Yes | Sheet-by-sheet extraction |
| 6 | PowerPoint | .pptx | python-pptx | Yes | Slide-by-slide extraction |
| 7 | Jupyter Notebook | .ipynb | Cell-aware parser | Yes | Markdown + code cells only; skips outputs/base64 |
| 8 | JSON | .json | Structure-aware | Yes | Flattened key-value extraction |
| 9 | CSV | .csv | Row-based parser | Yes | Headers + rows as text |
| 10 | XML | .xml | XML parser | Yes | Root element + namespace metadata |
| 11 | Python | .py | Code-aware parser | Yes | Functions/classes as chunks |
| 12 | C Source | .c | Code-aware parser | Yes | Functions / structs / includes extracted |
| 13 | C/C++ Header | .h | Code-aware parser | Yes | Function declarations + structs extracted |
| 14 | C++ Source | .cpp | Code-aware parser | Yes | Classes / structs / includes extracted |
| 15 | JavaScript | .js | Code-aware parser | Yes | Functions / classes / imports (ESM + CJS) |
| 16 | React JSX | .jsx | Code-aware parser | Yes | Same as JS parser |
| 17 | TypeScript | .ts | Code-aware parser | Yes | Functions / classes / interfaces / enums / imports |
| 18 | React TSX | .tsx | Code-aware parser | Yes | Same as TS parser |
| 19 | Go | .go | Code-aware parser | Yes | Functions / structs / imports extracted |
| 20 | Rust | .rs | Code-aware parser | Yes | Functions / structs / enums / traits / use imports |
| 21 | Kotlin | .kt | Code-aware parser | Yes | Functions (incl. class members) / classes extracted |
| 22 | YAML | .yaml | YAML parser | Yes | Kubernetes kind / apiVersion / name extracted |
| 23 | YAML | .yml | YAML parser | Yes | Same as YAML parser |
| 24 | HuJSON | .hujson | HuJSON parser | Yes | JSON with comments + trailing commas (e.g. Tailscale ACLs) |
| 25 | CUE | .cue | Code-aware parser | Yes | Imports / package extracted |
| 26 | Protocol Buffers | .proto | Proto parser | Yes | Services / messages / RPCs extracted |
| 27 | Rego | .rego | Code-aware parser | Yes | OPA policies — imports / package extracted |
| 28 | SQL | .sql | SQL parser | Yes | Table names + statement types extracted |
| 29 | Shell | .sh | Shell parser | Yes | Function names extracted |
| 30 | jq | .jq | Shell parser | Yes | Indexed as shell-style script |
| 31 | Dockerfile | Dockerfile | Text parser | Yes | Matched by exact filename (no extension) |
| 32 | Makefile | Makefile | Text parser | Yes | Matched by exact filename (no extension) |
| 33 | Tiltfile | Tiltfile | Code-aware parser | Yes | Starlark — def functions / load() extracted |
| 34 | MQL4 Source | .mq4 | Code parser | No | MetaTrader — opt-in via documents.supported_formats |
| 35 | MQL4 Header | .mqh | Code parser | No | MetaTrader — opt-in via documents.supported_formats |
Enable an opt-in format — add the extension to
documents.supported_formatsin yourconfig.yaml:
Full parser reference with per-format notes: docs/CONFIGURATION.md
|
Claude Code |
Claude Desktop |
Cursor |
Windsurf |
VS Code |
Cline · Gemini CLI · Zed |
Complete client configuration guide with JSON schemas per client: docs/INSTALLATION.md#use-with-other-mcp-clients →
Pre-built presets: cybersecurity.yaml · developer.yaml · research.yaml · general.yaml · multilingual.yaml
Complete configuration reference — every field, every default, tuning guide: docs/CONFIGURATION.md →
knowledge-rag is designed for teams that cannot let their documents leave the perimeter.
| Requirement | How knowledge-rag delivers |
|---|---|
| Data locality (LGPD / GDPR / HIPAA) | 100% on-premise, zero egress network calls after initial model download |
| Air-gapped deployment | ONNX models pre-cached; set HF_HUB_OFFLINE=1 to enforce zero-network |
| CVE monitoring | Dependabot (weekly) + pip-audit + Socket + CodeQL |
| Supply chain security | PyPI Trusted Publishing via OIDC (no long-lived tokens) |
| Vulnerability disclosure | Private security advisory via SECURITY.md |
| Signed release attestations | GitHub release attestations on every published version |
| Reproducible builds | Locked requirements.txt with pinned versions |
| Authenticated access | Bearer token middleware on SSE / HTTP transports (constant-time compare, RFC 6750) |
| Rate limiting | Sliding-window per-client RPM + burst (opt-in, zero-cost when disabled) |
| Audit-ready logging | Opt-in structured JSON logs → ship to your SIEM |
| Path traversal defenses | CWE-22 / CWE-59 guards on 6 CRUD tools |
| Prompt injection defense | 3-layer sanitization on add_from_url (OWASP LLM01:2025) |
OpenSSF Best Practices badge: passing · project ID #13864
Public benchmark dashboard: https://lyonzin.github.io/knowledge-rag/
| Doc | What's inside |
|---|---|
| Installation guide | 5 install methods · 8 MCP client integrations · GPU setup |
| API reference | Complete reference for all 13 MCP tools |
| Configuration reference | Every config.yaml field · presets · tuning |
| Architecture | 4 Mermaid diagrams: System Overview · Query Flow · Ingestion · hybrid_alpha |
| Troubleshooting | 11 common issues + solutions |
| FTS5 fast-path guide | Opt-in lexical fast-path — when and how |
| Reindex operations | Zero-downtime rebuild · resume · checkpoint |
| GPU setup | CUDA 12 installation + troubleshooting |
| Migration to v4.8.0 | Embedding profile · multilingual · zero-downtime |
| Security policy | Threat model · disclosure channel |
| Contributing | Development · testing · PR process |
| Changelog | All release notes since v1.0.0 |
Response SLA (best-effort, community project):
/health endpoint + opt-in JSON structured loggingFull history: CHANGELOG.md →
MIT License — LICENSE. Forever. No cloud upsell, no dual-licensing, no restrictive clauses. Fork it, sell derivatives, embed it in commercial products — the license does not care.
Built on the shoulders of amazing open-source projects:
Xenova/ms-marco-MiniLM-L-6-v2 cross-encoderbge-small-en-v1.5 embedding modelCommunity contributors: @Hohlas · @eeshsaxena · Sergey Khokhlov · and everyone who filed issues or PRs.
Built by Ailton Rocha (Lyon.) · Star ⭐ if this saves you time · Report an issue · Contribute
knowledge-rag — the MCP-first local RAG server for Claude Code, Cursor, Windsurf, and every AI agent.