# velocirag [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/HaseebKhalid1507/VelociRAG  
**GitHub Stars:** 12  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/velocirag

## Description
Lightning-fast RAG for AI agents. 4-layer fusion, ONNX Runtime, sub-200ms search.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "velocirag": {
    "command": "uvx",
    "args": ["velocirag"],
    "env": {
      "VELOCIRAG_DB": ""
    }
  }
}
```

**Requires environment variables:** `VELOCIRAG_DB` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What velocirag does

The velocirag MCP server gives an MCP-compatible agent access to a local document knowledge base. Its main search tool accepts a query and returns results from multiple retrieval layers rather than relying only on embeddings. The available layers are FAISS cosine similarity for conceptual matches, SQLite FTS5 with BM25 for exact terms, knowledge-graph traversal for related entities and concepts, and structured metadata filtering for fields such as tags, status, and project.

Five MCP tools are exposed:

- `search` runs the combined retrieval pipeline and reranks the results.
- `index` adds documents from a path to the knowledge base.
- `add_document` inserts one document.
- `health` returns system diagnostics.
- `list_sources` shows indexed document sources.

The package also provides a CLI and Python API, so the MCP interface can be used alongside direct indexing and search workflows.

## How it works

A query can be expanded with acronym, casing, spacing, and underscore-aware variants before retrieval. Results from the vector, keyword, graph, and metadata layers are merged with reciprocal rank fusion. A TinyBERT cross-encoder then reranks the combined results. Embeddings and reranking run through ONNX Runtime, using local models rather than an external model API. The README identifies MiniLM-L6-v2 for 384-dimensional embeddings and TinyBERT for reranking.

Documents can be split with header-aware chunking that preserves document structure and parent context. Graph processing can create entity, temporal, topic, and explicit-link edges from Markdown. File provenance supports incremental updates: later indexing runs can process changed files, remove deleted-file data across the vector, FTS5, graph, and metadata stores, and keep multiple sources isolated by source name.

The velocirag MCP server stays alive between requests. Its long-running process can keep the ONNX model and FAISS index loaded, avoiding repeated initialization for successive searches. A separate Unix-socket daemon provides a similar warm-query path for CLI users.

## Setup and configuration

Install the MCP extra and create an index before starting the server:

```bash
pip install "velocirag[mcp]"
velocirag index ./my-docs
velocirag mcp
```

The database can be supplied with `--db PATH`, or through the `VELOCIRAG_DB` environment variable in configurations such as Claude Code. The server supports `--transport stdio|sse`. Claude Desktop and Cursor configurations start the `velocirag mcp` command and pass the database path as an argument. Claude Code uses a project-level `.mcp.json` file.

Indexing supports options to skip graph or metadata construction, force a rebuild, assign a source name, or enable GLiNER entity recognition. GLiNER requires the optional `velocirag[ner]` installation.

## Tools and capabilities

Use `search` for semantic, exact-term, connected-concept, or filtered retrieval. Use `index` for directory-level ingestion and `add_document` when an agent needs to insert one item. `health` helps inspect system status, while `list_sources` identifies the document collections currently indexed.

The underlying CLI also supports JSON or text search output, result limits, thresholds, metadata queries, daemon status checks, and daemon control. The Python API exposes lower-level stores and unified search configuration, including graph enrichment and metadata filters.

## Limitations and notes

The implementation is designed for CPU use and does not require a GPU, API key, PyTorch, or an external service. The optional full graph mode adds approximately 2 GB of RAM usage, and the cross-encoder downloads a roughly 17 MB model on first use. The first request can be slower while models load; a warm daemon or persistent MCP process is intended to reduce that initialization cost. GLiNER entity extraction is optional rather than part of the base installation.

_Full upstream README: https://allmcps.com/mcp/velocirag/readme_

