
Velocirag
io.github.HaseebKhalid1507由 GitHub 帳號 HaseebKhalid1507 發布v0.7.4更新於 Oct 24, 2026
Lightning-fast RAG for AI agents. 4-layer fusion, ONNX Runtime, sub-200ms search.
概覽
VelociRAG 讓助理在本機對自有文件建立檢索增強索引,並提供四層融合搜尋與索引工具。
- 可以做什麼
- VelociRAG 在本機執行 RAG 引擎,並透過 MCP 提供五個工具:search、index、add_document、health 與 list_sources。搜尋以倒數排名融合(RRF)合併向量相似度(FAISS)、BM25 關鍵字比對(SQLite FTS5)、知識圖譜走訪與中繼資料篩選,再以交叉編碼器重新排序。索引採增量方式,只重新處理變更的檔案,刪除的檔案會在各儲存層串聯清除。全部在本機 ONNX Runtime 上執行,不需要 GPU 或 API 金鑰。
- 適用情境
- 適合讓助理根據你電腦上的私有文件集回答問題,尤其是希望一次查詢同時取得精確關鍵字比對、概念比對與中繼資料篩選的情況。也適合本機、離線、僅用 CPU 的環境,不希望把文件送到外部的嵌入或搜尋服務。
- 執行需求
- 需要本機 Python 環境:安裝 velocirag 這個 PyPI 套件,MCP 伺服器還需安裝 mcp 附加元件。文件必須先建立索引(例如使用 velocirag index 指令)。資料庫目錄由 VELOCIRAG_DB 環境變數或 --db 參數指定。模型在首次使用時下載,因此初次執行需要網路連線。僅支援桌面端;未宣告驗證機制。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Velocirag,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
🦖 VelociRAG
Lightning-fast RAG for AI agents.
Four-layer retrieval fusion powered by ONNX Runtime. No PyTorch. Sub-200ms warm search. Incremental graph updates. MCP-ready.
Most RAG solutions either drag in 2GB+ of PyTorch or limit you to single-layer vector search. VelociRAG gives you four retrieval methods — vector similarity, BM25 keyword matching, knowledge graph traversal, and metadata filtering — fused through reciprocal rank fusion with cross-encoder reranking. All running on ONNX Runtime, no GPU, no API keys. Comes with an MCP server for agent integration, a Unix socket daemon for warm queries, and a CLI that just works.
🚀 Quick Start
MCP Server (Claude, Cursor, Windsurf)
Claude Code — add to .mcp.json in your project root:
Then open /mcp in Claude Code and enable the velocirag server. If using a virtualenv, use the full path to the binary (e.g. .venv/bin/velocirag).
Claude Desktop — add to claude_desktop_config.json:
Cursor — add to .cursor/mcp.json:
Python API
CLI
Search Daemon (warm engine for CLI users)
The daemon keeps the ONNX model + FAISS index warm over a Unix socket. First query loads the engine (~1s), subsequent queries return in ~180ms with full 4-layer fusion.
🎯 Why VelociRAG?
- 4-layer search — vector + BM25 keyword + knowledge graph + metadata, fused with RRF
- No LLM needed — search runs entirely on local models (MiniLM + TinyBERT, ~80MB total)
- No GPU needed — pure ONNX inference, runs on any machine
- ~3ms warm search — daemon keeps models + indices warm over Unix socket
- Incremental indexing — add files without rebuilding the whole index
- MCP server — plug into Claude, Cursor, Windsurf, any MCP client
Related Projects
- Memkoshi — Agent memory system. Uses VelociRAG as its search engine.
- Stelline — Session intelligence. Crafts memories from conversation logs.
- Glyph — MCP security scanner and runtime protection.
🏗️ How It Works
The 4-layer pipeline:
What each layer catches:
✨ Features
- ONNX Runtime — 184ms cold start, 3ms cached. No PyTorch, no GPU
- Four-layer fusion — FAISS vector similarity + SQLite FTS5 (BM25) + knowledge graph + metadata filtering, merged via reciprocal rank fusion
- Cross-encoder reranking — TinyBERT reranker via ONNX Runtime — included in base install, no PyTorch needed. Downloads ~17MB model on first use
- Incremental graph updates — file-centric provenance tracking detects what changed and only rebuilds affected nodes/edges. Cascading deletes maintain consistency across all stores (vector, graph, metadata). Multi-source support with isolated provenance per source
- MCP server — Five tools (search, index, add_document, health, list_sources) for Claude, Cursor, Windsurf
- Search daemon — Unix socket server keeps ONNX model + FAISS index warm between queries
- Knowledge graph — Analyzers build entity, temporal, topic, and explicit-link edges from markdown. Optional GLiNER NER. 418 files in 2.1s
- Smart chunking — Header-aware splitting preserves document structure and parent context
- Query expansion — Acronym registry, casing/spacing variants, underscore-aware tokenization
- Runs anywhere — CPU-only, 8GB RAM, no API keys, no external services
🤖 MCP Server
VelociRAG exposes a Model Context Protocol server for seamless agent integration:
Available tools:
search— 4-layer fusion search with rerankingindex— Add documents to the knowledge baseadd_document— Insert single documenthealth— System diagnosticslist_sources— Show indexed document sources
The MCP server process stays alive between queries, so models load once and every subsequent search is warm. Works with any MCP-compatible client.
🐍 Python API
Full 4-layer unified search:
Quick semantic search:
Incremental graph updates:
💻 CLI Reference
Options:
--no-graph— Skip knowledge graph build--no-metadata— Skip metadata extraction--full-graph— Build graph WITH semantic similarity edges (~2GB extra RAM)--source NAME— Label for multi-source provenance isolation--force— Clear and rebuild from scratch--gliner— Use GLiNER for entity extraction (requirespip install "velocirag[ner]")
📊 Performance
Real benchmarks on ByteByteGo/system-design-101 (418 files, 1,001 chunks):
Production deployment (6,300+ chunks, 3 sources, 950 files):
⚙️ Configuration
Dependencies (all included in base install):
onnxruntime— ONNX inference (embedder + reranker)tokenizers+huggingface-hub— model loadingfaiss-cpu— vector similarity searchnetworkx+scikit-learn— knowledge graph + topic clusteringnumpy,click,pyyaml,python-frontmatter
Optional extras:
pip install "velocirag[mcp]"— MCP server (addsfastmcp)pip install "velocirag[ner]"— GLiNER entity extraction (addsgliner, requires PyTorch)
📚 References
VelociRAG builds on these foundational works:
Core Fusion & Retrieval
Reciprocal Rank Fusion — Cormack, G. V., Clarke, C. L. A., & Büttcher, S. (2009). "Reciprocal Rank Fusion outperforms Condorcet and individual Rank Learning Methods." SIGIR '09.
Core fusion algorithm for merging results across retrieval layers.
BM25 — Robertson, S. E., Walker, S., Jones, S., Hancock-Beaulieu, M., & Gatford, M. (1994). "Okapi at TREC-3." TREC-3.
Keyword search foundation via SQLite FTS5.
Embeddings & Neural IR
Sentence-BERT — Reimers, N., & Gurevych, I. (2019). "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks." EMNLP 2019. paper
Dense embedding architecture usingall-MiniLM-L6-v2.
MiniLM — Wang, W., Wei, F., Dong, L., Bao, H., Yang, N., & Zhou, M. (2020). "MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformers." NeurIPS 2020. paper
Efficient transformer distillation for production embedding models.
Reranking & Neural Models
Cross-Encoder Reranking — Nogueira, R., & Cho, K. (2019). "Passage Re-ranking with BERT." arXiv:1901.04085. paper
Cross-attention reranking with TinyBERT on MS MARCO.
TinyBERT — Jiao, X., et al. (2020). "TinyBERT: Distilling BERT for Natural Language Understanding." Findings of EMNLP 2020. paper
Compressed BERT for fast reranking inference.
Vector Search & Systems
FAISS — Johnson, J., Douze, M., & Jégou, H. (2019). "Billion-scale similarity search with GPUs." IEEE Transactions on Big Data. paper
High-performance vector similarity search engine.
GLiNER — Zaratiana, U., Nzeyimana, A., & Holat, P. (2023). "GLiNER: Generalist Model for Named Entity Recognition using Bidirectional Transformer." arXiv:2311.08526. paper
Generalist NER for knowledge graph entity extraction (optional dependency).
📄 License
MIT — Use it anywhere, build anything.
Need agent integration help? Check AGENTS.md for machine-readable project context.
Built for agents who think fast and remember faster.
來源:README.md,提交 261084a
工具
0版本歷史
1- v0.7.4最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分