
Rag Vault
io.github.RobThePCGuy由 GitHub 帳號 RobThePCGuy 發布v1.5.3更新於 Oct 24, 2026
Local RAG MCP server with hybrid search, PDF/DOCX support, and zero-config setup
概覽
本機 RAG 伺服器,讓 AI 助理匯入自己的 PDF、DOCX、Markdown 與文字檔,並以語意加關鍵字的混合檢索查找內容。
- 可以做什麼
- 將檔案或原始資料匯入本機向量資料庫,支援 PDF、DOCX、Markdown、TXT、JSON、JSONL 與 HTML 內容,並可列出或刪除已索引檔案。以向量加 BM25 的混合檢索搜尋文件,可選用交叉編碼器重排與查詢擴展。查看伺服器狀態,並透過釘選或忽略結果記錄回饋及回饋統計。可選用網頁介面與 REST API,用於上傳、搜尋、預覽與管理文件,以及在多個知識庫之間切換。
- 適用情境
- 適合讓助理根據私有文件、API 規格、研究論文或內部筆記回答問題,而不將內容送到雲端服務。對程式碼較多或技術性強的資料特別有用,因為精確詞彙與語意同樣重要。
- 執行需求
- 透過 npx 以 stdio 本機程序執行,需要 Node.js 20 或更新版本。需將 BASE_DIR 設為助理可讀取的文件目錄;DB_PATH 與 CACHE_DIR 決定儲存與模型快取位置。嵌入模型(約 90MB)首次執行時從 HuggingFace 下載,之後可離線使用。選用設定包括 MODEL_NAME、RAG_GROUPING 與 RAG_HYBRID_WEIGHT。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Rag Vault,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
RAG Vault
[License: MIT] [TypeScript] [MCP Registry]
Your documents. Your machine. Your control.
RAG Vault lets your AI coding assistant search your private documents, things like API specs, research papers, and internal docs. Everything runs locally and your data stays on your machine unless you choose to pull in content from a remote URL.
One command to run, minimal setup, privacy by default.
Why RAG Vault?
Security
RAG Vault comes with security built in:
- API Authentication: Optional API key via
RAG_API_KEY - Rate Limiting: You can throttle requests
- CORS Control: Restrict allowed origins
- Security Headers: Helmet.js protection
See SECURITY.md for complete documentation.
First-Time Setup Checklist
Before adding MCP config:
- Install Node.js 20 or newer.
- Pick a documents directory and set
BASE_DIRto that path. - Make sure your AI tool process can read
BASE_DIR. - Restart your AI tool after editing config.
Get Started Quickly
For Cursor
Add to ~/.cursor/mcp.json:
Replace /path/to/your/documents with your real absolute path.
For Claude Code
Add to .mcp.json in your project directory:
Or add inline via CLI:
For Codex
Add to ~/.codex/config.toml:
Install Skills (Optional)
If you want your AI to write better queries and make more sense of results, install the RAG Vault skills:
Skills teach Claude best practices for:
- Query formulation and expansion strategies
- Score interpretation. In boost mode, under 0.3 is a good match and over 0.5 is worth skipping. RRF mode scores by rank instead.
- When to use
ingest_filevsingest_data - HTML ingestion and URL handling
Restart your AI tool, and start talking:
That's it. No Docker. No Python. No server infrastructure to manage.
Web Interface
RAG Vault has a web UI so you can manage your documents without touching the command line.
Launch the Web UI
Open http://localhost:3000 in your browser.
By default the web server binds to
127.0.0.1(loopback), so it is reachable only from this machine. To use it from another device on your network, setRAG_BIND_HOST=0.0.0.0— and setRAG_API_KEYas well, since the API is otherwise unauthenticated.
What You Can Do
- Upload documents: Drag and drop PDF, DOCX, Markdown, TXT, JSON, JSONL, and NDJSON files
- Search instantly: Type queries and see results with relevance scores
- Preview content: Click any result to see the full chunk in context
- Manage files: View all indexed documents and delete what you don't need
- Switch databases: Create and switch between multiple knowledge bases
- Monitor status: See document counts, memory usage, and search mode
- Export/Import settings: Back up and restore your vault configuration
- Theme preferences: Switch between light, dark, or system theme
- Folder browser: Navigate directories to select documents
REST API
The web server has a REST API you can hit directly. Set RAG_API_KEY to require authentication:
Reader API Endpoints
These endpoints let you read documents and find connections across them:
Remote Mode
RAG Vault can also run as an HTTP server so remote MCP clients like Claude.ai, Claude Desktop, or anything that supports Streamable HTTP or SSE can connect to it.
Stdio mode is unchanged. Just leave off --remote and everything works as before with Cursor, Claude Code, and Codex.
Connecting from Claude Desktop
Add to your Claude Desktop config:
Or via Claude Code CLI:
Connecting from Claude.ai
For Claude.ai (Pro/Max/Team/Enterprise), add as a custom connector with URL https://your-host:3001/mcp. For local development, expose your server with a tunnel:
The remote server also binds to 127.0.0.1 (loopback) by default. To accept connections from other machines directly, set RAG_BIND_HOST=0.0.0.0. Set RAG_API_KEY for authentication whenever you expose the server beyond loopback (including via a tunnel). The server supports both Streamable HTTP (/mcp) and legacy SSE (/sse) transports, plus a health check at /health.
Real-World Examples
Search Your Codebase Documentation
Index Web Documentation
Build a Personal Knowledge Base
Search Exact Technical Terms
RAG Vault's hybrid search catches both meaning and exact matches:
Pure semantic search would miss this. RAG Vault finds it.
How It Works
Smart chunking: Splits by meaning, not character count. Keeps code blocks intact.
Hybrid search: Two fusion modes that combine vector similarity with BM25 keyword matching:
- Boost mode (default): BM25 boosts vector search distances multiplicatively. Simple and predictable.
- RRF mode (opt-in via
RAG_SEARCH_MODE=rrf): Reciprocal Rank Fusion treats vector and BM25 as independent voters. This can surface documents that vector search alone would miss.
Cross-encoder reranking (opt-in): After the first pass, a cross-encoder model (Xenova/ms-marco-MiniLM-L-6-v2, ~23MB) scores each (query, passage) pair together for tighter relevance ranking. Turn it on with RAG_RERANKER_ENABLED=true.
Query expansion (opt-in): Generates reformulated queries to improve recall when searches are paraphrased or conceptual. Two backends: local template-based expansion (default, fully offline) or LLM-based HyDE through an external API. Turn it on with RAG_HYDE_ENABLED=true.
Quality filtering: Groups results by relevance gaps instead of arbitrary top-K cutoffs.
Local by default: Embeddings via Transformers.js. Storage via LanceDB. Network is only needed for initial model download or if you explicitly ingest remote URLs.
MCP tools included: query_documents, ingest_file, ingest_data, delete_file, list_files, status, feedback_pin, feedback_dismiss, and feedback_stats.
Supported Formats
Configuration
Environment Variables
Windows users:
RAG_EMBEDDING_DEVICE=autotries GPU providers (DirectML), which can fail if ONNX Runtime GPU binaries aren't available. If you see embedding initialization errors, setRAG_EMBEDDING_DEVICE=cpuin your MCP config for reliable operation. See the GPU acceleration FAQ for details.
One-command override (no .env edit):
Search Tuning
Cross-Encoder Reranking (opt-in)
Query Expansion / HyDE (opt-in)
Privacy note: The
apibackend sends query text to an external LLM endpoint, which breaks the "zero cloud" guarantee. The defaultrule-basedbackend is fully local.
Security (optional)
Advanced
Copy
.env.examplefor a complete configuration template.
For code-heavy content, try:
Frequently Asked Questions
Is my data really private?
For local files, yes. Indexing and search run on your machine after the embedding model downloads (~90MB). RAG Vault only hits the network if you choose remote URL ingestion or need to download a model.
Does it work offline?
Yes, after the first run. The model caches locally.
What about GPU acceleration?
RAG Vault picks a device automatically by default (RAG_EMBEDDING_DEVICE=auto). When GPU providers are set up correctly, this can speed up embedding generation.
Important: On Windows, auto tries DirectML (dml), which requires ONNX Runtime GPU binaries. If those binaries aren't installed or your GPU setup is incomplete, the server won't start at all. It doesn't fall back to CPU gracefully. The same goes for Linux without CUDA binaries.
Recommendation: If you hit embedding initialization errors, set RAG_EMBEDDING_DEVICE=cpu in your MCP config. CPU mode is reliable on all platforms and fast enough for most workloads (the default model is only ~90MB).
Supported device values: auto, cpu, cuda, dml, gpu, wasm, webgpu, webnn, webnn-npu, webnn-gpu, webnn-cpu. The alias directml is also accepted and maps to dml.
Can I change the embedding model?
Yes. Set MODEL_NAME to any compatible HuggingFace model. You'll need to delete DB_PATH and re-ingest because different models produce incompatible vectors.
Recommended upgrade: For better quality and multilingual support, use EmbeddingGemma:
It's a solid pick if you need multilingual support or higher-quality retrieval.
Other specialized models:
- Scientific:
sentence-transformers/allenai-specter - Code:
jinaai/jina-embeddings-v2-base-code
How do I back up my data?
Copy the DB_PATH directory (default: ./lancedb/).
Troubleshooting
Development
Test Tiers
pnpm test:unit: deterministic tests for local/CI quality checks. Doesn't include model-download integration paths.pnpm test:integration: full integration and E2E workflows, including embedding model initialization.
Use RUN_EMBEDDING_INTEGRATION=1 to explicitly opt into network/model-dependent suites.
Release Strategy
- Releases are local and scripted via
scripts/release-npm.sh. - Supported bumps:
patch,minor,major. - The script runs dependency installs,
pnpm check:all, andpnpm ui:buildbefore touching version files. package.jsonandserver.jsonversions only get updated after checks pass, and they're auto-restored if any later step fails.pnpm release:dryruns the full gate plus npm dry-run publish and always restores version files.
Project Structure
Documentation
- SECURITY.md: Security configuration and best practices
- .env.example: Complete environment variable template
License
MIT: free for personal and commercial use.
Acknowledgments
Built with Model Context Protocol, LanceDB, and Transformers.js.
Started as a fork of mcp-local-rag by Shinsuke Kagawa. Now it's its own thing. Huge credit to upstream contributors for the foundation, I've been iterating hard from there. Local-first dev tools, all the way.
來源:README.md,提交 c3de705
工具
0版本歷史
1- v1.5.3最新Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。
