This release adds 5 notable features for engineering teams evaluating rollout.
✓ No known CVEs patched in this version
Topics
+14 more
Summary
AI summaryBM25 search performance improves 128× and new snippet_mode/min_score parameters add smarter output handling.
Full changelog
Search Performance & Output Quality
128× Faster BM25 Search
Custom inverted-index BM25 replaces rank-bm25 full-corpus scan. Only documents containing query terms are scored via posting lists. numpy.argpartition provides O(n) top-k selection instead of O(n log n) sort.
- Batched adjacent chunk fetch — single ChromaDB
collection.get()call replaces N round-trips per result - O(1) reverse lookup via
_source_to_dociddict eliminates linear scans across search, update, and remove operations
Smarter Output
Two new parameters on search_knowledge:
| Parameter | Default | Description |
|-----------|---------|-------------|
| snippet_mode | true | Truncates content to ~500 chars at natural break points. Reduces token consumption by ~72%. Adds content_length field with original size |
| min_score | 0.0 | Filters results below normalized relevance threshold (0.0-1.0). Response includes filtered_by_score count |
Both parameters are fully backwards-compatible — existing callers see improved output by default.
Changes
- PERF: Inverted-index BM25 with numpy top-k (128× speedup on 50K+ chunk corpora)
- PERF: Batch adjacent chunk fetch (single ChromaDB call)
- PERF: O(1) source→doc_id reverse lookup
- NEW:
snippet_modeparameter (default:true) - NEW:
min_scoreparameter (default:0.0) - NEW:
filtered_by_score+content_lengthresponse fields - DEPS:
rank-bm25replaced bynumpy(direct dependency) - TEST: 6 new tests + updated backwards-compat baseline
- DOCS: Updated architecture flowcharts, API reference, changelog
CI Status
✅ Quality Gate — 16/16 checks passed (7 pillars)
✅ CI — 9/9 matrix cells passed (Linux + Windows + macOS × Python 3.11/3.12/3.13)
✅ Security — CodeQL passed
✅ 226 tests passed, 0 failed
Install / Upgrade
pip install --upgrade knowledge-rag
# or
npx -y [email protected]
Weekly OSS security release digest.
The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.
No spam, unsubscribe anytime.
Share this release
About lyonzin/knowledge-rag
Local RAG system for Claude Code with hybrid search (BM25 + semantic), cross-encoder reranking, markdown-aware chunking, query expansion, and 12 MCP tools. Runs entirely offline with zero external servers.
Beta — feedback welcome: [email protected]