Repository avatar
AI Tools
v1.16.1
active

synrag

io.github.Synlabs-ai/synrag

Search your documents with cited context: hybrid BM25 + embeddings on a plain CPU, no GPU or API.

Documentation

synrag

CPU-native search and context for AI agents.
Hybrid retrieval · multilingual embeddings · document parsing · compact, cited LLM context — in one 3 MB binary. No GPU.

Website Release Install test Platform GPU PyPI MCP Registry Telemetry

Website · Docs · Benchmarks · Pricing · Download


curl -fsSL https://ai.synlabs.pro/install.sh | sh
$ synrag index ./company-docs -o kb.syn --student ~/.synrag/models/synapse.synm
$ synrag serve kb.syn --student ~/.synrag/models/synapse.synm &
$ curl -s 'localhost:7878/context?q=what+is+our+refund+window&budget=300'
{
  "context": "Customers can return any item within 30 days for a full refund [1]. ...",
  "sources": [{"cite": 1, "source": "policies/refunds.pdf", "title": "Refund policy", "page": 2, ...}],
  "tokens": 61
}

Most RAG stacks glue together a parser, an embedding API or GPU, a vector database, a keyword index and a prompt packer. synrag is all of that in one process you run next to your app — with its own embedding model (Synapse, 21M parameters) that runs on a plain CPU.

Why synrag

⚡ Seconds, not minutes57.6K documents searchable in 1.6 s on a 6-core CPU. Embedding models need 60–282 s on a GPU or 16 min–1.7 h on the same CPU.
🧠 Own embedding model on CPUSynapse embeds 51,600 documents/s on 6 cores — no GPU, no embedding API, nothing leaves your machine.
🔎 Hybrid retrievalBM25 with an analyzer for any language + Synapse vectors + an optional contextual reranker, fused per query.
📄 Reads your real filesPDF, DOCX, XLSX, PPTX, ODF, HTML, Markdown, CSV, JSON, ZIP — built-in parsers; OCR via any external command.
✂️ Compact, cited contextPicks the sentences that answer the question under a token budget: 43% fewer prompt tokens at the same answer quality, with [n] citations (source, section, page).
🔁 Live updates, crash-safeAdd or replace a document in 0.2 ms while searches continue; every change is journaled and fsynced.
🤖 Agents firstMCP server for Claude, Cursor and any MCP client; REST API; dependency-free Python SDK; OpenAI-style tool definitions.
🏢 Ready for the security reviewSSO (OIDC), per-document ACLs inside retrieval, hash-chained audit log, encryption at rest, sharded cluster, Helm.

Benchmarks, including where we lose

nDCG@10 on public test sets, one machine for every system (AMD Ryzen 5 7500F, 6 cores, 31 GB RAM; models on an RTX 5060 Ti). synrag settings were chosen on train/dev only. Full tables, methods and scripts: BENCHMARKS.md.

SystemHardwareEnglish (BEIR, 3 sets)5 languages (MLQA)14 languages (Belebele)Index 57.6K docsRAM
synrag + rerankerCPU0.4550.6640.8741.6–4.8 s443–475 MB
EmbeddingGemmaGPU0.5030.6580.852282 s2.8 GB + 5.6 GB VRAM
bge-small-en-v1.5GPU0.4780.224—107 s2.1 GB + 0.8 GB VRAM
multilingual-e5-smallGPU0.4300.6240.83074 s2.5 GB + 1.1 GB VRAM
Elasticsearch + embedding modelGPU0.455–0.4740.641–0.6570.843–0.853ES + model4.9 GB + model
Elasticsearch BM25CPU0.4240.5850.79112.7 s4.9 GB
Tantivy + Model2Vec (Rust)CPU0.4300.6440.8152.8 s1.85 GB
  • Where synrag loses: best English quality still comes from transformer models on a GPU (bge-small +0.023, EmbeddingGemma +0.048); on large languages (Hindi, Persian, Russian, Arabic, Turkish, German) EmbeddingGemma is better; cross-lingual search is weak.
  • Where it leads: cost and speed on a CPU, and low-resource languages — Kazakh, Uzbek, Kyrgyz, Tajik: +0.10…+0.24 over EmbeddingGemma.
  • Over HTTP (FiQA, keep-alive): p50 0.76 ms, 6,325 q/s from 12 clients, 315 MB — Elasticsearch 8.15: 1.96 ms, 3,197 q/s, 4.7 GB.
  • Scale: 8.8M MS MARCO passages on one server — BM25 ready in 22 s, with Synapse in 2.4 min, 7–10 ms per query.

Install

One linecurl -fsSL https://ai.synlabs.pro/install.sh | sh — the 3 MB binary to ~/.local/bin, the models (~86 MB: Synapse; reranker 0.3 MB) to ~/.synrag/models, SHA-256 verified (script); SYNRAG_NO_MODELS=1 for the binary only (BM25)
ManualReleases: synrag-1.16.0-linux-x86_64, synapse-v2.synm, rerank-v1.synr, Python wheel, SHA256SUMS
Dockerdocker compose up with docker-compose.yml — image built from the release binary (Dockerfile)
Pythonpip install synrag (PyPI)
MCP serveruvx synrag-mcp (PyPI, MCP Registry: io.github.Synlabs-ai/synrag)

Linux x86-64 with glibc 2.30+ (Ubuntu 20.04+, Debian 11+, RHEL 9). Windows: WSL2. macOS / ARM builds are coming.

Quickstart

M=~/.synrag/models
synrag index ./docs -o docs.syn --student $M/synapse.synm             # parse + index a folder
synrag search docs.syn "how do refunds work" -k 5 --student $M/synapse.synm
synrag context docs.syn "how do refunds work" --budget 600 --student $M/synapse.synm
synrag serve docs.syn --student $M/synapse.synm --rerank $M/rerank.synr --port 7878
HTTP
GET /search?q=…&k=10hybrid search: one hit per document with source, title, heading, page, text, score
GET /context?q=…&budget=1500the sentences that answer the query, with [n] citations and sources
POST /add {"docs":[{"source","title","text"}]}add or replace documents, searchable immediately
POST /upload?source=report.pdfparse and index a file on the server
POST /delete {"sources":[…]}delete documents

Collections, API keys and roles: synrag serve --data ./data --api-keys keys.json — see the docs.

Use it from an agent

MCP (Claude Desktop, Cursor, Windsurf, Claude Code…) — examples/mcp:

{
  "mcpServers": {
    "synrag": {
      "command": "uvx",
      "args": ["synrag-mcp", "--index", "/home/me/notes.syn", "--build-from", "/home/me/notes"]
    }
  }
}

Tools: search_documents, get_context, list_collections; with --allow-writes also add_document, add_file, delete_documents. Claude Code: claude mcp add synrag -- uvx synrag-mcp --index ~/notes.syn --build-from ~/notes. The server finds the installed engine and the Synapse model by itself.

Python — pip install synrag · python/:

import os
from synrag import Server

with Server("docs.syn", build_from=["./docs"], student=os.path.expanduser("~/.synrag/models/synapse.synm")) as rag:
    ctx = rag.context("how do refunds work?", budget=800)
    print(ctx.text)       # sentences with [n] citations
    print(ctx.sources)    # source, title, page per [n]
    rag.add([{"source": "faq.md", "title": "FAQ", "text": "..."}])   # live update

A complete tool-calling agent with any OpenAI-compatible LLM (Ollama, vLLM, OpenAI): python/examples/agent_demo.py. Connectors with incremental sync: S3, Confluence, SharePoint / OneDrive, Google Drive, SQL, folders — synrag.connectors.

Editions

CommunityProductionEnterpriseOEM
Pricefreesee pricingsee pricingon request
Chunks1M per organization50M per installationunlimitedby agreement
Coversyour organizationone installation per subscription unityour organizationyour distributed product
Search, Synapse, reranker, parsers, MCP, SDK, API keys✓✓✓✓
SSO, document ACLs, audit, encryption at rest, cluster✓✓
Redistribution in software you ship✓

Commercial use and SaaS backends are allowed in the free Community edition. Licenses are signed files verified offline — no activation server, no telemetry. After a paid term ends: 30 days fully working, then 90 days read-only, then serving stops until renewal; synrag export gets every document out at any time. Who may do what: LICENSE.md. Plans and a free 14-day Enterprise trial: ai.synlabs.pro/pricing.

Documentation

  • Docs — install, CLI, HTTP API, Python, MCP, collections, licenses
  • Production guide — Docker, Kubernetes, SSO, ACLs, audit, encryption, backups, cluster
  • Security review — method, findings and fixes, residual risks
  • Benchmarks — every table and how to reproduce it
  • Full technical report (Russian, PDF): ai.synlabs.pro/report

What is in this repository

The engine ships as a binary in Releases; its source is not published. This repository holds everything around it, under Apache 2.0: the Python SDK, connectors and MCP server, examples, the Dockerfile, the installer and benchmark scripts; plus the documentation. Issues and feature requests are welcome here.

License

  • Engine binary and models: synrag Community License — free, including commercial use, up to 1M chunks per organization; paid editions per pricing and Terms. Not open source.
  • Code in this repository (Python SDK, connectors, MCP server, examples, scripts, Docker files): Apache 2.0.

© 2026 SYNLABS MCHJ (SYNLABS LLC) · info@synlabs.pro

PYPI
synrag-mcp
Install Command
pip install synrag-mcp
Runtime: uvx