xerj-org/xerjPublic

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.

AI summary: Local AI search tool that automatically indexes folders to provide coding agents with exact code references.

Stars
22.5K
+1.2K today
Forks
1.4K
Watchers
206
Open issues
68
Open PRs
40
Contributors
~274
Commits
4.8K
Branches
1.6K
Views (30d)
2

RustApache-2.0Created Jun 30, 2026Last push 3d agoLatest release v1.0.0-rc.105+3.5K stars this week+5.7K this month

Quick answers

What is xerj?
Local AI search tool that automatically indexes folders to provide coding agents with exact code references.
What does xerj do?
XERJ is a community-trusted local AI search tool that automatically indexes any designated folder. It prevents coding agents from wasting tokens by reading files individually, instead pulling the exact code needed for a task. The primary focus is reference coding, allowing an agent to download and index open-source repositories to understand prior solutions before generating its own code. This approach significantly reduces token consumption while maintaining high problem-solving rates. It empowers smaller, cost-effective models to outperform more expensive ones relying solely on memory.
Who is xerj for?
Software engineers and AI practitioners building or utilizing autonomous coding agents. Users should be comfortable working with command-line tools and integrating AI models.
How do I get started with xerj?
curl -fsSL https://xerj.org/get | sh
How popular is xerj on GitHub?
xerj-org/xerj has 22,545 stars and 1,374 forks on GitHub, and gained 3,464 stars in the last 7 days.
What license does xerj use?
xerj-org/xerj is released under the Apache-2.0 license.

Star history

since Oct 16, 2026
010K20KOct 2026Oct 2026Nov 2026Nov 2026
22.5K stars as of Nov 28, 2026. Measured daily since Oct 16, 2026; GitHub no longer exposes earlier star timestamps.

Update history

6 recorded
  • Nov 28, 2026New release v1.0.0-rc.105 (previously v1.0.0-rc.101).
  • Nov 6, 2026New release v1.0.0-rc.101 (previously v1.0.0-rc.99).
  • Oct 30, 2026Description changed from "Local-first search engine and MCP server for AI agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for" to "AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM".
  • Oct 26, 2026New release v1.0.0-rc.99 (previously v1.0.0-rc.95).
  • Oct 21, 2026Description changed from "XERJ is the new way for AI to search data. Its autoindex capability activates agents to know your data without the token" to "Local-first search engine and MCP server for AI agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for".
  • Oct 18, 2026Description changed from "XERJ is the new way for AI to search data. Its autoindex capability activates agents to know your data without the token" to "XERJ is the new way for AI to search data. Its autoindex capability activates agents to know your data without the token".

Contribution activity

commits per day, last 52 weeks
NovDecJanFebMarAprMayJunJulAugSepOctNovMonWedFri2025-11-30: 0 commits2025-12-01: 0 commits2025-12-02: 0 commits2025-12-03: 0 commits2025-12-04: 0 commits2025-12-05: 0 commits2025-12-06: 0 commits2025-12-07: 0 commits2025-12-08: 0 commits2025-12-09: 0 commits2025-12-10: 0 commits2025-12-11: 0 commits2025-12-12: 0 commits2025-12-13: 0 commits2025-12-14: 0 commits2025-12-15: 0 commits2025-12-16: 0 commits2025-12-17: 0 commits2025-12-18: 0 commits2025-12-19: 0 commits2025-12-20: 0 commits2025-12-21: 0 commits2025-12-22: 0 commits2025-12-23: 0 commits2025-12-24: 0 commits2025-12-25: 0 commits2025-12-26: 0 commits2025-12-27: 0 commits2025-12-28: 0 commits2025-12-29: 0 commits2025-12-30: 0 commits2025-12-31: 0 commits2026-01-01: 0 commits2026-01-02: 0 commits2026-01-03: 0 commits2026-01-04: 0 commits2026-01-05: 0 commits2026-01-06: 0 commits2026-01-07: 0 commits2026-01-08: 0 commits2026-01-09: 0 commits2026-01-10: 0 commits2026-01-11: 0 commits2026-01-12: 0 commits2026-01-13: 0 commits2026-01-14: 0 commits2026-01-15: 0 commits2026-01-16: 0 commits2026-01-17: 0 commits2026-01-18: 0 commits2026-01-19: 0 commits2026-01-20: 0 commits2026-01-21: 0 commits2026-01-22: 0 commits2026-01-23: 0 commits2026-01-24: 0 commits2026-01-25: 0 commits2026-01-26: 0 commits2026-01-27: 0 commits2026-01-28: 0 commits2026-01-29: 0 commits2026-01-30: 0 commits2026-01-31: 0 commits2026-02-01: 0 commits2026-02-02: 0 commits2026-02-03: 0 commits2026-02-04: 0 commits2026-02-05: 0 commits2026-02-06: 0 commits2026-02-07: 0 commits2026-02-08: 0 commits2026-02-09: 0 commits2026-02-10: 0 commits2026-02-11: 0 commits2026-02-12: 0 commits2026-02-13: 0 commits2026-02-14: 0 commits2026-02-15: 0 commits2026-02-16: 0 commits2026-02-17: 0 commits2026-02-18: 0 commits2026-02-19: 0 commits2026-02-20: 0 commits2026-02-21: 0 commits2026-02-22: 0 commits2026-02-23: 0 commits2026-02-24: 0 commits2026-02-25: 0 commits2026-02-26: 0 commits2026-02-27: 0 commits2026-02-28: 0 commits2026-03-01: 0 commits2026-03-02: 0 commits2026-03-03: 0 commits2026-03-04: 0 commits2026-03-05: 0 commits2026-03-06: 0 commits2026-03-07: 0 commits2026-03-08: 0 commits2026-03-09: 0 commits2026-03-10: 0 commits2026-03-11: 0 commits2026-03-12: 0 commits2026-03-13: 0 commits2026-03-14: 0 commits2026-03-15: 0 commits2026-03-16: 0 commits2026-03-17: 0 commits2026-03-18: 0 commits2026-03-19: 0 commits2026-03-20: 0 commits2026-03-21: 0 commits2026-03-22: 0 commits2026-03-23: 0 commits2026-03-24: 0 commits2026-03-25: 0 commits2026-03-26: 0 commits2026-03-27: 0 commits2026-03-28: 0 commits2026-03-29: 0 commits2026-03-30: 0 commits2026-03-31: 0 commits2026-04-01: 0 commits2026-04-02: 0 commits2026-04-03: 0 commits2026-04-04: 0 commits2026-04-05: 0 commits2026-04-06: 0 commits2026-04-07: 0 commits2026-04-08: 0 commits2026-04-09: 0 commits2026-04-10: 0 commits2026-04-11: 0 commits2026-04-12: 0 commits2026-04-13: 0 commits2026-04-14: 0 commits2026-04-15: 0 commits2026-04-16: 0 commits2026-04-17: 0 commits2026-04-18: 0 commits2026-04-19: 0 commits2026-04-20: 0 commits2026-04-21: 0 commits2026-04-22: 0 commits2026-04-23: 0 commits2026-04-24: 0 commits2026-04-25: 0 commits2026-04-26: 0 commits2026-04-27: 0 commits2026-04-28: 0 commits2026-04-29: 0 commits2026-04-30: 0 commits2026-05-01: 0 commits2026-05-02: 0 commits2026-05-03: 0 commits2026-05-04: 0 commits2026-05-05: 0 commits2026-05-06: 0 commits2026-05-07: 0 commits2026-05-08: 0 commits2026-05-09: 0 commits2026-05-10: 0 commits2026-05-11: 0 commits2026-05-12: 0 commits2026-05-13: 0 commits2026-05-14: 0 commits2026-05-15: 0 commits2026-05-16: 0 commits2026-05-17: 0 commits2026-05-18: 0 commits2026-05-19: 0 commits2026-05-20: 0 commits2026-05-21: 0 commits2026-05-22: 0 commits2026-05-23: 0 commits2026-05-24: 0 commits2026-05-25: 0 commits2026-05-26: 0 commits2026-05-27: 0 commits2026-05-28: 0 commits2026-05-29: 0 commits2026-05-30: 0 commits2026-05-31: 0 commits2026-06-01: 0 commits2026-06-02: 0 commits2026-06-03: 0 commits2026-06-04: 0 commits2026-06-05: 0 commits2026-06-06: 0 commits2026-06-07: 0 commits2026-06-08: 0 commits2026-06-09: 0 commits2026-06-10: 0 commits2026-06-11: 0 commits2026-06-12: 0 commits2026-06-13: 0 commits2026-06-14: 0 commits2026-06-15: 0 commits2026-06-16: 0 commits2026-06-17: 0 commits2026-06-18: 0 commits2026-06-19: 0 commits2026-06-20: 0 commits2026-06-21: 0 commits2026-06-22: 0 commits2026-06-23: 0 commits2026-06-24: 0 commits2026-06-25: 0 commits2026-06-26: 0 commits2026-06-27: 0 commits2026-06-28: 0 commits2026-06-29: 7 commits2026-06-30: 26 commits2026-07-01: 4 commits2026-07-02: 0 commits2026-07-03: 0 commits2026-07-04: 26 commits2026-07-05: 28 commits2026-07-06: 37 commits2026-07-07: 66 commits2026-07-08: 23 commits2026-07-09: 16 commits2026-07-10: 24 commits2026-07-11: 19 commits2026-07-12: 63 commits2026-07-13: 4 commits2026-07-14: 0 commits2026-07-15: 0 commits2026-07-16: 0 commits2026-07-17: 0 commits2026-07-18: 0 commits2026-07-19: 0 commits2026-07-20: 0 commits2026-07-21: 1 commit2026-07-22: 10 commits2026-07-23: 8 commits2026-07-24: 31 commits2026-07-25: 36 commits2026-07-26: 16 commits2026-07-27: 43 commits2026-07-28: 15 commits2026-07-29: 22 commits2026-07-30: 10 commits2026-07-31: 29 commits2026-08-01: 25 commits2026-08-02: 13 commits2026-08-03: 14 commits2026-08-04: 20 commits2026-08-05: 2 commits2026-08-06: 4 commits2026-08-07: 25 commits2026-08-08: 29 commits2026-08-09: 38 commits2026-08-10: 71 commits2026-08-11: 45 commits2026-08-12: 33 commits2026-08-13: 19 commits2026-08-14: 23 commits2026-08-15: 29 commits2026-08-16: 34 commits2026-08-17: 43 commits2026-08-18: 29 commits2026-08-19: 29 commits2026-08-20: 17 commits2026-08-21: 41 commits2026-08-22: 52 commits2026-08-23: 69 commits2026-08-24: 40 commits2026-08-25: 33 commits2026-08-26: 21 commits2026-08-27: 11 commits2026-08-28: 1 commit2026-08-29: 21 commits2026-08-30: 16 commits2026-08-31: 21 commits2026-09-01: 2 commits2026-09-02: 1 commit2026-09-03: 1 commit2026-09-04: 1 commit2026-09-05: 1 commit2026-09-06: 2 commits2026-09-07: 1 commit2026-09-08: 5 commits2026-09-09: 2 commits2026-09-10: 2 commits2026-09-11: 3 commits2026-09-12: 2 commits2026-09-13: 5 commits2026-09-14: 1 commit2026-09-15: 1 commit2026-09-16: 2 commits2026-09-17: 1 commit2026-09-18: 2 commits2026-09-19: 14 commits2026-09-20: 46 commits2026-09-21: 33 commits2026-09-22: 16 commits2026-09-23: 2 commits2026-09-24: 1 commit2026-09-25: 1 commit2026-09-26: 18 commits2026-09-27: 18 commits2026-09-28: 2 commits2026-09-29: 18 commits2026-09-30: 51 commits2026-10-01: 21 commits2026-10-02: 2 commits2026-10-03: 14 commits2026-10-04: 17 commits2026-10-05: 18 commits2026-10-06: 31 commits2026-10-07: 45 commits2026-10-08: 39 commits2026-10-09: 11 commits2026-10-10: 8 commits2026-10-11: 41 commits2026-10-12: 15 commits2026-10-13: 35 commits2026-10-14: 23 commits2026-10-15: 75 commits2026-10-16: 38 commits2026-10-17: 122 commits2026-10-18: 75 commits2026-10-19: 17 commits2026-10-20: 81 commits2026-10-21: 44 commits2026-10-22: 41 commits2026-10-23: 57 commits2026-10-24: 41 commits2026-10-25: 29 commits2026-10-26: 42 commits2026-10-27: 18 commits2026-10-28: 48 commits2026-10-29: 36 commits2026-10-30: 33 commits2026-10-31: 39 commits2026-11-01: 6 commits2026-11-02: 28 commits2026-11-03: 12 commits2026-11-04: 17 commits2026-11-05: 93 commits2026-11-06: 48 commits2026-11-07: 8 commits2026-11-08: 7 commits2026-11-09: 14 commits2026-11-10: 2 commits2026-11-11: 6 commits2026-11-12: 5 commits2026-11-13: 8 commits2026-11-14: 2 commits2026-11-15: 3 commits2026-11-16: 1 commit2026-11-17: 5 commits2026-11-18: 21 commits2026-11-19: 6 commits2026-11-20: 19 commits2026-11-21: 16 commits2026-11-22: 59 commits2026-11-23: 23 commits2026-11-24: 0 commits2026-11-25: 11 commits2026-11-26: 124 commits2026-11-27: 0 commits2026-11-28: 8 commits
3,395 commits in the last yearLessMore

Signals and awards

derived from tracked data
  • Widely adopted

    22,545 stars

  • Rising fast

    +3,464 stars this week

  • Very active

    3,395 commits in 52 weeks

  • Community-driven

    ~274 contributors

  • Well documented

    High community health score

  • Permissive license

    Apache-2.0

  • Repeat trending

    4 trending appearances

What xerj does

XERJ is a community-trusted local AI search tool that automatically indexes any designated folder. It prevents coding agents from wasting tokens by reading files individually, instead pulling the exact code needed for a task. The primary focus is reference coding, allowing an agent to download and index open-source repositories to understand prior solutions before generating its own code. This approach significantly reduces token consumption while maintaining high problem-solving rates. It empowers smaller, cost-effective models to outperform more expensive ones relying solely on memory.

Software engineers and AI practitioners building or utilizing autonomous coding agents. Users should be comfortable working with command-line tools and integrating AI models.

  • Automatic indexing: Indexes folders automatically to provide immediate context for coding agents.
  • Token reduction: Minimizes token burn by supplying specific, relevant code snippets rather than full file reads.
  • Reference coding: Clones and indexes open-source repositories to guide agents with proven solutions.
  • Model efficiency: Enables smaller models to achieve results comparable to larger models by supplying targeted context.
  • Seamless integration: Wires directly into tools like Claude Code or Cursor via MCP and skills with a single command.

Where teams use it

Optimize agent coding

Provide coding agents with targeted code references to reduce token usage and improve output quality.

Learn from repositories

Download and index relevant open-source projects to understand how similar problems were previously solved.

Improve model performance

Enhance the capabilities of smaller, cheaper language models by grounding them in specific local contexts.

Search local codebases

Query specific functions or concepts across large local codebases using natural language or semantic search.

Getting started: curl -fsSL https://xerj.org/get | sh

README

main branch

XERJ

An AI-native search engine in one Rust binary.

XERJ Query-1, AI model and AI search. Answers over facts you wrote, and shows the facts it used. Runs offline, no embeddings, no GPU. Wrong answers on 160 questions: 1, versus 9 to 15 for RAG with Opus 5.5. 220 ms p50 on CPU. $42 of CPU per million questions. AI search: BM25, vector and hybrid in one query, one binary. Link: xerj.org/xerj-query-1 Why XERJ, built for agents: search, memory and a familiar API in one Rust binary. Reference coding: 2.7 times fewer output tokens than a grep-driven agent, same 16 of 16 solved. Agent memory and MCP: /_memory, works with Claude Code, Cursor and any MCP client. Elasticsearch replacement: 0 failed on ES-YAML conformance (1448 of 1458), same API, no JVM. Link: the engine underneath

The search engine for AI, now with XERJ Query-1: a model that turns your question into a small program over facts you have written.

XERJ Query-1 · Blog post · Release rc.101 · llms.txt · Docs · Donate

XERJ Query-1, new in rc.101

Most AI search finds text in milliseconds and then asks a language model to write the answer. The model is what makes a RAG answer good, and it is also where the seconds and the per-question cost come from.

XERJ Query-1 works the other way. It reads your question and writes a short program (look this up, compare these, count those), and the engine runs that program over facts you stored. Lookup and comparison steps point at a stored fact and its quoted span; counts return a program hash, not the records. If the data cannot support an answer you get UNKNOWN; if two facts disagree you get CONFLICT. It runs on four CPU cores, offline, with no embeddings to build and no GPU.

XERJ Query-1 the usual way measured on
Question to answer 220 ms (p50) 1.5 to 2.3 s for Opus 5.5 to write a RAG answer (API time per call, our command-line client's start-up not counted), after a search of 0.8 to 106 ms same 160 questions, rc.101 release, 4 model threads, laptop CPU
Wrong answers 1 of 160 (124 right, 35 declined) 9 to 15 (RAG with Opus 5.5), 6 (Opus 5.5 reading the whole store), 5 (Opus 5.5 given each question's records) our 160-question test, drawn from the model's development set; XERJ Query-1 was given each question's records
Cost per million questions $42 of CPU $13,400 (RAG) to $694,000 (Opus re-reading the whole store per question, uncached) same test, Opus 5.5 list prices; CPU at AWS c7g list price, 4.1 CPU-s per question on a shared ARM server (0.9 on a laptop)
Build a search index of 10 GB of text 17 min (BM25, measured) an estimated 62 to 97 hours to embed it with bge-small on CPU English Wikipedia (wikimedia/wikipedia 20231101.en, first 22 of 41 files, 3,299,578 articles); XERJ Query-1 does not use this index
Correct a fact 2.3 ms (one write; the next answer uses it) re-embed the changed chunk (about 30 ms with bge-small), and the whole store (19.6 s for our 5,000-record test store) when the embedding model changes rc.101 release, laptop

Retrieval quality (R@k, nDCG@k) on BEIR, on SearchTome and on our 160-question test, the latency split and every data set: benchmarks/query-1-2026-11.

Release binaries only, not in the public build. XERJ Query-1, /_facts, --facts-model-dir and the xerj_facts_ask MCP tool are in the published release binaries (rc.101 and later), which are built from a private tree that adds the proprietary model crates. This repository's source does not contain them: a node built from main has no /_facts route, no --facts-model-dir flag and no xerj_facts_ask tool.

The model is off by default; without the flag there is no /_facts route and the MCP tool list is unchanged. rc.101 upgrades the data directory to format 4 on first write, and rc.100 cannot open it again. What it does not do yet, measured: sums and totals (a sum question can come back as a member count), and large fact sets (on a 95,000-fact namespace asks took 0.82 s at the median and all 20 test questions were declined). It declines more often than an LLM would guess. The numbers and their caveats: blog post, capabilities.

Try it with the model

curl -fsSL https://xerj.org/get | sh -s -- --with-model

Verify: the installer ends by printing the start line with the model directory it unpacked.

xerj --facts-model-dir ~/.local/share/xerj/model --insecure --data-dir ~/xerj-data &
curl -s localhost:9200/_facts | grep -o '"state":"loaded"'

Verify: prints "state":"loaded". In the first few seconds after start it prints nothing, because the model is still loading ("not_loaded"); run it again.

Write a fact and ask about it: docs/MODEL_QUICKSTART.md. From an agent with no shell, the same calls work over HTTP and the MCP tool xerj_facts_ask; see llms.txt.

XERJ is research in the open. The model was trained on donated GPU time; if it is useful to you, xerj.org/donate funds the next models. The engine is open source; the model ships as a binary bundle, and its training and evaluation data are not public yet.


The engine underneath

Local-first search engine and MCP server for AI agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search and agent memory, behind an Elasticsearch-compatible API. Works with Claude Code, Cursor and any MCP client.

XERJ is a local AI search engine that indexes any folder automatically, so your coding agent stops burning tokens reading files one by one and pulls the exact code it needs instead. Reference coding is its main use case and the clearest win: point an agent at a task and it downloads the open-source repos closest to it, indexes them, and reuses how they solved the problem before writing its own code. In a controlled study that cut a coding agent's output tokens by 2.7x at the same 16/16 solve rate (case study), and people report roughly 5x in everyday work (field reports). It is enough for a smaller, cheaper model to out-code a pricier one working from memory, while you spend less time in fix loops. Try it now with a one-prompt install:

Install XERJ (docs: https://xerj.org/llms.txt), index this project's sources, and set up
reference coding: clone and index the open-source repos closest to what we're building,
and search how they solved a problem before writing code.

Or run it yourself:

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

For several IDs or questions at once, use xerj batch-search --input queries.json or MCP xerj_batch_search: ordered results, citations and per-item errors.

Keep that data directory outside any folder you will autoindex. data/ is not in the built-in ignore list, so --data-dir ./data inside a tree you then index makes the node index its own storage.

At startup, Data dir shows the resolved absolute path, Data source identifies the flag, selected config file or default, and Data status says whether this launch created the directory. A new directory can make an older node's indices or owner account appear missing: restart with the previous --data-dir or --config. XERJ does not discover or migrate other data directories automatically.

Windows and a hand-verified install are under Install by hand.

That --insecure flag is a trust boundary, not a formality. It turns off TLS and API-key auth, so every caller that can reach the port is a superuser who can read and delete every index, including every /_memory namespace. It is meant for one user on a dev machine: a fresh node binds 127.0.0.1 only, and a cleartext bind on any other interface refuses to start unless you explicitly allow it. The full model is in docs/SECURITY_MODEL.md.

Join the community

You join XERJ by running it and sending back one short field report on what it was like: a single commit or PR. That report is the membership card, and it is the only thing the project asks in return for a free binary (the engine source is Apache-2.0; the XERJ Query-1 crates in release binaries since rc.101 are proprietary). It is what keeps the engine improving for whoever runs it next.

Humans and AI agents are both welcome; this is deliberately not an agents-only project. Whether you indexed a repo over lunch or an agent installed XERJ mid-session in someone else's codebase, the ask is the same: one short report saying what you pointed it at, what you used it for, and your honest verdict. A negative verdict is a good report. If something broke, that is a separate issue or fix on top.

Field-report PRs are CLA-exempt, so they merge without a signature. The path that works on any build is a plain gh pr create adding exactly one markdown file under user-feedback/16-agent-field-reports/, with nothing else in the diff. On a build that has it, xerj feedback drafts the report and fills in version, OS and what was indexed, and xerj feedback --open-pr opens the PR for you. Check xerj --help for whether your binary has the command.

The measured reason: reference coding

An agent that greps pulls whole files into its context, up to 1.06M input tokens on one corpus in our measurements, and still has to read them. An agent that queries XERJ gets the passage. Measured end to end on code the model had not memorised (case study: 8 tasks, 4 languages, 16 runs per arm, real claude -p token counts):

output tokens cost solved
from memory only 260,916 $11.18 11/16
grep-driven agent 26,477 $3.27 16/16
XERJ 9,982 $1.58 16/16

That is 2.7x fewer output tokens than grep and 26x fewer than memory alone at the same solve rate, and up to 278x fewer on a single Java task. In real development, users report roughly 5x fewer tokens end to end (field reports). The value is gated by memorisation: it wins on private, internal, niche or post-cutoff code, and is neutral to harmful on popular public libraries the model already knows. The honest limits are in the case study.

Feed it any folder

Reference coding is one use of the same primitive: xerj autoindex <folder> makes an agent know a corpus instead of grepping it. One command indexes code, docs, logs, PDFs, SQLite and awkward CSVs into typed, queryable indices for search, RAG, security audits and agent memory, with no schema to write and no pipeline to configure.

xerj --insecure --data-dir ~/xerj-data &      # start it
xerj autoindex ~/my-project              # point it at anything

--insecure again means no TLS and no auth — every caller a superuser — so this is the same one-user-on-a-dev-machine boundary as above (security model).

XERJ sniffs every file, works out what it is, and creates one index per dataset it finds. Code arrives with its symbols and line numbers through tree-sitter, not as flat text:

phase A: 593 datasets inferred, 1955 junk/skipped files
phase B: indexing 25329 files with 8 workers
done in 158.1s, 593 datasets, 83103 records live, 790 junk records

Share an offline data map with xerj autoindex map --prefix myproject --html xerj-map.html --redact-paths, or use --md xerj-map.md for Markdown. Reports include dataset counts, symbol names, graph hubs when available, skipped-file information and suggested searches. Review metadata names before sharing. Examples, privacy scope and reproduction.

What people point it at

  • Reference coding: index the OSS projects nearest your problem and retrieve how they solved it before writing code (the measured use case above).
  • Codebase Q&A and RAG: index a repo, ask for the mechanism, get the passage with file:line instead of a directory listing.
  • Security audits: index a target tree and query for sink patterns, secrets and dangerous calls across every file type at once.
  • Log and incident analysis: mixed formats become typed indices with the aggregations you would expect from Elasticsearch.
  • Agent long-term memory: /_memory/{namespace} stores what an agent learns and recalls it by meaning next session.

How the prompt works

llms.txt gives your agent the ordered steps: install, start the server, xerj autoindex ., query with any Elasticsearch client, and the reference-coding loop (clone similar OSS, index it, retrieve the mechanism before writing, cite what you use, respect licenses).

The reason it helps: an agent working from memory retry-loops on any API it has not memorised, and grep only tells it where to look; the recovery is still reading source into context, up to 1.06M input tokens on one corpus in our measurements. An agent that queries XERJ reads the exact passage instead. The 2.7x fewer output tokens and 2.1x cheaper than grep at the same 16/16 solve rate (26x fewer tokens than memory alone, which solved 11 of 16) is in The measured reason above, with a companion run scoring 9/9 with retrieval versus 0/9 from memory on a Rust library the model had never seen.

More prompts that work on a fresh install:

  • "Read https://xerj.org/llms.txt, set XERJ up as your search backend, index ./docs, and show me one example query per index it created."
  • "Run xerj autoindex map and tell me what is in this data (types, counts and the gotchas it recorded), then answer my questions with search instead of reading files."
  • "Use XERJ's /_memory/notes API as your long-term memory for this project: store what you learn as you work, and recall it by meaning next session."

Worked, validated examples for each capability: xerj.org/docs/recipes.

Boot, bulk ingest, search, vector kNN, live dashboards, no cuts. Watch it on xerj.org or try the live playground.

Install by hand

curl -fsSL https://xerj.org/get | sh

Windows PowerShell:

irm https://xerj.org/get.ps1 | iex

Nix (builds from source; nix develop opens a shell with the Rust toolchain):

nix run github:xerj-org/xerj -- --version

One static binary, no JVM, no dependencies. Prebuilt for Linux, macOS and Windows on x86-64 and arm64. The x86-64 builds target x86-64-v2 (SSE4.2: Intel Nehalem 2008 and later, AMD Bulldozer and later) and use AVX2 and FMA at runtime when the CPU has them, so a pre-Haswell machine runs the same binary. It speaks the Elasticsearch API, so existing clients, dashboards and tooling work against it unchanged.

First commands after install (the installer prints where xerj landed; add it to your PATH if needed): xerj --insecure --data-dir ~/xerj-data &, wait until http://localhost:9200 responds, then xerj autoindex ~/my-project. See Index a folder.

For a host with no runtime internet access, follow the air-gapped deployment recipe. The default lexical embedder is offline; neural mode needs the three model files staged locally before the first semantic operation.

Index a folder

Start the server, then point autoindex at anything:

xerj --insecure --data-dir ~/xerj-data &     # local dev: no TLS, no auth
xerj autoindex ~/my-project

That is the dev-machine trust boundary from the top of this README — no TLS, no auth, every caller a superuser. It is fine on a laptop because a fresh node binds 127.0.0.1 and nothing else; a shared host wants the auth-on start just below.

If your server has auth on, which is the default for every start without --insecure (including any start from a config file), hand autoindex the same key. It never picks the key up from xerj.toml; pass --api-key or set XERJ_API_KEY, or every request comes back 401 Unauthorized:

xerj --data-dir ~/xerj-data &                          # auth on: key minted on first boot
export XERJ_API_KEY="$(cat ~/xerj-data/admin.key)" # <data_dir>/admin.key
xerj autoindex ~/my-project

That is the whole setup. There is no schema to write and no pipeline to configure. XERJ sniffs each file, works out what it is, and creates one index per dataset it finds:

phase A: 593 datasets inferred, 1955 junk/skipped files
phase B: indexing 25329 files with 8 workers
done in 158.1s, 593 datasets, 83103 records live, 790 junk records

Source files go through tree-sitter, so code arrives with its symbols and line numbers instead of as flat text. CSV, JSON, JSONL, XML, YAML, SQLite, PDF, DOCX, PowerPoint (.pptx, one record per slide), Excel (.xlsx, one dataset per sheet), EPUB books (one record per chapter), Jupyter notebooks (one record per heading section, any kernel), man pages (roff, one record per section), HTML, mail (.eml and mbox mailboxes, including a Google Takeout export) and common log formats are all handled. Unity projects get first-class treatment: text-serialized scenes, prefabs and assets become one record per GameObject/Component, .meta files become a GUID-to-path table, and MonoBehaviour records carry script_class/script_path so "which scenes use this script?" is a single query (binary-serialized assets need Force Text to be readable; generated dirs like Library/ are auto-skipped and recorded).

Search it

This is the Elasticsearch API, so you already know this part:

# what did it find?
curl localhost:9200/_cat/indices

# full-text
curl "localhost:9200/ax-*/_search?q=checkout+error"

# structured
curl localhost:9200/ax-orders/_search -H 'content-type: application/json' -d '{
  "query": { "range": { "total": { "gte": 100 } } },
  "aggs":  { "by_status": { "terms": { "field": "status" } } }
}'

Vector and hybrid search use the same knn and semantic syntax you would send to Elasticsearch. Any Elasticsearch client library works if you point it at localhost:9200.

Score results with Jev

A search score tells you which result is above which, but not whether a result really answers your question. Jev, a service from TypeSafe AI, does that: give it a question and a document and it returns a number from 0 to 1, how well the document answers. XERJ works with it in two ways.

1. Reorder your results with Jev (optional). Add "rerank": {} to a _search and XERJ sends the top results to Jev, then sorts them by the numbers it gets back. On the public FiQA test, result quality goes from 0.24 to 0.36 (nDCG@10), for about $0.64 in total for 648 searches. Treat the numbers as a way to sort, not as exact percentages: they are not well calibrated. This sends the text of those results to TypeSafe's servers. It stays off until you set a key, and [rerank] enabled = false forbids it completely. Read docs/RERANK.md before turning it on.

2. Get the same kind of answer locally. POST /v1/systemone and POST /_decide accept the same questions in the same format, but XERJ answers them itself, by looking up the most similar documents you have already labelled (for example messages already marked spam or not spam). Nothing leaves your machine and no key is needed. It only works if you have labelled examples; on AG News (120k labelled examples) it picks the right label 92% of the time. The official jev-reranker Python client works against a XERJ node without changes (test). XERJ answers under its own name, xerj-history-vote-1; it is not Jev.

Measurements and how to reproduce them: benchmarks/beir-hybrid and benchmarks/decisions-as-retrieval.

Ask over your own facts

XERJ release binaries ship XERJ Query-1, a model that answers questions over facts you give it. It is not in the public build: a node built from this repository's source has no /_facts route (the model crates are proprietary and ship only in release binaries). It is off by default; start a node with --facts-model-dir <DIR> to turn it on. Write documents and facts to a namespace, then ask in plain language. The engine returns a checked answer: lookups carry the facts they used and the program that produced them; counts carry a program hash and a second-model agreement check, but not the counted records.

# write a fact
curl -s localhost:9200/_facts/demo/_bulk -H 'content-type: application/json' -d '{
  "documents":[{"doc_id":"d1","version":"v1","text":"Ana Bel is 170 cm tall."}],
  "facts":[{"fact_id":"f1","subject":"Ana Bel","subject_id":"emp:1","relation":"height","kind":"number",
            "value":"170","unit":"cm","doc_id":"d1","version":"v1","start":11,"end":14,"quote":"170"}]
}'

# ask
curl -s localhost:9200/_facts/demo/_ask -H 'content-type: application/json' \
  -d '{"question":"How tall is Ana Bel?"}' | jq '{final_status,final_answer}'
# {"final_status":"ANSWER","final_answer":"170 cm"}

Which to use: _search for keyword and text lookups over indexed documents; /_facts + _ask for a single-fact question over records you have written as subject / relation / value facts. The model answers only over the facts[] you wrote (kind is text, date, number or boolean; version is a string; quote must equal text[start:end]) — documents alone answer UNKNOWN. XERJ Query-1 runs on CPU with no GPU and nothing leaving the machine. Counting questions ("how many people have office Berlin?") are served from an exact executor, and only when every fact of the counted subjects carries a stable subject_id ("emp:1"); without it the count is INCOMPLETE and the answer is UNKNOWN. The executor is exact, but the model can pick the wrong set: in our review an "or" question and a "total devices" question were both served as verified counts of the wrong set. Set counts only on rc.101: numeric thresholds decline, and a sum question about something the store has no facts for can be served as a member count. It is a separate model from the search embedder. Get the bundle with curl -fsSL https://xerj.org/get | sh -s -- --with-model, then start a node with xerj --facts-model-dir <dir> --data-dir <dir> (XERJ_FACTS_MODEL_DIR=<dir> is the environment equivalent); the model is a swappable xerj-model-bundle-v1 directory. Verify: curl -s localhost:9200/_facts | jq .model.state prints "loaded" (the first seconds after start print "not_loaded" while the model preloads; poll). On XERJ Score v2, our private development evaluation (1,600 questions over MoMA, Tate, PyPI, OurAirports, USGS, NASA Exoplanet Archive and UCI Online Retail records plus invented ones, the distribution the model was trained for), the shipped model scores 90.29 where Opus 5.5 scores 100. It is not a test on unseen questions. See docs/XERJ_QUERY_1.md for the seven capabilities with a verified example each, docs/MODEL_QUICKSTART.md to get it running and docs/FACTS_API.md for the full contract. The model weights are a release asset, not part of this repository's source.

Connect an agent over MCP

Not every agent can run a shell command. Desktop assistants and function-calling hosts reach tools through the Model Context Protocol, and the binary you just installed is the MCP server. There is nothing else to download and nothing to compile:

xerj --insecure --data-dir ~/xerj-data &     # 1. the node the tools query
xerj mcp                                # 2. MCP stdio server (your client runs this)

xerj mcp speaks MCP over stdio and proxies to the node named by XERJ_URL (default http://localhost:9200). It does not start a node; step 1 is the prerequisite. The MCP server adds no trust of its own — it is the same binary talking stdio to your client and plain HTTP to the node, so the node's boundary is the one that counts, and step 1 above boots the same --insecure dev node. Drop this into your MCP client's config:

{
  "mcpServers": {
    "xerj": {
      "command": "/home/you/.local/bin/xerj",
      "args": ["mcp"],
      "env": { "XERJ_URL": "http://localhost:9200" }
    }
  }
}

Use an absolute path. The sh installer (Linux, macOS, and Windows Git Bash, MSYS and Cygwin) puts xerj in ~/.local/bin (xerj.exe on Windows; command -v xerj confirms) and does not edit PATH. The PowerShell installer (get.ps1) puts xerj.exe in %LOCALAPPDATA%\Programs\xerj and adds that directory to the user PATH ((Get-Command xerj).Source confirms; XERJ_NO_PATH=1 opts out). MCP hosts launched from a desktop icon do not inherit your shell's PATH. If the node is running with auth (anything but --insecure), add "XERJ_AUTH": "ApiKey <key>" alongside XERJ_URL; the key is in <data-dir>/admin.key.

Supported agents

Twenty-six clients can register xerj mcp as a local stdio server. The entry is always the same two fields - the absolute path to the binary, and mcp as its only argument - but where that entry lives and which key wraps it differ per client. tested means the server was registered in that client and xerj_search appeared in its tool list; untested means the path and shape are transcribed from the client's own documentation and nobody has run it yet. Six rows have been run. OpenCode v2.1.2 on Windows against xerj v1.0.0-rc.97 answered initialize and tools/list with its full tool list. Cline CLI 3.0.73 on Linux against xerj v1.0.0-rc.98 loaded this section's mcpServers block at ~/.cline/data/settings/cline_mcp_settings.json. xerj_search appeared in the tool list Cline handed the model (named xerj__xerj_search) among that binary's 20 tools, and Cline executed one xerj_search call. The model turn was a local OpenAI-compatible stub, because no provider key was available; the MCP server was the real xerj mcp process. The IDE's MCP Servers > Configure button was not part of that run. Kimi Code CLI 2.3.1 and the Kimi desktop app on Linux against xerj v1.0.0-rc.99 (built from source) loaded this section's mcpServers block at ~/.kimi-code/mcp.json: the client spawned xerj mcp as a child process with the env block intact (verified through /proc/<pid>/environ), and xerj_search appeared in the tool list. Claude Code 2.1.311 on Kali Linux against xerj v1.0.0-rc.100 registered xerj mcp with claude mcp add in the local, project and user scopes; xerj_search appeared in /mcp among that binary's 22 tools, and Claude Code executed one xerj_search and one xerj_def call against an autoindexed repository. DeepSeek Harness 44.7.0 on Windows against xerj v1.0.0-rc.99 loaded this row's - insert: block from a profile patch at $DSH_HOME/profiles/desktop/cordis.patch.yml: in the contributor's run, the harness spawned xerj mcp without an application restart, exposed mcp__xerj__xerj_search, and executed a search. The tested entry was the profile patch; the dsh/ bundle was not exercised. The run set XERJ_DISABLE_FEEDBACK=true and observed no automatic field report. Contributor's verification and limits. Antigravity on Windows 11 (x86_64-pc-windows-msvc) against xerj v1.0.0-rc.100 loaded this section's mcpServers block at ~/.gemini/config/mcp_config.json with XERJ_DISABLE_FEEDBACK=true: the client spawned xerj.exe mcp, received 22 tools in tools/list (including xerj_search and xerj_def), and executed one xerj_search and one xerj_def call against an autoindexed repository (iscvlab/mcp-bridges).

Correcting an untested row is a welcome first PR.

Client Config file Key Note Tested
OpenCode opencode.json in the project, or ~/.config/opencode/opencode.json mcp.servers one command array, environment not env, needs a project root tested
Claude Code .mcp.json (project scope) or ~/.claude.json (local scope, the default, or user scope); claude mcp add writes any of them mcpServers -- before the command is recommended; xerj mcp also registers without it tested
Cursor .cursor/mcp.json in the project, or ~/.cursor/mcp.json mcpServers no type for stdio untested
Codex ~/.codex/config.toml, or .codex/config.toml in trusted projects [mcp_servers.xerj] TOML, not JSON untested
Gemini CLI .gemini/settings.json or ~/.gemini/settings.json mcpServers gemini trust the folder or stdio shows Disconnected untested
GitHub Copilot in VS Code .vscode/mcp.json servers needs "type": "stdio"; the portable .mcp.json uses mcpServers untested
Windsurf %APPDATA%\devin\mcp_config.json, ~/.config/devin/mcp_config.json mcpServers the path is Devin's now, not ~/.codeium/windsurf untested
Claude Desktop %APPDATA%\Claude\claude_desktop_config.json, ~/Library/Application Support/Claude/claude_desktop_config.json, ~/.config/Claude/claude_desktop_config.json mcpServers quit the app fully, not just the window untested
Cline ~/.cline/data/settings/cline_mcp_settings.json (CLI); the IDE opens it from MCP Servers > Configure mcpServers disabled and autoApprove are Cline-specific; the CLI run did not need them tested
Roo Code .roo/mcp.json in the project, or <VS Code User>/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json mcpServers the project entry wins on name clashes untested
Kilo Code kilo.jsonc or .kilo/kilo.jsonc in the project, ~/.config/kilo/kilo.jsonc global mcp one command array, like OpenCode untested
Continue ~/.continue/config.yaml, or any file in .continue/mcpServers/ mcpServers a YAML list, not a map; Agent mode only untested
Zed ~/.config/zed/settings.json (on Windows, run zed: open settings file) context_servers the key is not mcpServers untested
JetBrains AI Assistant settings UI only: Settings > Tools > AI Assistant > Model Context Protocol mcpServers a separate store from Junie untested
Junie .junie/mcp/mcp.json in the project, ~/.junie/mcp/mcp.json user mcpServers older posts omit the mcp/ folder untested
Amp ~/.config/amp/settings.json, .amp/settings.json in the workspace, or amp mcp add amp.mcpServers the key keeps the amp. prefix untested
Goose ~/.config/goose/config.yaml, %APPDATA%\Block\goose\config\config.yaml extensions cmd, not command, and YAML untested
Kiro .kiro/settings/mcp.json in the workspace, ~/.kiro/settings/mcp.json user mcpServers ${VAR} expansion needs approval untested
Antigravity ~/.gemini/config/mcp_config.json, or .agents/mcp_config.json in the workspace mcpServers remote servers use serverUrl tested
OpenClaw ~/.openclaw/openclaw.json (JSON5) mcp.servers transport: "stdio" untested
DeepSeek Harness (dsh) $DSH_HOME/cordis.patch.yml, or a profile patch - insert: with @deepseek-ai/dsh-mcp-client one plugin instance per server tested
Warp Settings > Agents > MCP servers, or ~/.warp/.mcp.json and .warp/.mcp.json in the project mcpServers working_directory, not cwd untested
Augment Code ~/.augment/settings.json for the Auggie CLI; the IDE uses its own panel mcpServers that file does not drive the IDE untested
Qwen Code ~/.qwen/settings.json, or .qwen/settings.json in the project mcpServers mcp.allowed can silently hide it untested
Kimi CLI ~/.kimi-code/mcp.json, or .kimi-code/mcp.json in the project mcpServers the current Kimi Code CLI, not the archived ~/.kimi/mcp.json tested
Grok CLI ~/.grok/config.toml, or .grok/config.toml in the project [mcp_servers.xerj] Grok Bot has no local stdio registration untested

Codex and the Grok CLI read TOML, so the entry is a table:

[mcp_servers.xerj]
command = "/abs/path/to/xerj"
args = ["mcp"]

OpenCode and Kilo Code take one command array, and Kilo uses the same shape one level shallower:

{"mcp": {"servers": {"xerj": {"type": "local", "command": ["/abs/path/to/xerj", "mcp"], "environment": {"XERJ_URL": "http://localhost:9200"}}}}
{"mcp": {"xerj": {"type": "local", "command": ["/abs/path/to/xerj", "mcp"]}}}

Continue and Goose read YAML:

# ~/.continue/config.yaml
mcpServers:
  - name: xerj
    command: /abs/path/to/xerj
    args:
      - mcp
# ~/.config/goose/config.yaml
extensions:
  xerj:
    type: stdio
    cmd: /abs/path/to/xerj
    args:
      - mcp
    enabled: true

Amp keeps the key namespaced, VS Code and Copilot need servers plus a transport, Zed calls them context servers, and OpenClaw nests them under mcp:

{"amp.mcpServers": {"xerj": {"command": "/abs/path/to/xerj", "args": ["mcp"]}}}
{"servers": {"xerj": {"type": "stdio", "command": "/abs/path/to/xerj", "args": ["mcp"]}}}
{"context_servers": {"xerj": {"command": "/abs/path/to/xerj", "args": ["mcp"], "env": {}}}}
{mcp: {servers: {xerj: {command: "/abs/path/to/xerj", args: ["mcp"], transport: "stdio"}}}}

DeepSeek Harness loads one MCP server as one plugin in $DSH_HOME/cordis.patch.yml, or in a profile patch at $DSH_HOME/profiles/<profile>/cordis.patch.yml. The same block is the profile bundle in dsh/, and its command is xerj on PATH. If that file is only [], replace the array with the block below; appending under [] is not valid YAML. env and cwd are optional stdio fields (args defaults to [], env to {}, cwd to ""). When the node is not running --insecure, add XERJ_AUTH: "ApiKey <key>" under env:

# $DSH_HOME/cordis.patch.yml
- insert:
    - id: mcp-xerj
      name: '@deepseek-ai/dsh-mcp-client'
      config:
        serverName: xerj
        transport: stdio
        command: xerj
        args:
          - mcp
        env:
          XERJ_URL: "http://localhost:9200"
        cwd: ""

Three candidates from the original list are deliberately absent. Aider has no MCP client support at all (Aider-AI/aider#3314 is still open). T3 Code is the other direction: it hosts an MCP endpoint other agents connect to, and its sessions inherit their servers from the harness underneath. Grok Bot has no documented local stdio registration; the Grok CLI does, which is the grok row above.

On main, 25 tools are exposed when Hub tools are enabled, and 22 in a build with no hub key; in a release binary, --facts-model-dir adds xerj_facts_ask (a build from this source has no such flag or tool). The rc.104 release serves 24, because xerj_references arrived after it; the rc.101 release has 23 and 24, because xerj_sources arrives in rc.102. Twelve are thin proxies over an endpoint XERJ already serves:

Tool What it does
xerj_search keyword search over an index, from plain words (query) or an ES query-DSL clause (query_dsl)
xerj_semantic_search recall by meaning over a semantic_text field, the query embedded server-side (default embedder is lexical feature-hashing, not neural, unless the node runs --embed-mode neural)
xerj_vector_search kNN over a dense_vector field
xerj_hybrid_search RRF or linear fusion of sub-queries
xerj_memory_store / xerj_memory_recall durable agent memory in a namespace, recalled by text, meaning or vector
xerj_brain_overview / xerj_brain_ego / xerj_brain_link / xerj_brain_unlink the second-brain link index: orient, expand one node's evidence-backed neighborhood, assert and retire links
xerj_plan a plain-words filter in, validated query DSL out (POST /_ask; deterministic and rule-based, not an LLM)
xerj_sources list, inspect, connect or delete live database sources on the node (/_xerj/sources: Postgres snapshot, then logical replication)

For xerj_search, pass {"prefix":"project","query":"retry policy"} to search project-*, matching xerj search --prefix project. prefix is resolved by the same function as the CLI: the prefix xerj autoindex --prefix stores, so My_Proj searches my-proj-*. Use index for an explicit index name or pattern instead; non-empty index and prefix cannot be combined. An empty prefix, a prefix with no [a-z0-9] character, or a prefix that cannot name an index is an error. With neither argument, the tool searches ax-*.

For new callers, query is a plain string and structured ES query-DSL goes in query_dsl — {"index":"docs","query_dsl":{"match_all":{}}}. Do not combine both fields. The published schema separates the types to simplify tool calls (#2549); it cannot guarantee a model emits valid JSON. Existing callers may still pass an object in query, and omitting both fields retains match_all browsing. Prefer an explicit query_dsl clause when browsing is intended.

Search tools and xerj batch-search default to an 8,000 UAX #29 word budget when max_tokens is omitted or null. A larger integer requests more evidence; accounting explains any trimming. This is not a byte cap or a model/BPE token limit. Errors and mandatory xerj_search staleness hints are outside this budget and remain visible.

xerj_def finds local definitions with the same query, ranking and location deduplication as xerj def --json. For example, {"symbol":"Cache","prefix":"project","kind":"struct","lang":"rust","k":5} searches project-*; index can replace prefix, with the same scope rules as xerj_search. symbol also accepts capability phrases. k must be 1–50 (default 5); optional max_tokens caps the response. Results are ES JSON: declarations live in hits.hits[]._source.code, locations in ax_path/path and line/start_line; older file hits may use fields._passage. hits.total counts engine matches before deduplication. No match returns an empty hit list. As in the CLI, kind/language filters are ignored when no target index maps the field or any target index maps it as numeric. Ranking is lexical. This tool queries the configured node; xerj_hub_def instead looks up definitions in a named Hub pack.

xerj_references (on main, after rc.104) takes the identifier xerj_def found and returns every indexed line that names it, with the definitions listed apart: {"symbol":"Cache","prefix":"project"}. It is lexical, not a call graph: comments and strings count, and a call through an alias does not. Contract and measured precision/recall: endpoint contract.

Two more are not plain proxies: xerj_map returns the per-index field map from the autoindex catalog (trimmed to a byte cap, otherwise verbatim), and xerj_code_search runs the xerj code reference-coding pipeline (tools/xerj-code/) and returns its rendered text. xerj_index_budget counts a folder and estimates its index against the node's disk budget before xerj autoindex hashes anything (it does not index). xerj_autoindex_remove drops one autoindexed folder after listing it, and deletes nothing unless confirm is true. xerj_status probes the node banner, cluster health and visible indices with up to three bounded reads. A missing autoindex catalog does not mean the node has no data; refused or malformed probes remain errors or unknown status. xerj_batch_search retrieves ordered batches with per-item outcomes and citations. xerj_corpus_feedback rates a hub corpus. xerj_field_report files a field report, and xerj_hub_find, xerj_hub_def and xerj_hub_ask answer from Corpus Hub packs already on the machine (the xerj ask flow).

xerj mcp --help prints the same config block and the full option list. The machine-readable tool schemas are published at xerj.org/docs/agents/schemas/mcp-tools.json, generated from a live tools/list, never hand-written, and gated in CI (scripts/mcp-schema-check.sh) plus a unit test, so the published list cannot drift from the served one.

Cloud agents and URL-only clients cannot start a local process. For them, xerj mcp --http (on main, after rc.104) serves the same tools over MCP Streamable HTTP at http://127.0.0.1:9330/mcp. Over HTTP only the 15 read tools are listed (14 with no hub key) unless you pass --allow-writes. A non-loopback bind refuses to start without a bearer token (XERJ_MCP_TOKEN or --token-file, at least 16 characters). Set the token before you put a tunnel in front of it. Verify:

export XERJ_MCP_TOKEN="$(openssl rand -hex 32)"
xerj mcp --http &
curl -s http://127.0.0.1:9330/mcp -H "Authorization: Bearer $XERJ_MCP_TOKEN" \
  -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \
  | jq '.result.tools | length'     # 15

Tunnels, Origin rules and client shapes (claude mcp add --transport http …) are in Remote MCP.

Why it exists

Agents burn their context window reading files. The PHP in WordPress core is about 5.2 million tokens, or 26 full context windows, so an agent cannot simply read it. Grep does not solve this either, because a grep hit is a line, and judging that line means opening the whole file.

Querying an index with passages and a projected _source costs kilobytes per question (a default _search returns whole documents) instead. In an AI security audit of WordPress core, an agent worked across 1,492 PHP files on roughly 26,000 tokens, which is what it takes to load about half a percent of the tree.

Use cases

  • Reference coding: your coding agent retrieves how peer projects already solved it instead of re-deriving. Measured on four purpose-built libraries: 2.7x fewer output tokens than grep-driven coding (26x vs memory alone, which solved 11 of 16); users have told us ~5x in real development.
  • Code search and security audits: AST-aware indexing, so an agent finds a function instead of a line.
  • AI search and RAG: full-text, vector and hybrid retrieval in one query, with no separate vector database.
  • Agent memory: durable recall with a knowledge graph over your own documents.
  • Log analytics and observability: logs, metrics and traces in one engine.
  • Elasticsearch replacement: same wire protocol, one binary.

Runnable examples live in recipes/ and docs/examples/.

Elasticsearch compatibility

XERJ implements the Elasticsearch REST API: indices, documents, bulk, search, aggregations, mappings, kNN, scroll, reindex and the _cat endpoints. Kibana and the official client libraries connect to it directly. One boundary worth knowing before you point export tooling at it: scroll is a bounded up-front snapshot, not a segment-walking cursor, so a query whose exact total exceeds the snapshot window is refused with a 400 rather than silently truncated. Use search_after for result sets of any size (the cap).

The conformance suite runs on every commit and currently passes 1444 of 1454 cases (0 failed, 10 skipped). It lives in engine/tests/es-compat-yaml, and the remaining gaps are listed there rather than hidden. XERJ is compatible with the API. It is not a reimplementation of Elasticsearch internals, and it is not a fork.

Benchmarks

XERJ is benchmarked head to head against Elasticsearch 8.13.4 across ingest, full-text search, aggregations, vector search, and reads issued under a concurrent write flood. The latest closed-loop run scores 55 wins, 26 ties, 4 losses, including 1.72x ingest throughput and a 1.61x smaller on-disk footprint.

All four losses are the same gap: read p99 while a high-rate writer runs. It is written up in full rather than left out. Results and methodology are at xerj.org/benchmarks and the harness is in demo/playbooks (bench-matrix.mjs); the Elasticsearch start and runner scripts still need to be published before anyone can rerun it end to end. Treat any number you cannot reproduce with skepticism, including ours.

Code indexing

Source files are parsed with tree-sitter and indexed AST-aware — symbols plus full text — so an agent retrieves a function, not a line. On an Apache Lucene checkout (6,113 source files, 51 MB) single-threaded in-process extraction runs at ~1,500 files/s (13 MB/s); the tree-sitter parse is ~72% of that and is the per-file floor

(README truncated)

View on GitHub

Recent activity

commits and pull requests

Releases and announcements

734 total
  1. xerj v1.0.0-rc.105v1.0.0-rc.105Nov 23, 20262.5K downloads

    # XERJ v1.0.0-rc.105 **rc.105: 93 merged pull requests since rc.104.** BM25 now uses the real length of long fields, Chinese folders get a CJK analyzer, searches stop waiting on disk syncs while bulk writes run, object sub-fields and filtered aggregations take the fast paths, keyword fields get normalizers, and many requests now behave as in Elasticsearch, including several that used to answer 200 and now answer 400. Read the upgrade notes before you upgrade a node that serves traffic. ## Highlights - **Long documents no longer outrank the answer (#3007).** SearchTome medicine, `multi_match` on title + content: R@1 56.60 → 64.78, R@3 76.77 → 81.74 (paired randomization p < 0.001). - **Chinese folders under `xerj autoindex` (#3377).** On a 29-file PRC statute corpus, 20 law questions: R@1 0.45 → 0.95, R@3 0.60 → 1.00. - **Searches during bulk writes (refs #3324 #3331).** p99 over all reads 204-265 ms → 40-85 ms; writer throughput 34-50k → 53-66k docs/s (3 runs each, load 25-50). - **Object sub-fields on postings (#3464).** `multi_match` on `*` over 200k documents: p50 539-661 ms → 3.9-5.1 ms, now with BM25 scores. - **Filtered aggregations from doc values (#3476, #351

  2. xerj v1.0.0-rc.104v1.0.0-rc.104Nov 19, 20262K downloads

    **All platforms. rc.104 supersedes v1.0.0-rc.103.** rc.103 was published Linux-only, and releases on this repository are immutable once published, so its macOS and Windows builds could not be attached to it. rc.104 is the rc.103 code (no pull request merged to `main` in between; the only source change is the version string) with all eight targets: Linux x86_64 and aarch64 (glibc and musl, plus `.deb` for both glibc targets), macOS x86_64 and aarch64, Windows x86_64 and aarch64, the XERJ Query-1 model bundle (the rc.102 bundle, unchanged, under the rc.104 name) and one `SHA256SUMS`. `releases/latest` and the installer move from v1.0.0-rc.101 to rc.104. ## [1.0.0-rc.104] - 2026-11-18 Everything below is the rc.103 content, now shipped on every platform: the rc.101 field-report fixes (#3287, #3289, #3290, #3291, #3292), the 2026-11-18 fix sweep (#3263, #3264, #3265, #3266) and the contributor Elasticsearch-compatibility wave. The model, its bundle and its serve rule are those of rc.102. ### Upgrade notes - **Data directories.** rc.104 (like rc.103) keeps the rc.101 storage defaults (ZPS4 postings, row-dictionary stored text, on-disk format 4), so an rc.101, rc.102 or rc.103 da

  3. xerj v1.0.0-rc.103v1.0.0-rc.103Nov 18, 2026pre-release54 downloads

    **Linux-only release, not marked latest.** This release ships Linux binaries (x86_64 and aarch64, glibc and musl, plus .deb for both glibc targets), the XERJ Query-1 model bundle (the rc.102 bundle, unchanged, under the rc.103 name) and one `SHA256SUMS`. macOS and Windows builds need the release workflow, which cannot run for this release. **macOS and Windows users stay on v1.0.0-rc.101**, which `releases/latest` and the installer keep serving on every platform; install rc.103 on Linux by downloading the assets below. ## [1.0.0-rc.103] - 2026-11-18 **rc.103: the rc.101 field-report fixes, the 2026-11-18 fix sweep, and a wave of Elasticsearch-compatibility fixes from contributors.** Five lanes answer the rc.101 field reports (#3287, #3289, #3290, #3291, #3292): a stopped local node starts again on its own, a zero-hit search says why, `xerj def` checks hits against the files on disk, `DELETE` of an index no longer fails while its files are held, and `match_phrase` matches dotted identifiers under the `code` analyzer. The fix sweep (#3263, #3264, #3265, #3266) adds a token budget to memory recall, stubs lockfiles by default, makes small-index kNN and hybrid search faster, and lower

  4. rust-vulns corpus pack (pack-rust-vulns-2026-11-09)pack-rust-vulns-2026-11-09Nov 9, 2026pre-release40 downloads

    The `rust-vulns` corpus pack, built and signed by the scheduled `pack publish` workflow from `tools/packs/rust-vulns/recipe.toml`. One release per build; under immutable releases a same-day rebuild publishes under `-r2`, `-r3`, … instead of replacing the day's earlier release. The newest is always at https://github.com/xerj-org/xerj/releases?q=pack-rust-vulns Build history lives in the releases themselves and in the workflow runs. Install (public key: `tools/packs/keys/rust-vulns.pub` in the repo): xerj corpus add rust-vulns --from rust-vulns-pack.zip \ --verify-sig rust-vulns.pub xerj corpus index rust-vulns `rust-vulns-freshness.json` carries the build date and record count; the same 30-day staleness refusal that governs every reference corpus governs this one.

  5. agent-session-trajectories corpus pack (pack-agent-session-trajectories-2026-11-09)pack-agent-session-trajectories-2026-11-09Nov 9, 2026pre-release33 downloads

    The `agent-session-trajectories` corpus pack — the first external-contributor pack on the hub (chunxiaoxx / Nautilus, #1255; demand anchored to #1138, wishlist slot #1210). 70 sanitized multi-session agent trajectories with failure turns kept verbatim, built and signed by the `pack publish` workflow from `tools/packs/agent-session-trajectories/recipe.toml`. One release per build; under immutable releases a same-day rebuild publishes under `-r2`, `-r3`, … instead of replacing the day's earlier release. The newest is always at https://github.com/xerj-org/xerj/releases?q=pack-agent-session-trajectories Install (public key: `tools/packs/keys/agent-session-trajectories.pub` in the repo): xerj corpus add agent-session-trajectories \ --from agent-session-trajectories-pack.zip \ --verify-sig agent-session-trajectories.pub xerj corpus index agent-session-trajectories `agent-session-trajectories-freshness.json` carries the build date and record count; the same 30-day staleness refusal that governs every reference corpus governs this one.

Code frequency

additions and deletions
+430.6K-430.6KWeek of 2026-06-28: +430,618 linesWeek of 2026-06-28: -14,669 linesWeek of 2026-07-05: +110,441 linesWeek of 2026-07-05: -56,186 linesWeek of 2026-07-12: +21,381 linesWeek of 2026-07-12: -2,847 linesWeek of 2026-07-19: +26,459 linesWeek of 2026-07-19: -2,132 linesWeek of 2026-07-26: +69,083 linesWeek of 2026-07-26: -5,293 linesWeek of 2026-08-02: +56,525 linesWeek of 2026-08-02: -4,923 linesWeek of 2026-08-09: +100,637 linesWeek of 2026-08-09: -11,015 linesWeek of 2026-08-16: +106,645 linesWeek of 2026-08-16: -9,925 linesWeek of 2026-08-23: +17,553 linesWeek of 2026-08-23: -5,265 linesWeek of 2026-08-30: +18,665 linesWeek of 2026-08-30: -2,462 linesWeek of 2026-09-06: +2,354 linesWeek of 2026-09-06: -555 linesWeek of 2026-09-13: +57,790 linesWeek of 2026-09-13: -4,364 linesWeek of 2026-09-20: +164,035 linesWeek of 2026-09-20: -29,871 linesWeek of 2026-09-27: +162,090 linesWeek of 2026-09-27: -2,910 linesWeek of 2026-10-04: +30,470 linesWeek of 2026-10-04: -3,960 linesWeek of 2026-10-11: +65,629 linesWeek of 2026-10-11: -6,360 linesWeek of 2026-10-18: +177,900 linesWeek of 2026-10-18: -38,096 linesWeek of 2026-10-25: +166,453 linesWeek of 2026-10-25: -34,794 linesWeek of 2026-11-01: +109,056 linesWeek of 2026-11-01: -21,610 linesWeek of 2026-11-08: +2,665 linesWeek of 2026-11-08: -199 linesWeek of 2026-11-15: +67,189 linesWeek of 2026-11-15: -1,690 linesWeek of 2026-11-22: +42,117 linesWeek of 2026-11-22: -3,303 linesJun 28, 2026Nov 22, 2026
+2M lines added, -262.4K removed over the last year.

Commits per week

last 52 weeks
3560Week of 2025-11-30: 0 commitsWeek of 2025-12-07: 0 commitsWeek of 2025-12-14: 0 commitsWeek of 2025-12-21: 0 commitsWeek of 2025-12-28: 0 commitsWeek of 2026-01-04: 0 commitsWeek of 2026-01-11: 0 commitsWeek of 2026-01-18: 0 commitsWeek of 2026-01-25: 0 commitsWeek of 2026-02-01: 0 commitsWeek of 2026-02-08: 0 commitsWeek of 2026-02-15: 0 commitsWeek of 2026-02-22: 0 commitsWeek of 2026-03-01: 0 commitsWeek of 2026-03-08: 0 commitsWeek of 2026-03-15: 0 commitsWeek of 2026-03-22: 0 commitsWeek of 2026-03-29: 0 commitsWeek of 2026-04-05: 0 commitsWeek of 2026-04-12: 0 commitsWeek of 2026-04-19: 0 commitsWeek of 2026-04-26: 0 commitsWeek of 2026-05-03: 0 commitsWeek of 2026-05-10: 0 commitsWeek of 2026-05-17: 0 commitsWeek of 2026-05-24: 0 commitsWeek of 2026-05-31: 0 commitsWeek of 2026-06-07: 0 commitsWeek of 2026-06-14: 0 commitsWeek of 2026-06-21: 0 commitsWeek of 2026-06-28: 63 commitsWeek of 2026-07-05: 213 commitsWeek of 2026-07-12: 67 commitsWeek of 2026-07-19: 86 commitsWeek of 2026-07-26: 160 commitsWeek of 2026-08-02: 107 commitsWeek of 2026-08-09: 258 commitsWeek of 2026-08-16: 245 commitsWeek of 2026-08-23: 196 commitsWeek of 2026-08-30: 43 commitsWeek of 2026-09-06: 17 commitsWeek of 2026-09-13: 26 commitsWeek of 2026-09-20: 117 commitsWeek of 2026-09-27: 126 commitsWeek of 2026-10-04: 169 commitsWeek of 2026-10-11: 349 commitsWeek of 2026-10-18: 356 commitsWeek of 2026-10-25: 245 commitsWeek of 2026-11-01: 212 commitsWeek of 2026-11-08: 44 commitsWeek of 2026-11-15: 71 commitsWeek of 2026-11-22: 225 commitsNov 30, 2025Nov 22, 2026
3.4K commits in the last 52 weeks.

When work happens

weekday and hour
SunMonTueWedThuFriSat036912151821Sun 0:00 — 31 commitsSun 1:00 — 29 commitsSun 2:00 — 23 commitsSun 3:00 — 21 commitsSun 4:00 — 13 commitsSun 5:00 — 10 commitsSun 6:00 — 19 commitsSun 7:00 — 25 commitsSun 8:00 — 9 commitsSun 9:00 — 17 commitsSun 10:00 — 17 commitsSun 11:00 — 18 commitsSun 12:00 — 15 commitsSun 13:00 — 21 commitsSun 14:00 — 16 commitsSun 15:00 — 32 commitsSun 16:00 — 30 commitsSun 17:00 — 39 commitsSun 18:00 — 28 commitsSun 19:00 — 42 commitsSun 20:00 — 41 commitsSun 21:00 — 37 commitsSun 22:00 — 30 commitsSun 23:00 — 26 commitsMon 0:00 — 22 commitsMon 1:00 — 16 commitsMon 2:00 — 16 commitsMon 3:00 — 34 commitsMon 4:00 — 18 commitsMon 5:00 — 12 commitsMon 6:00 — 19 commitsMon 7:00 — 28 commitsMon 8:00 — 24 commitsMon 9:00 — 23 commitsMon 10:00 — 24 commitsMon 11:00 — 17 commitsMon 12:00 — 23 commitsMon 13:00 — 29 commitsMon 14:00 — 13 commitsMon 15:00 — 17 commitsMon 16:00 — 20 commitsMon 17:00 — 13 commitsMon 18:00 — 13 commitsMon 19:00 — 20 commitsMon 20:00 — 26 commitsMon 21:00 — 26 commitsMon 22:00 — 11 commitsMon 23:00 — 14 commitsTue 0:00 — 13 commitsTue 1:00 — 21 commitsTue 2:00 — 6 commitsTue 3:00 — 20 commitsTue 4:00 — 4 commitsTue 5:00 — 25 commitsTue 6:00 — 19 commitsTue 7:00 — 16 commitsTue 8:00 — 18 commitsTue 9:00 — 16 commitsTue 10:00 — 14 commitsTue 11:00 — 29 commitsTue 12:00 — 10 commitsTue 13:00 — 9 commitsTue 14:00 — 30 commitsTue 15:00 — 24 commitsTue 16:00 — 13 commitsTue 17:00 — 19 commitsTue 18:00 — 38 commitsTue 19:00 — 36 commitsTue 20:00 — 34 commitsTue 21:00 — 17 commitsTue 22:00 — 13 commitsTue 23:00 — 19 commitsWed 0:00 — 14 commitsWed 1:00 — 9 commitsWed 2:00 — 11 commitsWed 3:00 — 3 commitsWed 4:00 — 11 commitsWed 5:00 — 15 commitsWed 6:00 — 15 commitsWed 7:00 — 15 commitsWed 8:00 — 11 commitsWed 9:00 — 8 commitsWed 10:00 — 14 commitsWed 11:00 — 18 commitsWed 12:00 — 41 commitsWed 13:00 — 31 commitsWed 14:00 — 33 commitsWed 15:00 — 11 commitsWed 16:00 — 16 commitsWed 17:00 — 23 commitsWed 18:00 — 20 commitsWed 19:00 — 24 commitsWed 20:00 — 24 commitsWed 21:00 — 11 commitsWed 22:00 — 23 commitsWed 23:00 — 17 commitsThu 0:00 — 6 commitsThu 1:00 — 9 commitsThu 2:00 — 23 commitsThu 3:00 — 8 commitsThu 4:00 — 120 commitsThu 5:00 — 7 commitsThu 6:00 — 8 commitsThu 7:00 — 16 commitsThu 8:00 — 10 commitsThu 9:00 — 10 commitsThu 10:00 — 39 commitsThu 11:00 — 32 commitsThu 12:00 — 20 commitsThu 13:00 — 26 commitsThu 14:00 — 17 commitsThu 15:00 — 16 commitsThu 16:00 — 18 commitsThu 17:00 — 31 commitsThu 18:00 — 14 commitsThu 19:00 — 19 commitsThu 20:00 — 21 commitsThu 21:00 — 25 commitsThu 22:00 — 22 commitsThu 23:00 — 13 commitsFri 0:00 — 6 commitsFri 1:00 — 10 commitsFri 2:00 — 6 commitsFri 3:00 — 9 commitsFri 4:00 — 12 commitsFri 5:00 — 7 commitsFri 6:00 — 15 commitsFri 7:00 — 9 commitsFri 8:00 — 5 commitsFri 9:00 — 14 commitsFri 10:00 — 20 commitsFri 11:00 — 23 commitsFri 12:00 — 37 commitsFri 13:00 — 23 commitsFri 14:00 — 17 commitsFri 15:00 — 16 commitsFri 16:00 — 14 commitsFri 17:00 — 22 commitsFri 18:00 — 14 commitsFri 19:00 — 16 commitsFri 20:00 — 26 commitsFri 21:00 — 21 commitsFri 22:00 — 28 commitsFri 23:00 — 28 commitsSat 0:00 — 78 commitsSat 1:00 — 11 commitsSat 2:00 — 10 commitsSat 3:00 — 10 commitsSat 4:00 — 10 commitsSat 5:00 — 9 commitsSat 6:00 — 13 commitsSat 7:00 — 12 commitsSat 8:00 — 9 commitsSat 9:00 — 30 commitsSat 10:00 — 28 commitsSat 11:00 — 34 commitsSat 12:00 — 34 commitsSat 13:00 — 22 commitsSat 14:00 — 23 commitsSat 15:00 — 21 commitsSat 16:00 — 37 commitsSat 17:00 — 19 commitsSat 18:00 — 13 commitsSat 19:00 — 19 commitsSat 20:00 — 24 commitsSat 21:00 — 18 commitsSat 22:00 — 27 commitsSat 23:00 — 19 commits
Commit volume by weekday and hour (UTC). Larger dots mean more commits.

Who is committing

last 52 weeks
Maintainer commits3,109 (65%)
Community commits1,681 (35%)

4,790 commits in total over the last year.

DateListRankStars gained
Oct 19, 2026daily#9+1,160
Oct 18, 2026daily#9+1,160
Oct 17, 2026daily#8+1,648
Oct 16, 2026daily#6+715
  • morluto/rea

    Reverse engineer anything with agents, from app behavior down to native binaries.

    486.9K stars · TypeScript

  • affaan-m/ECC

    The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

    315K stars · JavaScript

  • NousResearch/hermes-agent

    The agent that grows with you

    267.7K stars · Python

  • firecrawl/firecrawl

    Firecrawl is the knowledge infrastructure to make your agents smarter. It connects your agents to the web, and to Alexandria, our library of everything else.

    215K stars · TypeScript

  • n8n-io/n8n

    Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

    212.8K stars · TypeScript

  • yt-dlp/yt-dlp

    A feature-rich command-line audio/video downloader

    212.3K stars · Python