knowledge-rag 4.9.1__tar.gz → 4.9.2__tar.gz
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.
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/PKG-INFO +3 -1
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/README.md +2 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/mcp_server/__init__.py +1 -1
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/mcp_server/preflight.py +30 -4
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/pyproject.toml +1 -1
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/.gitignore +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/LICENSE +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/bench/dashboard/README.md +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/config.example.yaml +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/mcp_server/config.py +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/mcp_server/fts5_index.py +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/mcp_server/guarded.py +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/mcp_server/health.py +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/mcp_server/ingestion.py +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/mcp_server/instance_lock.py +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/mcp_server/logging_config.py +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/mcp_server/metrics.py +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/mcp_server/query_router.py +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/mcp_server/ratelimit.py +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/mcp_server/security.py +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/mcp_server/server.py +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/npm/README.md +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/presets/cybersecurity.yaml +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/presets/developer.yaml +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/presets/general.yaml +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/presets/multilingual.yaml +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/presets/research.yaml +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/requirements.txt +0 -0
- {knowledge_rag-4.9.1 → knowledge_rag-4.9.2}/skills/README.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: knowledge-rag
|
|
3
|
-
Version: 4.9.
|
|
3
|
+
Version: 4.9.2
|
|
4
4
|
Summary: Local RAG System for Claude Code — Hybrid search + Cross-encoder Reranking + 13 MCP Tools + 20 Format Parsers. Zero external servers.
|
|
5
5
|
Project-URL: Homepage, https://github.com/lyonzin/knowledge-rag
|
|
6
6
|
Project-URL: Repository, https://github.com/lyonzin/knowledge-rag
|
|
@@ -636,6 +636,8 @@ Native MCP
|
|
|
636
636
|
|
|
637
637
|
**Complete client configuration guide with JSON schemas per client:** [docs/INSTALLATION.md#use-with-other-mcp-clients →](docs/INSTALLATION.md#use-with-other-mcp-clients)
|
|
638
638
|
|
|
639
|
+
> ⚠️ **Operating model — read once.** Your MCP client (Claude Desktop, Code, Cursor, etc.) **spawns and owns the knowledge-rag server process**. Do **NOT** also run `knowledge-rag` in a terminal while your MCP client is open — two writer processes against the same `data_dir` corrupt the ChromaDB HNSW segment on Windows (see [issue #216](https://github.com/lyonzin/knowledge-rag/issues/216)). Recommended baseline: add `"KNOWLEDGE_RAG_SINGLE_INSTANCE": "1"` to the `env` block of your MCP config as a safety net. Full explanation + how to run CLI commands safely: [docs/single-instance.md](docs/single-instance.md).
|
|
640
|
+
|
|
639
641
|
---
|
|
640
642
|
|
|
641
643
|
## ⚙️ Configuration in 30 seconds
|
|
@@ -588,6 +588,8 @@ Native MCP
|
|
|
588
588
|
|
|
589
589
|
**Complete client configuration guide with JSON schemas per client:** [docs/INSTALLATION.md#use-with-other-mcp-clients →](docs/INSTALLATION.md#use-with-other-mcp-clients)
|
|
590
590
|
|
|
591
|
+
> ⚠️ **Operating model — read once.** Your MCP client (Claude Desktop, Code, Cursor, etc.) **spawns and owns the knowledge-rag server process**. Do **NOT** also run `knowledge-rag` in a terminal while your MCP client is open — two writer processes against the same `data_dir` corrupt the ChromaDB HNSW segment on Windows (see [issue #216](https://github.com/lyonzin/knowledge-rag/issues/216)). Recommended baseline: add `"KNOWLEDGE_RAG_SINGLE_INSTANCE": "1"` to the `env` block of your MCP config as a safety net. Full explanation + how to run CLI commands safely: [docs/single-instance.md](docs/single-instance.md).
|
|
592
|
+
|
|
591
593
|
---
|
|
592
594
|
|
|
593
595
|
## ⚙️ Configuration in 30 seconds
|
|
@@ -49,17 +49,43 @@ def _backup_active_index(reason: str) -> Path:
|
|
|
49
49
|
fallback copy+rmtree path in shutil.move leaks a partial copy in
|
|
50
50
|
backups/ AND a partially deleted live chroma_db/ when another process
|
|
51
51
|
holds a segment file open (WinError 32).
|
|
52
|
+
|
|
53
|
+
The two moves (metadata JSON + chroma_db dir) must be all-or-nothing.
|
|
54
|
+
If we moved chroma_db first and metadata failed (antivirus scanning
|
|
55
|
+
the JSON, brief file lock), restart would find `chroma_db` gone but
|
|
56
|
+
`index_metadata.json` still live — incremental reindex would then
|
|
57
|
+
read the orphan metadata, mark every doc as "already indexed", and
|
|
58
|
+
silently produce an empty collection. To prevent that, metadata is
|
|
59
|
+
moved first (small file, low lock probability) and chroma_db is
|
|
60
|
+
wrapped in try/except that rolls the metadata rename back before
|
|
61
|
+
re-raising. Restart then sees the pristine pre-quarantine state
|
|
62
|
+
and re-runs preflight cleanly.
|
|
52
63
|
"""
|
|
53
64
|
stamp = datetime.now().strftime("%Y%m%d-%H%M%S")
|
|
54
65
|
backup_dir = config.data_dir / "backups" / f"auto-repair-{stamp}"
|
|
55
66
|
backup_dir.mkdir(parents=True, exist_ok=False)
|
|
56
67
|
|
|
57
|
-
if config.chroma_dir.exists():
|
|
58
|
-
os.rename(str(config.chroma_dir), str(backup_dir / f"chroma_db.{reason}"))
|
|
59
|
-
|
|
60
68
|
metadata_file = config.data_dir / "index_metadata.json"
|
|
69
|
+
metadata_backup = backup_dir / f"index_metadata.{reason}.json"
|
|
70
|
+
metadata_moved = False
|
|
61
71
|
if metadata_file.exists():
|
|
62
|
-
os.rename(str(metadata_file), str(
|
|
72
|
+
os.rename(str(metadata_file), str(metadata_backup))
|
|
73
|
+
metadata_moved = True
|
|
74
|
+
|
|
75
|
+
if config.chroma_dir.exists():
|
|
76
|
+
try:
|
|
77
|
+
os.rename(str(config.chroma_dir), str(backup_dir / f"chroma_db.{reason}"))
|
|
78
|
+
except OSError:
|
|
79
|
+
if metadata_moved:
|
|
80
|
+
# Rollback the metadata move so the two files stay consistent.
|
|
81
|
+
# If the rollback itself fails (unlikely — dst dir is fresh)
|
|
82
|
+
# we still re-raise the original OSError so the caller can
|
|
83
|
+
# exit cleanly instead of leaving the system in a wedged state.
|
|
84
|
+
try:
|
|
85
|
+
os.rename(str(metadata_backup), str(metadata_file))
|
|
86
|
+
except OSError:
|
|
87
|
+
pass
|
|
88
|
+
raise
|
|
63
89
|
|
|
64
90
|
return backup_dir
|
|
65
91
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "knowledge-rag"
|
|
7
|
-
version = "4.9.
|
|
7
|
+
version = "4.9.2"
|
|
8
8
|
description = "Local RAG System for Claude Code — Hybrid search + Cross-encoder Reranking + 13 MCP Tools + 20 Format Parsers. Zero external servers."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|