| ### 🔒 100% local, 0% cloud Embedding generation, indexing, and retrieval run locally. Model downloads and `add_from_url` use network access, and configured MCP clients receive retrieved content. Choose the corpus, client permissions, and network exposure to fit your deployment; this project does not certify regulatory compliance. | ### 🚀 Zero-friction setup `pip install knowledge-rag` → restart your MCP client → done. **No Docker mandatory. No Ollama required. No separate embedding server.** Everything runs in-process via FastEmbed ONNX. **Works offline** after the first model download. |
| ### 🛡️ Production-grade OSS 7-pillar quality workflow, a 9-cell OS×Python CI matrix (Linux + Windows + macOS × 3.11/3.12/3.13), and nightly chaos, bounded-memory soak and mutation tests. Inspect the checks on the revision being deployed; CI coverage is not a guarantee of zero defects. | ### 💰 Zero ongoing cost No 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. |
| ### Security - **Bearer token auth** on SSE / HTTP transports — constant-time comparison (`hmac.compare_digest`), RFC 6750 challenge, 401 fenced with `WWW-Authenticate` header - **Path traversal + symlink escape defenses** — `validate_path_within` guarding 6 CRUD tools (CWE-22, CWE-59) - **External-content handling** — known-token neutralization and a stored provenance fence, with parser metadata propagation. These are limited mitigations; clients must still treat retrieved content as untrusted data. See [SECURITY.md](SECURITY.md). - **OpenSSF Best Practices** project [#13864](https://www.bestpractices.dev/en/projects/13864) · **CodeQL** weekly scan · **Bandit + Semgrep + Gitleaks + pip-audit** workflows. Review actual check results and exceptions for the release you deploy. - **PyPI Trusted Publishing** via OIDC (zero long-lived tokens in CI) | ### Observability - **Prometheus `/metrics` endpoint** — custom histogram buckets tuned for RAG (p95 ≤ 10ms fast-path targets), 7 canonical metrics via `@instrument` decorator on all 13 tools - **Rate limiting** — thread-safe sliding-window counter, per-client RPM + burst, zero overhead when disabled - **Health probes** — `GET /health` and `/healthz` returning `{status, version, uptime_seconds, cache}` in front of the auth middleware (probes always succeed) - **Structured JSON logging** — opt-in via `server.logging.format: "json"`, one JSON object per record ready for ELK / Loki / Datadog / CloudWatch - **Public benchmark dashboard** on GitHub Pages |
| ### Scale & performance - **SSE / streamable-http transport** — 1 server serves N MCP clients, ChromaDB WAL mode enabled automatically, shared embedding model + query cache - **BM25 inverted index** — keyword candidate retrieval without scoring every document for every query - **FTS5 SQLite fast path** — opt-in lexical retrieval; measure relevance and latency on your identifiers and corpus - **Cross-encoder reranking** — Xenova/ms-marco-MiniLM-L-6-v2; optional model scoring of a candidate pool - **NVIDIA CUDA embeddings** and experimental Windows AMD DirectML opt-in, with actual-session checks and CPU fallback; [setup and compatibility limits](docs/gpu-setup.md) - **Query cache** — LRU + 5-minute TTL, with mutation invalidation - **Staging rebuild** — populate and validate a replacement while the current collection remains available; handled publication failures roll back - **Async background reindex** with `get_reindex_status()` polling | ### Reliability - **Nightly chaos injection** — HuggingFace Hub offline · ONNX zero-byte replay · watchdog crash recovery (3 scenarios in `tests/chaos/`) - **50,000-iteration soak test** — checks a fixed memory-growth budget with stub embeddings (`KNOWLEDGE_RAG_SOAK_ITERATIONS=50000`); this is not a one-hour real-model endurance test - **Mutation testing** (mutmut) on `instance_lock` + `preflight` — catches tests that are too weak - **Determinism check** — full test suite × 3, catches flakes - **Backwards compatibility** — 13 MCP tools, signature regression tests and legacy YAML fixtures; optional additions preserve existing calls - **API surface AST diff** — checks structural signature changes alongside behavioral tests - **9-cell CI matrix** — Linux + Windows + macOS × 3.11 + 3.12 + 3.13 |
|
**Claude Code** `~/.claude.json` |
**Claude Desktop** `claude_desktop_config.json` |
**Cursor** `~/.cursor/mcp.json` |
**Windsurf** `~/.codeium/windsurf/mcp_config.json` |
**VS Code** Copilot Chat `mcp.json` |
**Cline · Gemini CLI · Zed** Native MCP |