XERJ is a local-first search engine and MCP server for AI agents and robots, implemented in Rust and distributed as a single static binary with no JVM or other dependencies.
Main uses and capabilities:
- Automatic indexing of any folder: via the xerj autoindex <folder> command, it automatically identifies file types and creates an index for each one, supporting code, documents, logs, PDFs, SQLite, CSV, JSONL, XML, YAML, DOCX, PPTX, XLSX, EPUB, Jupyter Notebook, HTML, email, and common log formats, among others. Code files are parsed via tree-sitter, preserving symbols and line numbers.
- Multiple retrieval methods: supports BM25 full-text search, vector search, and hybrid search, and provides an Elasticsearch-compatible API, so existing Elasticsearch clients, dashboards, and tools can be used directly.
- Code search and reference coding: agents can query XERJ to obtain exact code snippets instead of using grep to read entire files. According to the materials, in a controlled study, output tokens were reduced by 2.7x at the same solve rate, and users report roughly a 5x reduction in daily use.
- Agent long-term memory: stores what agents learn via /_memory/{namespace} and recalls it semantically in later sessions.
- RAG and security auditing: can be used for codebase Q&A, security auditing, log and incident analysis, and other scenarios.
- XERJ Query-1 model (since rc.101): converts questions into small programs over stored facts, performing operations such as lookup, comparison, and counting; returns UNKNOWN if the data cannot support the question, and CONFLICT if facts conflict. The model is disabled by default and must be enabled via parameters such as --facts-model-dir; it exists only in release binaries and is not included in the source code.
Usage:
- Installation: a one-click install script is provided, and manual installation is also supported (Windows PowerShell, Nix, etc.). Prebuilt binaries cover x86-64 and arm64 on Linux, macOS, and Windows.
- Startup: run xerj --insecure --data-dir ~/xerj-data &, and wait for http://localhost:9200 response. --insecure disables TLS and API key authentication, and is recommended only for single-user environments on development machines; the default startup binds to 127.0.0.1.
- Indexing: xerj autoindex ~/my-project. If authentication is enabled on the server, the key must be passed via --api-key or XERJ_API_KEY.
- Querying: use any Elasticsearch client to send requests to localhost:9200, supporting knn and semantic syntax.
- Batch querying: xerj batch-search --input queries.json or the MCP tool xerj_batch_search.
- Data map: xerj autoindex map --prefix myproject --html xerj-map.html --redact-paths generates an offline data map report.
Use cases: Reference coding (indexing similar open-source projects and reusing their solutions), codebase Q&A and RAG, security auditing, log and event analysis, and long-term memory for agents.
Limitations and caveats:
- The XERJ Query-1 model is a proprietary component, provided only with the release binary; its training and evaluation data have not been made public. It does not support sums and totals (sum questions may return member counts), has limited performance on large fact sets (e.g., 95,000 facts), and declines to answer more frequently than an LLM would guess.
- The data directory should not be placed inside a folder that will be automatically indexed, otherwise the node will index its own storage.
- The default lexical embedder works offline; neural mode requires three model files to be prepared locally before the first semantic operation.
- Hosts without runtime internet access should refer to the air-gapped deployment guide.
- The project uses Apache-2.0 engine source code, but starting from rc.101 the XERJ Query-1 crates in the release are proprietary.
- To participate in the community, submit a brief field report PR.