# XERJ

> Open-source AI-native search engine in a single Rust binary that indexes folders and code for agents and speaks the Elasticsearch API.

XERJ is an Apache-2.0 search engine written in Rust and shipped as one static binary. It indexes code, documents and data so an AI agent can query an index instead of reading files into its context window, and it exposes the Elasticsearch REST API so existing clients connect unchanged. The latest release listed is v1.0.0-rc.95.

## What It Is

XERJ is a local search and retrieval engine aimed at coding agents and other AI agents. Running `xerj autoindex <folder>` sniffs every file by content, infers types and mappings, and creates typed indices with no schema or pipeline to write. Source files are parsed with tree-sitter so results are functions with symbols and line numbers rather than flat text. It handles code, CSV, JSON, JSONL, XML, YAML, SQLite, PDF, DOCX, HTML, mail and common log formats.

## Reference Coding Workflow

The project's main described use case is reference coding: clone the open-source repos closest to what you are building, index them once, and have the agent retrieve the exact definition before writing code. `xerj search` returns ranked passages with file:line, and `xerj def` answers where a symbol is defined along with its signature. According to the vendor's case study, retrieval used 2.7x fewer output tokens than a grep-driven agent at the same solve rate across eight tasks. The project states the benefit is gated by memorisation: it helps on private, niche or post-cutoff code and is neutral to harmful on popular libraries the model already knows.

## Search, Memory and Agent Access

XERJ covers full-text BM25, kNN vector search and hybrid fusion (RRF) in one query tree. The default embedder is lexical and offline, and a neural embedder is opt-in. A namespaced `/_memory` REST API stores and recalls agent memories, and a `/_graph` layer links indexed documents with evidence. `xerj mcp` runs an MCP stdio server that proxies tools such as search, semantic search, hybrid search, memory and code search to a running node. An optional rerank stage can send result text to the external Jev service, and a local history-vote decision endpoint is also offered.

## Elasticsearch Compatibility and Deployment

XERJ implements the Elasticsearch REST API for indices, documents, bulk, search, aggregations, kNN and `_cat` endpoints. The project reports 1366 of 1369 conformance cases passing and publishes benchmark results against Elasticsearch, including losses. Prebuilt binaries cover Linux, macOS and Windows on x86-64 and arm64, installed with a one-line script or built from source with Rust. The `--insecure` dev mode disables TLS and auth and is meant for a single user on a dev machine.

## Features
- Zero-config folder indexing with xerj autoindex
- Tree-sitter AST code search with symbols and line numbers
- Go-to-definition via xerj def
- BM25, kNN and hybrid RRF search in one query
- Elasticsearch-compatible REST API
- Agent memory API (/_memory) with per-namespace isolation
- Knowledge link graph (/_graph) with evidence
- MCP stdio server with search, memory and code-search tools
- Resumable, idempotent ingest
- Offline lexical embedder with opt-in neural embedder
- Optional rerank stage via external judge
- Read-only share links for indexed folders
- Single static binary with no JVM

## Integrations
Elasticsearch clients, Kibana, Claude Code, Cursor, Model Context Protocol, S3-compatible storage, Jev (TypeSafe AI), Prometheus, OTLP

## Platforms
WINDOWS, MACOS, LINUX, WEB, API, CLI

## Pricing
Open Source, Free tier available

## Version
v1.0.0-rc.95

## Links
- Website: https://xerj.org
- Documentation: https://xerj.org/docs/
- Repository: https://github.com/xerj-org/xerj
- EveryDev.ai: https://www.everydev.ai/tools/xerj
