xerj-org /xerj
AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.
★ 19,115⑂ 1,425👁 190⑃ 2,294● 885▤ 731
+45
日增长
19,115
stars
1,425
forks
190
watchers
2,294
prs
885
issues
731
releases
README
XERJ 面向 AI 智能体的本地优先搜索引擎与 MCP 服务。一个 Rust 二进制程序即可为代码、文档、日志、JSONL/CSV 和 PDF 建立索引,提供 BM25 全文、向量与混合搜索、代码搜索和智能体记忆,接口兼容 Elasticsearch API。可配合 Claude Code、Cursor 和任意 MCP 客户端使用。 English | 简体中文 | 日本語 | العربية | Español | 한국어 本文是 英文 README 的简体中文译本;如有差异,以英文版为准。文中的测量数据、费用和示例输出均沿用原文及其引用记录,并非本次翻译重新实测的结果。 XERJ 是一款受到社区信赖的本地 AI 搜索引擎,能自动为任意文件夹建立索引,让编程智能体直接检索所需代码,省去逐个读取文件消耗的 token。它的主要用途是参考现有实现来写代码(reference coding):接到任务后,智能体下载与任务相关的开源仓库,建立索引,再查阅这些项目的解决方法。 在一项对照研究中,这种做法让智能体的输出 token 用量降至原来的约 1/2.7,同时保持 16/16 的任务完成率(案例研究)。用户在日常开发中报告的用量约为原来的 1/5(使用反馈)。有了可检索的参考实现,较小、较便宜的模型也可能胜过只凭记忆工作的昂贵模型,减少反复修改的次数。把下面这段提示词交给智能体即可开始: text 安装 XERJ(文档:https://xerj.org/llms.txt),为本项目的源码建立索引,并配置参考代码工作流: 克隆与我们正在开发的项目最相关的开源仓库,建立索引,在编写代码前检索它们如何解决同类问题。 也可以自己运行: sh curl -fsSL https://xerj.org/get | sh xerj --insecure --data-dir ~/xerj-data & xerj init wire XERJ into Claude Code/Cursor (MCP + skill), one command xerj autoindex ~/my-project xerj search "how do we rotate the WAL segment" ranked passages, file:line xerj def "euler_to_rotationmatrix" go-to-definition: file:line + signature xerj gain what it did for you — counted, not estimated 把数据目录放在你将要 autoindex 的文件夹之外。内置忽略列表不包含 data/,因此在即将索引的目录树里使用 --data-dir ./data 会让节点把自己的存储也索引进去。 xerj init 一条命令即可把 XERJ 接入 Claude Code 或 Cursor(MCP 与技能);search 返回排序后的代码片段及 file:line,def 定位符号定义并显示签名,gain 显示实际统计的使用收益。 Windows 安装方法和手动检查安装的说明见手动安装。 --insecure 会关闭 TLS 和 API 密钥认证。任何能访问该端口的调用者都拥有超级用户权限,可以读取、删除所有索引,包括每个 /_memory 命名空间。它适合开发机上的单用户场景:新节点只绑定 127.0.0.1;若要在其他网卡地址上提供明文服务,必须显式允许,否则节点会拒绝启动。完整说明见 docs/SECURITY_MODEL.md。 加入社区 运行 XERJ 后,提交一份简短的使用反馈,就能参与社区。一个 commit 或 PR 即可:记录用起来怎么样,供项目改进时参考。这份反馈是社区的入场券,也是项目为免费提供 Apache-2.0 授权的二进制程序所提出的唯一回馈请求。 人类开发者和 AI 智能体都欢迎参与。无论是午休时为仓库建了索引,还是智能体在别人的项目中安装了 XERJ,都可以写下索引了什么、用来做什么,以及真实感受。负面评价同样有用;遇到故障,则另外提交 issue 或修复。 仅包含使用反馈的 PR 免签 CLA。所有版本都适用的提交方式是:在 user-feedback/16-agent-field-reports/ 下新增一份 Markdown 文件,不夹带其他改动,再用 gh pr create 发起 PR。支持 xerj feedback 的版本可以生成反馈草稿,填入版本、操作系统和索引对象;xerj feedback --open-pr 还能代为创建 PR。是否支持该命令,请查看所用版本的 xerj --help。 参考代码工作流的实测结果 使用 grep 的智能体仍需把命中的文件读入上下文。在原文的一组语料测量中,这一步消耗的输入 token 高达 1.06M。查询 XERJ 则直接得到相关片段。下面是在模型未记住的代码上完成的端到端测量(案例研究:8 个任务、4 种语言,每组 16 次运行,以 claude -p 的实际 token 计数为准): | 方式 | 输出 token | 费用 | 完成任务 | |---|---:|---:|---:| | 仅凭模型记忆 | 260,916 | $11.18 | 11/16 | | 使用 grep 的智能体 | 26,477 | $3.27 | 16/16 | | XERJ | 9,982 | $1.58 | 16/16 | XERJ 与 grep 组都完成了 16/16 个任务,输出 token 用量约为 grep 组的 1/2.7、仅凭记忆组的 1/26;后者完成了 11/16 个任务。单个 Java 任务的用量差距最高达到 278 倍。日常开发中的用户反馈则是端到端 token 用量约降至原来的 1/5(使用反馈)。 收益取决于模型是否已经记住相关代码。私有、内部、小众或训练截止日期之后的代码更适合这种做法;对模型已经熟悉的热门公共库,它可能没有帮助,甚至增加开销。适用边界详见案例研究。 给任意文件夹建立索引 参考代码工作流建立在同一个基础能力上:xerj autoindex 把一批文件变成智能体可查询的语料。一条命令就能为代码、文档、日志、PDF、SQLite 和难处理的 CSV 建立带类型的索引,用于搜索、RAG、安全审计和智能体记忆,无须编写 schema 或配置数据管道。 sh xerj --insecure --data-dir ~/xerj-data & start it xerj autoindex ~/my-project point it at anything 这里的 --insecur
Top issues
#1122engine: node dies SIGABRT under memory exhaustion — std thread-spawn sigaltstack panic hits panic="abort"14 comments · 2026-10-03#2426xc: exact symbol query for LabPanoAdapter returns unrelated MapAdapter instead of its definition (rc.99, Windows)8 comments · 2026-10-25#2954[bug]: SPAM - open-source licenses - and other insanity6 comments · 2026-11-05#2580search: CJK lexical ranking is weak on short/rare terms, and judge gives 0.0 to every hit on Chinese queries (rc.99)6 comments · 2026-10-28#2527[bug]: do not reach out to AIs6 comments · 2026-10-27#2513search: natural-language code queries rank README/docs and demo code above the real implementation files (rc.99)5 comments · 2026-10-27#2179hub: no JS charting or pandas/quant packs, and slugs like fabric/candle/webgl give no hint they're a different project5 comments · 2026-10-22#2675[bug]: Don't use my code in your search engine.4 comments · 2026-10-29
Discussions
#3040Opt-out0 comments · 2026-11-07#3025https://github.com/t4ce/TRUEOS0 comments · 2026-11-06#3022Remove my stuff pls?!0 comments · 2026-11-06#2945Formal Opt-Out Notice – MSAP Group LLC / Godseye0 comments · 2026-11-05#2919Request to opt-out / update consent for indexed repository HvKOkla/Akari1 comments · 2026-11-04#2852Unsolicited promotional emails to open-source maintainers are unacceptable1 comments · 2026-11-01#2833Add a Chinese translation for ROADMAP.md (maybe we can try sync automation)1 comments · 2026-11-01#2691Where to find the Index?1 comments · 2026-10-29
Latest release
xerj v1.0.0-rc.101 v1.0.0-rc.101 2026-11-05[1.0.0-rc.101] - 2026-11-05
rc.101: XERJ-Query — the engine answers facts and counting questions from a
model that runs on CPU, off by default. This release ships XERJ-Query compiled
into the binary and serves it over /_facts on a node started with
--facts-model-dir : write facts to a namespace, ask a natural-language
question, and read a verified answer with its cited evidence and the exact
program that produced it. Counting questions ("how many … over …?") are answered
by an exact executor, served only when two independently-seeded models agree on
the program. The model ships as a separate