saar
Enables AI agents to retrieve relevant sections from indexed files (documents, code, etc.) via hybrid semantic/BM25 search, with citations, through the Model Context Protocol.
README
Saar
Connect every agent to the knowledge already in your files.
Saar (सार, “essence”) is a retrieval-augmentation layer for AI agents. It indexes selected folders containing transcripts, discussions, documents, configuration, and code, then returns only the sections relevant to the agent's current task. Those sections enter the agent's context through the open Model Context Protocol, with citations back to the source files. Together with the connected agent, this creates a retrieval-augmented generation (RAG) workflow.
The retrieval pipeline combines semantic embeddings, which find related meaning, with BM25, which protects exact names, identifiers, and phrases. Weighted reciprocal rank fusion merges both result sets, and an optional reranker can refine their final order. This hybrid approach follows the same dense-plus-sparse retrieval pattern documented by Qdrant. The result is a small, relevant evidence set instead of an entire archive competing for the agent's context window.
We built Saar after our own transcripts and project discussions had grown across too many files to connect reliably by hand. Loading everything into an agent was wasteful, while choosing files manually was slow and easy to get wrong. Saar turns that accumulated work into reusable infrastructure: keep the source folders current, index them once, and any configured MCP-compatible agent can retrieve the evidence it needs through the same interface.
Your files remain the source of truth. Saar does not replace an agent's reasoning; it gives that reasoning a better starting point.
What we verified
On August 12, 2026, we tested one agent model on 10 fixed questions under three retrieval conditions. Eight questions were answerable from the indexed sources and two were deliberately unanswerable controls.
| Result | Without indexed retrieval | Initial retrieval | Current retrieval |
|---|---|---|---|
| Overall benchmark score | 20.0% | 76.22% | 94.75% |
| Fact recall | 0% | 71.50% | 94.51% |
| Supported answers, out of 8 | 0 | 7 | 8 |
| Incorrect assertions | — | 4 | 0 |
| Median end-to-end time | 5.36 s | 35.38 s | 24.37 s |
The current pipeline won 5 questions and tied 5 against the initial retrieval version, with no losses. It reduced median end-to-end time by 31.1% compared with that first version. The run without retrieval was faster, but it recovered none of the 41 expected facts in the answerable questions; its 20% overall score came from correctly refusing the two unanswerable controls.
The overall score is the mean of the 10 case scores. Fact recall is the share of the 41 rubric-defined facts recovered across the eight answerable questions. The source CSV, adjudication, summary, and their saved SHA-256 hashes were checked again before publication; the figures above reproduced exactly.
This was an internal benchmark, not a universal guarantee. Each question was run once, scoring was manual and not blind, and the no-retrieval condition had no other access to the indexed sources. The test also cannot separate the individual contribution of index cleanup, BM25, fusion, reranking, version filtering, and the improved search-tool contract. The public aggregate record is in benchmarks/agent-model-2026-08-12.json.
Install
Python 3.11 or newer is required.
Keep the material agents should use in one folder, such as resources/. Any useful subfolder structure is fine.
cd /absolute/path/to/saar
python3 -m venv .venv
.venv/bin/python -m pip install .
.venv/bin/saar init --source /absolute/path/to/resources --scope resources
.venv/bin/saar doctor
.venv/bin/saar index
Run saar index after changes, or keep saar watch running for automatic incremental updates.
Add Saar to an MCP-compatible agent using absolute paths:
{
"mcpServers": {
"saar": {
"command": "/absolute/path/to/saar/.venv/bin/saar",
"args": [
"--config",
"/absolute/path/to/saar/saar.yaml",
"serve"
]
}
}
}
Then give the agent this rule:
When a task may depend on indexed files, call search_context first.
Cite the returned sources. If evidence is incomplete or conflicting, say so.
MCP makes the tool available; the rule makes its use consistent. Each agent or client must be configured separately.
Included
- Hybrid semantic and BM25 retrieval with weighted rank fusion
- Structured chunking for documents, configuration, and source code
- Citations, source scopes, content/document-type/date/person filters, and stale-content exclusion
- Incremental indexing and a folder watcher
- Embedded or server-hosted Qdrant
- Retrieval evaluation and guarded, human-verified feedback
- Stdio and loopback HTTP MCP transports
The default setup is free and local: FastEmbed, BM25, and embedded Qdrant. You can instead use Qwen3 through Ollama, Voyage, an OpenAI-compatible endpoint, or a custom Python provider. Remote providers receive the text they process, so review data requirements before enabling one.
Useful commands
saar doctor # check the setup
saar index # index new and changed files
saar watch # keep the index current
saar search "question" # inspect retrieval directly
saar search "decision" --document-type transcript-evidence --date 2026-08-12 --person "Alex Example"
saar evaluate eval.yaml # measure retrieval quality
saar serve # run the MCP server
See client setup, provider choices, evaluation, and security for details.
Apache-2.0 licensed.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。