knowledge-rag 3.6.2 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-
](https://pypi.org/project/knowledge-rag/)
|
|
6
|
+
[](https://www.npmjs.com/package/knowledge-rag)
|
|
7
|
+
[](https://pepy.tech/project/knowledge-rag)
|
|
6
8
|

|
|
7
9
|

|
|
8
10
|

|
|
@@ -10,7 +12,6 @@
|
|
|
10
12
|
[](https://github.com/lyonzin/knowledge-rag/actions/workflows/ci.yml)
|
|
11
13
|
[](https://github.com/lyonzin/knowledge-rag/actions/workflows/security.yml)
|
|
12
14
|
[](https://glama.ai/mcp/servers/lyonzin/knowledge-rag)
|
|
13
|
-
[](https://pypi.org/project/knowledge-rag/)
|
|
14
15
|
|
|
15
16
|
### Your docs, your machine, zero cloud. Claude Code searches them natively.
|
|
16
17
|
|
|
@@ -771,7 +772,7 @@ models:
|
|
|
771
772
|
dimensions: 384
|
|
772
773
|
gpu: false # Set true + pip install knowledge-rag[gpu]
|
|
773
774
|
reranker:
|
|
774
|
-
enabled: true #
|
|
775
|
+
enabled: true # Falls back to RRF if model is unavailable
|
|
775
776
|
model: "Xenova/ms-marco-MiniLM-L-6-v2"
|
|
776
777
|
top_k_multiplier: 3 # Candidates fetched before reranking
|
|
777
778
|
|
|
@@ -858,6 +859,8 @@ For `.md` files, chunking splits at `##` and `###` header boundaries first. Sect
|
|
|
858
859
|
| `models.reranker.model` | `Xenova/ms-marco-MiniLM-L-6-v2` | Reranker model |
|
|
859
860
|
| `models.reranker.top_k_multiplier` | 3 | Fetch N*multiplier candidates for reranking |
|
|
860
861
|
|
|
862
|
+
If the reranker model is not available locally and the machine cannot download it, search now falls back to the RRF order from hybrid semantic+BM25 retrieval. This keeps `search_knowledge` available offline, but result ordering may be less precise for ambiguous queries until the reranker model is cached.
|
|
863
|
+
|
|
861
864
|
**Embedding model options** (fastest → most accurate):
|
|
862
865
|
- `BAAI/bge-small-en-v1.5` — 384D, ~33MB (default)
|
|
863
866
|
- `BAAI/bge-base-en-v1.5` — 768D, ~130MB
|
|
@@ -988,6 +991,31 @@ rm -rf models_cache
|
|
|
988
991
|
# Then restart the MCP server
|
|
989
992
|
```
|
|
990
993
|
|
|
994
|
+
### Reranker model download fails
|
|
995
|
+
|
|
996
|
+
The reranker is lazy-loaded on the first query. If the model is not cached and the machine is offline, search continues without reranking and uses the RRF order from hybrid retrieval. To keep reranking enabled offline, run one query while online or pre-populate `models_cache/` on the target machine.
|
|
997
|
+
|
|
998
|
+
You can still disable reranking explicitly in `config.yaml`:
|
|
999
|
+
|
|
1000
|
+
```yaml
|
|
1001
|
+
models:
|
|
1002
|
+
reranker:
|
|
1003
|
+
enabled: false
|
|
1004
|
+
```
|
|
1005
|
+
|
|
1006
|
+
Disabling reranking reduces memory use and avoids first-query model loading. The tradeoff is lower ranking precision, especially when several chunks match the same terms but only one is the best answer.
|
|
1007
|
+
|
|
1008
|
+
### ChromaDB index crashes on startup
|
|
1009
|
+
|
|
1010
|
+
Native ChromaDB failures can terminate Python before normal exception handling runs. Startup now probes ChromaDB in a child process before initializing the MCP server. If the probe crashes, the active `chroma_db/` and `index_metadata.json` are moved to `data/backups/auto-repair-*`, and the next startup can rebuild a clean index.
|
|
1011
|
+
|
|
1012
|
+
The same guarded behavior is available through either console script:
|
|
1013
|
+
|
|
1014
|
+
```bash
|
|
1015
|
+
knowledge-rag
|
|
1016
|
+
knowledge-rag-guarded
|
|
1017
|
+
```
|
|
1018
|
+
|
|
991
1019
|
### Index is empty
|
|
992
1020
|
|
|
993
1021
|
```bash
|
|
@@ -1018,7 +1046,7 @@ pip install --upgrade knowledge-rag
|
|
|
1018
1046
|
|
|
1019
1047
|
### Slow first query
|
|
1020
1048
|
|
|
1021
|
-
The cross-encoder reranker model is lazy-loaded on the first query. This adds a one-time ~2-3 second delay for model download and loading. Subsequent queries are fast.
|
|
1049
|
+
The cross-encoder reranker model is lazy-loaded on the first query. This adds a one-time ~2-3 second delay for model download and loading. Subsequent queries are fast. If the model cannot be loaded, search falls back to RRF ordering and does not retry loading the reranker until the server restarts.
|
|
1022
1050
|
|
|
1023
1051
|
### Memory usage
|
|
1024
1052
|
|
|
@@ -1028,6 +1056,13 @@ With ~200 documents, expect ~300-500MB RAM. The embedding model (~50MB) and rera
|
|
|
1028
1056
|
|
|
1029
1057
|
## Changelog
|
|
1030
1058
|
|
|
1059
|
+
### Unreleased
|
|
1060
|
+
|
|
1061
|
+
- **FIX**: Startup preflight probes ChromaDB in a child process and moves crashing persistent indexes to `data/backups/auto-repair-*` before MCP initialization.
|
|
1062
|
+
- **FIX**: Reranker load failures now fall back to RRF ordering instead of failing `search_knowledge` on offline machines.
|
|
1063
|
+
- **FIX**: Virtualenv project-root detection now handles Python symlinks that resolve to the system interpreter.
|
|
1064
|
+
- **NEW**: `knowledge-rag-guarded` console script kept as an explicit guarded startup alias.
|
|
1065
|
+
|
|
1031
1066
|
### v3.6.2 (2026-04-23)
|
|
1032
1067
|
|
|
1033
1068
|
- **INFRA**: NPM provenance attestation (SLSA supply chain security), full README on npm page
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knowledge-rag",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "Local RAG System for Claude Code — Hybrid search + Cross-encoder Reranking + 12 MCP Tools + 20 Format Parsers. Zero external servers.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"knowledge-rag": "./bin/cli.js"
|