Jorge Turbica / blog · Blog ← All articles ES · Leer en español
AI

Repo of the day: XERJ, a local Rust search engine that speaks Elasticsearch

Indexes your folder and serves it through the Elasticsearch API and MCP, so your agent fetches passages, not whole files. Plus how it compares with Graphify.

A single Rust binary, no JVM or cluster, that answers the Elasticsearch REST API and exposes an MCP server for your coding agent. That's XERJ: it indexes a folder (code, docs, logs, PDFs) and lets the agent fetch passages instead of reading whole files. On October 16, 2026 it had about 5.6k stars and was on GitHub's daily Trending page.

What it is

It's a static, dependency-free binary with builds for Linux, macOS and Windows on x86-64 and arm64, licensed Apache-2.0. Its hook is that it implements the Elasticsearch REST API, so clients that already talk to Elasticsearch can point at XERJ unchanged.

Under the hood, the autoindex command detects file types and creates one index per inferred dataset. Code is parsed with tree-sitter to keep symbols and line numbers. Search combines full-text (BM25), vector (kNN) and hybrid queries in Elasticsearch syntax. For agents it exposes an MCP server over stdio (xerj mcp) with 13 tools, including search, memory (save and recall) and a code-search pipeline. The default embedder is lexical and works offline; a neural one requires preparing model files separately.

How to use it

According to the README, installing is one script and minimal usage is four commands:

bash
curl -fsSL https://xerj.org/get | sh
xerj --insecure --data-dir ./data &
xerj autoindex ~/my-project
xerj search "how do we rotate the WAL segment"

It also answers the classic API:

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

Two warnings. curl | sh runs an unreviewed remote script: read it first. And --insecure turns off TLS and authentication; the README says the node only listens on 127.0.0.1, but it's a single-user development mode, and on a shared host you need to enable authentication.

What I like and what I don't

I like that it reuses a well-known contract, the Elasticsearch API, and ships as a single binary: something that needs no cluster or JVM makes it much easier to try. Having the MCP server built in makes it easy to plug into any agent.

What holds me back are the limits the README itself admits. Scroll is a bounded snapshot, and queries that exceed the window return a 400 instead of truncating (search_after is recommended). Elasticsearch conformance is 1,366 of 1,369 cases, and on p99 read latency with a high-rate concurrent writer it concedes losing to Elasticsearch 8.13.4. Reranking quality with the real model is listed as unverified, and the optional external reranker (Jev) sends result text off the node, although it's disabled by default.

And the token-savings figures don't add up within the page: the pitch says "40x fewer tokens than grep" while the case study shows 2.7x fewer output tokens. The README adds that the benefit depends on the model not having memorized the code already, and that it's neutral or even harmful with popular public libraries. I'd take 2.7x as the order of magnitude and measure it on my own repository; for a code-only repo, ripgrep plus a good symbol index still covers many cases with no extra service.

XERJ vs Graphify

Graphify, at about 127.7k stars, is the other project that comes up as soon as you look for structured context for an agent. They attack the problem from opposite sides: XERJ is hybrid document search; Graphify turns the project into a knowledge graph.

Graphify parses code locally with tree-sitter, deterministically and without an LLM, and runs docs, PDFs and images through your assistant's model to extract concepts. The result is a graph with edges such as calls, imports or inherits, communities detected with Leiden clustering and the most-connected nodes, queried with graphify query, graphify path "A" "B" or graphify explain "X", and exportable to Neo4j or FalkorDB.

XERJGraphify
ModelSearch index (BM25, kNN, hybrid)Knowledge graph (nodes and relations)
Answers"Where is X discussed?": exact passages and lines"What depends on X?", "how do I get from A to B?"
CorpusCode, logs, docs, PDFsCode, docs, SQL schemas, configs, PDFs, images
LLM at index timeNo (lexical embedder by default)Only for non-code content
IntegrationMCP server and Elasticsearch API/graphify skill for 20+ assistants
Stack and licenseRust binary, Apache-2.0Python 3.10+ CLI, Apache-2.0 and MIT

When to pick which: XERJ if the agent needs to find code snippets, error traces or docs quickly in a mixed corpus; Graphify if it needs to reason about architecture, the impact of a change or the path of a call. They're complementary: one tells you where something is, the other what it's connected to.

Sources

Jorge Turbica

Software Engineer and SRE. I write about the real challenges I run into in production.

See portfolio ↗