Common problems and their solutions when running knowledge-rag on Windows, Linux, or macOS.
Not finding your issue?
- Search existing issues → https://github.com/lyonzin/knowledge-rag/issues
- Open a new bug report → https://github.com/lyonzin/knowledge-rag/issues/new/choose
- Discussions → https://github.com/lyonzin/knowledge-rag/discussions
Related docs:
Requires Python 3.11 or newer.
python --version # Must be 3.11+On first run, FastEmbed downloads models to models_cache/. If the download fails:
# Clear cache and retry
# Windows:
rmdir /s /q models_cache
# Linux/macOS:
rm -rf models_cache
# Then restart the MCP serverThe 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.
You can still disable reranking explicitly in config.yaml:
models:
reranker:
enabled: falseDisabling 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.
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.
The same guarded behavior is available through either console script:
knowledge-rag
knowledge-rag-guarded# Check documents directory has files
ls documents/
# Force reindex via Claude Code:
# reindex_documents(force=True)
# Or nuclear rebuild if model changed:
# reindex_documents(full_rebuild=True)- Check
~/.claude.jsonexists and has valid JSON in themcpServerssection - Verify paths use double backslashes (
\\) on Windows - Restart Claude Code completely
- Run
claude mcp listto check connection status
The MCP server uses stdout for JSON-RPC communication. If a library prints to stdout during init, the stream gets corrupted. v3.4.3+ includes stdout protection that prevents this. If you're on an older version, upgrade:
pip install --upgrade knowledge-ragThe 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.
With ~200 documents, expect ~300-500MB RAM. The embedding model (~200MB ONNX runtime resident, lazy-loaded on first query since v3.8.0) and reranker (~25MB, lazy-loaded) are loaded into memory only when actually used. For very large knowledge bases (1000+ documents), consider enabling GPU acceleration and using exclude patterns to limit index scope.
MCP stdio is one process per client by protocol — multiple Claude Code windows, Claude Desktop + IDE, etc. each spawn their own knowledge-rag process. Since v3.8.0 idle processes are cheap (no embedding model loaded until first query). If you've measured and want a hard cap of one server per data directory, opt in:
export KNOWLEDGE_RAG_SINGLE_INSTANCE=1A second instance exits immediately with code 75. Default is OFF (multi-client friendly). Full guide: docs/single-instance.md. Sample MCP config: examples/mcp-config-single-instance.json.
# Check if port 8179 is already in use
# Windows:
netstat -aon | findstr :8179
# Linux/macOS:
lsof -i :8179If uvicorn is not found, install the server extras: pip install knowledge-rag[server]
Verify the server is running and the URL is correct:
curl http://127.0.0.1:8179/sseCommon issues:
- Wrong URL: must end with
/sse(not just the port) - Firewall blocking the port
- Server started with a different host/port than configured in the MCP client