Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

A local-first document retrieval engine that mounts as an MCP tool for agents to index files, search for relevant passages, and let the agent's own LLM answer.

README.md

rag-retriever

A lightweight, local-first document retrieval engine that mounts to an agent as an MCP tool. Drop files in; the agent searches them and answers with its own LLM. There is no LLM in here — this is only the "front half" of RAG (extract → chunk → embed → store + similarity search).

your agent (owns the LLM)
   │  calls MCP tool: search("question")
   ▼
rag-retriever ──► extract ─► chunk ─► embed ─► LanceDB
   ▲                                              │
   └────────── returns relevant passages ◄────────┘
   │
   agent reads passages → answers with its own LLM

Built from the same proven pieces as Open Notebook (file extraction + bge-m3 embeddings + vector search), minus the heavyweight backend, UI, and answer/podcast generation you don't need.

Why this shape

  • One LLM, not two. The retriever never answers; your agent does. You keep

full control of reasoning, prompts, and cost.

  • Local-first. Default backend (fastembed) runs entirely offline, no server.
  • Pluggable embeddings. Switch between fully local and a China-friendly cloud

API (SiliconFlow) with one env var — no code change.

Install

cd rag-retriever
uv sync
cp .env.example .env   # then pick your embedding backend

Configure the embedding backend (.env)

| RAG_EMBED_BACKEND | What it uses | Notes | |---|---|---| | local (default) | fastembed (ONNX, in-process) | 100% offline, no server, heavier first install | | ollama | local Ollama daemon | ollama serve + ollama pull bge-m3 | | openai | OpenAI-compatible API (e.g. SiliconFlow) | needs RAG_OPENAI_API_KEY; text leaves the machine |

⚠️ Index-time and query-time must use the same backend + model. Changing the model means re-indexing everything.

Use (CLI, for testing)

uv run rag-retriever index "C:\path\to\docs"     # a file or a whole folder
uv run rag-retriever search "什么是表见代理" -k 5
uv run rag-retriever list
uv run rag-retriever stats

Mount as an MCP server (the real entry point)

Run uv run rag-retriever-mcp (stdio). Register it with your MCP client. For Claude Code, add to your MCP config:

{
  "mcpServers": {
    "rag-retriever": {
      "command": "uv",
      "args": ["run", "--directory", "D:\\Vibe Coding Items\\rag-retriever", "rag-retriever-mcp"]
    }
  }
}

Tools exposed: index_path, search, list_sources, stats.

Supported files

pdf, docx, pptx, xlsx, html, md, txt, csv, json, epub (via markitdown). Scanned / image-only PDFs need an OCR engine (tesseract) installed separately; without it they extract empty and are reported as skipped.

Layout

rag_retriever/
  config.py     # env-driven config; picks the embedding backend
  extract.py    # file -> text (markitdown)
  chunk.py      # token-based chunking with overlap
  embed.py      # local | ollama | openai-compatible backends
  store.py      # LanceDB vector store (embedded, no server)
  pipeline.py   # ingest + search orchestration (no LLM)
  server.py     # MCP server (agent-facing)
  cli.py        # manual CLI

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Vector & Memory servers.