FOR AI· BUILD WITH XERJ· PORT 9200

THE SEARCH ENGINE
FOR AI AGENTS.

A search engine for AI agents is a search service the agent calls as a tool: it finds the passages that answer a question, ranks them and says where each one came from. Web search APIs cover the public web. XERJ covers your own data, a new way for AI to search for data: one local Rust binary that indexes your code, docs, specs and logs, plus Corpus Hub packs, and returns cited answers.

An agent needs to turn raw files into something it can query, find things by keyword and by meaning, remember what it learns, and recall it later. XERJ does all of it over plain HTTP on :9200 and through its MCP server, with zero-config folder indexing (xerj autoindex), keyword, semantic, vector and hybrid search, and a per-agent memory store. No SDK, no signup, no external embedding key. If your agent can make an HTTP request, it can use XERJ.

PASTE THIS TO YOUR AI AGENT Act as a coding agent. Read https://xerj.org/llms.txt, install XERJ, run xerj autoindex on this folder, then answer my next question with xerj search and cite the file and line for each claim.
ONE COMMAND · GIVE AN AGENT A FOLDER

Handed a pile of files nobody documented? xerj autoindex content-sniffs every file (extensions are never trusted) across 13 format families (JSONL, JSON, dialect-sniffed CSV, logs, SQL dumps, SQLite, PDF, DOCX, HTML, XML, YAML, plain text, gzip), infers types and date encodings, writes explicit mappings, and streams everything in with idempotent IDs. The agent flow is three steps:

# 1. index: one command, no per-corpus flags; junk is recorded, never fatal
$ xerj autoindex ./folder

# 2. orient: the engine describes the folder back to the agent
$ xerj autoindex map                       # or: POST /autoindex-catalog/_search
#    → datasets, counts, per-field types with real examples, time ranges,
#      cross-dataset key correlations, junk report, verified engine gotchas

# 3. query: plain ES queries over the new ax-* indices
$ curl -sXPOST localhost:9200/ax-logs/_search -H 'content-type: application/json' \
    -d '{"size":0,"query":{"term":{"level":"ERROR"}},
         "aggs":{"by_service":{"terms":{"field":"service"}}}}'

In the recorded evaluation, the XERJ-backed agent reached for terms, cardinality, sum / max, date_histogram, _count, and full-text queries, and all 10 of its runs consulted the catalog first. Verified: 80/81 ground-truth checks on a 1,995-file / 518 MB secret-manifest corpus (the one miss: a Shift-JIS file indexed as mojibake); 31 datasets / 2,018,398 records live in 38.1 s; kill -9 resume converges to identical counts. Honest result from the controlled agent exam: a XERJ-backed agent tied a fair grep/python baseline on accuracy (9 + 1 partial of 10 vs 10/10) on that local corpus: XERJ's wins are structural: orientation in 4 API calls, sub-second aggregations over millions of rows, uniform access to SQLite / DOCX / gzip / decimal-comma CSV, and remote/API-only access. Full walkthrough: the zero-config indexing recipe.

30 SECONDS · STORE, THEN RECALL BY MEANING

Store what an agent learned, then recall it with a question that shares no keywords: no vectors supplied, no index to create first. This is a real run against an empty XERJ.

$ curl -sXPOST localhost:9200/_memory/agent-demo \
    -H 'content-type: application/json' \
    -d '{"text":"The user prefers metric units and a dark UI theme.","metadata":{"kind":"preference"}}'
{"created":true,"id":"77eff57b-e432-431c-8b49-8a16b33ab551","namespace":"agent-demo"}

$ curl -sXPOST localhost:9200/_memory/agent-demo/_recall \
    -H 'content-type: application/json' \
    -d '{"query":"what display settings does the user like?","semantic":true,"k":1}'
{"hits":[{"id":"77eff57b-e432-431c-8b49-8a16b33ab551",
          "metadata":{"kind":"preference"},
          "score":0.655571460723877,
          "text":"The user prefers metric units and a dark UI theme."}],
 "namespace":"agent-demo"}

"semantic":true tells XERJ to embed the question server-side and match by similarity: the recall text never contains the words "display" or "settings".

FOUR JOBS · ONE BINARY
00 · DISCOVER Point it at a folder

xerj autoindex <folder>: content-sniffed formats, inferred types, explicit mappings, idempotent resumable ingest, and a self-describing catalog (autoindex-catalog) agents query to orient.

xerj autoindex · map · status
01 · SEARCH Find anything, four ways

Keyword & structured (match, term, bool), semantic retrieval by meaning, knn vector search (HNSW-served when unfiltered, exact when filtered), and hybrid fusion: all on the same ES-compatible _search endpoint.

POST /:index/_search
02 · DATA Index & read your docs

Create indices with semantic_text and dense_vector mappings; write with _doc or NDJSON _bulk; read, filter, and aggregate. The wire an existing Elasticsearch client already speaks.

PUT /:index · POST /:index/_bulk
03 · MEMORY Per-agent memory

A dedicated /_memory/{ns} store: remember a fact, recall it by meaning / keyword / vector, filter by metadata, forget. Each namespace is a physically isolated index, so agents never read each other's memories.

POST /_memory/:ns · /_recall

For how open-source memory tools compare on the same questions, start with the AI agent memory benchmark. Then see the side-by-side pages for agentmemory, mcp-memory-service, memvid, and ReMe. Claude Code users can also read how Claude Code memory works and what an MCP memory server is.

THE SEVEN CANONICAL AGENT OPERATIONS
OPERATION
CALL
DOES
xerj_autoindex
xerj autoindex <folder>
CLI ONLY · NO HTTP ROUTE
Make a folder searchable, zero config: sniffed formats, inferred mappings, self-describing catalog.
xerj_search
POST /:index/_search
Keyword + structured relevance (BM25 & filters).
xerj_semantic_search
semantic query
Retrieve by meaning; the server embeds the query text.
xerj_vector_search
knn
Nearest-neighbor over dense_vector: HNSW-served with exact rescoring when unfiltered, exact brute-force scan when filtered.
xerj_hybrid_search
hybrid query
Fuse keyword + vector with rrf / linear.
xerj_memory_store
POST /_memory/:ns
Remember a fact (text auto-embedded).
xerj_memory_recall
POST /_memory/:ns/_recall
Recall top-k by meaning, keyword, or vector.

Exact request and response shapes for every HTTP operation are on the endpoint contract; xerj_autoindex is a CLI subcommand of the xerj binary: its full contract is in the recipe and /llms-full.txt.

WORKED EXAMPLE · GIVE AN AGENT A SEARCHABLE DOCUMENT FOLDER

Point the agent at a messy folder of real documents: PDF, DOCX, HTML, Markdown, plain text. One indexing pass walks the tree, extracts the text from every format, chunks it, and bulk-indexes into XERJ with an auto-embedded semantic_text body. After that the agent just asks questions over :9200 and gets back ranked, cited passages, no whole-file re-reads, no format blind spots.

# one-time: walk ./corpus, extract every format, chunk, bulk-index into `docfolder`
$ node xerj-index.mjs ./corpus          # 29 files → 420 chunks · 1339 ms

# the agent asks a question: hybrid = BM25 on body_text, fused (rrf)
# with semantic recall on the auto-embedded body
$ curl -sXPOST localhost:9200/docfolder/_search \
    -H 'content-type: application/json' \
    -d '{"size":5,"query":{"hybrid":{"queries":[
          {"query":{"match":{"body_text":"weeks of paid parental leave?"}}},
          {"query":{"semantic":{"field":"body","query":"weeks of paid parental leave?","k":5}}}],
        "fusion":"rrf"}}}'

On a 22-question set over that folder, this beat a fair shell-only agent that greps the raw files (searching the question's own terms, not a rigged keyword list): 21/22 (95.5%) answered versus 14/22 (63.6%). The decisive, capability-based gap is on answers that live only inside a PDF or DOCX: grep sees compressed bytes and matches nothing: 6/7 vs 0/7. On the plaintext buckets a fair grep keeps up: differently-phrased answers tie 5/5 vs 5/5, and the literal control ties 6/6 vs 6/6, so XERJ is not winning the cases grep can actually read. What it adds there is single-query, ranked retrieval and, on large documents, far less context: over the large-document set it returns 17.24× fewer bytes than the whole answer files a fair grep must open, where the baseline is charged only the single answer-containing file it must open to read the line, nothing else. Query latency was p50 61.23 ms (max 116.09 ms).

Honest scope, the same standard as everywhere on this page: the built-in semantic_text embedder is a lexical feature-hashing model (384-dim cosine), not neural, so its matching is word/sub-word overlap, not deep understanding, which is exactly why the differently-phrased set is a tie, not a XERJ win; knn is exact brute-force at this corpus size. And the context win is scale-dependent: on the large-document set it is 17.24×, but on tiny plaintext files it INVERTS to 0.23×: returning a few ranked passages can cost more than reading the small file whole, so we don't claim it there. The full corpus, query set, scorecard, and run steps are in the document-folder-index recipe.

WHAT IS HONEST TO CLAIM

XERJ describes only what actually runs. Two things worth knowing:

START BUILDING
QUICKSTART Boot → store → recall → search

Five runnable curl steps against a fresh XERJ, real output at every step.

CONTRACT Endpoint reference

Method, path, request body and response shape for the six HTTP operations. The seventh, xerj_autoindex, is a CLI subcommand with no endpoint: its contract is in the flagship recipe.

OVERVIEW Build with XERJ

The mental model and the map of the whole agent surface.

RECIPE · FLAGSHIP Zero-config indexing

xerj autoindex: any folder → typed, queryable, self-describing indices. Every number traces to a run.

RECIPE Give an agent memory

A memory-backed agent: store, recall, filter, forget, per-agent isolation.

RECIPE Semantic search & RAG

Retrieval by meaning with semantic_text: no separate vector DB.

RECIPE Index a document folder

Give an agent format-agnostic search over a folder of PDF, DOCX, HTML & Markdown: walk, extract, chunk, hybrid-query.

REFERENCE ES-compatible API

The full Elasticsearch-wire surface your existing client already targets.

BLOG · MILESTONE 100 contributors, 12,000 stars in 12 days

What XERJ gives your agent now: reference memory, reference coding and 24 MCP tools, and the road to 1.0.

FOR MACHINES · DISCOVER XERJ

Point a crawler or an agent's tool-discovery step at these. Every one is a static file on this site, fetchable without a key, describing the same operations documented above.

RUN THE AGENT QUICKSTART →
TRY IT · CONNECT YOUR AGENT IN ONE MINUTE
Try it: agent MCP setup and query builder

Build the setup and the prompt for your agent

1. Which agent?
2. What is in the workspace?
3. How should it search?

Setup

curl -fsSL https://xerj.org/get | sh
xerj autoindex ./project
xerj init
claude mcp add --scope user xerj -- "$(command -v xerj)" mcp

Prompt

Act as a coding agent in Claude Code. Read https://xerj.org/llms.txt. Run xerj autoindex ./project on this code repository, then xerj autoindex map to orient. Use the xerj MCP server and answer my next question with xerj_hybrid_search. Cite the file and line for each claim.

Runs in your browser and sends nothing. Commands and config paths are the ones xerj init writes or prints, as listed in llms.txt and the Codex and Cursor guide. Tool names are from the seven agent operations above.
QUESTIONS
What is a search engine for AI agents?

A search service an agent calls as a tool. It takes a question, returns ranked passages with their source, and lets the agent cite them. Web search APIs cover the public web; XERJ covers files on your machine and Corpus Hub packs.

How is XERJ different from a web search API like Exa?

Exa and similar APIs search the public web. XERJ indexes your own code, documents and data locally, so nothing is uploaded, and it also keeps agent memory in the same binary.

Does my agent need an SDK or an API key?

No SDK and no signup. The agent uses plain HTTP on port 9200 or the MCP server. The default embedder is local, so no external embedding key is needed.

Which agents work with it?

Any agent that can call an MCP server or make an HTTP request, including Claude Code, Codex and Cursor. xerj init wires the MCP server into the project for you.

Search and memory guides

Explore Science: neurosymbolic AI, hybrid search and agentic memory. Compare XERJ vs Memvid, see the AI agent memory benchmark, and read About XERJ.