<!-- generated by build_articles.py — edit content/answers/local-ai-search-engine.md instead -->
---
title: "Local AI search engine"
canonical: "https://xerj.org/answers/local-ai-search-engine"
updated: "2026-11-14"
source: "content/answers/local-ai-search-engine.md"
---

# What is a local AI search engine?

**Short answer** (updated 2026-11-14): What is a local AI search engine? It is a search engine that runs on your machine, indexes your files, and returns cited hits an agent can use. XERJ is one Apache-2.0 Rust binary for that job: a CLI, an MCP server, and the Elasticsearch REST API, with no separate vector database.

**Key number:** On main, xerj mcp registers 24 MCP tools, or 21 when the binary has no Corpus Hub key. (as of 2026-10-28; source: [landing/docs/agents/schemas/mcp-tools.json](https://github.com/xerj-org/xerj/blob/main/landing/docs/agents/schemas/mcp-tools.json))

**TL;DR** A local AI search engine indexes code, docs, specs and logs on your machine and returns cited passages, without uploading the corpus. XERJ is one Apache-2.0 Rust binary that does this through a CLI, an MCP server (24 tools on main) and the Elasticsearch REST API. The default embedding mode is lexical, not neural.

## Agent prompt

```text
Act as a coding agent. Read https://xerj.org/llms.txt, start a node with `xerj --insecure --data-dir ./.xerj-data`, run `xerj autoindex ./docs --url http://127.0.0.1:9200 --prefix docs --progress plain` on the folder you were handed, then answer with `xerj search` or one MCP tool and cite ax_path for every hit.
```

## Commands

### Command 1

Note: Install the release binary into ~/.local/bin.

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

### Command 2

Note: Start a local development node. Put the data dir outside the folder you will index.

```sh
xerj --insecure --data-dir ./.xerj-data
```

### Command 3

Note: Index a local folder with no schema file.

```sh
xerj autoindex ./docs --url http://127.0.0.1:9200 --prefix docs --progress plain
```

### Command 4

Note: Ranked passages with file:line, from the local index.

```sh
xerj search "how is pagination implemented"
```

*Figure: Tool counts are from the published MCP tool list on main. Conformance 1444 of 1454 is from README.md, dated 2026-10-23 on the Elasticsearch comparison.*

## What "local" means here

A local AI search engine runs on hardware you control. You point it at a folder. It builds an index. An agent, or you, then asks questions and gets passages with file:line or another cited path. The source files are not uploaded as part of that loop.

XERJ is one Apache-2.0 Rust binary for this job. The positioning is a new way for AI to search for data. The longer product identity page is [What is XERJ?](/answers/what-is-xerj).

## Four surfaces, one index

The same index is reachable as:

- a CLI, with `xerj search` and `xerj def`
- an MCP server, through `xerj mcp`
- the Elasticsearch REST API, with `POST /_search`
- namespaced agent memory at `/_memory/{namespace}`

The protocol is [What is the Model Context Protocol?](/science/model-context-protocol). Memory is [What is agentic memory?](/science/agentic-memory). Ranking is [What is hybrid search?](/science/hybrid-search) and [What is semantic search?](/science/semantic-search).

## What this is not

This is not a hosted index of your private files. It is also not a cluster. XERJ is single-node only. If you need a cluster or a broader Elasticsearch API, see [Elasticsearch alternatives](/compare/elasticsearch-alternatives).

Local RAG, where a model writes from retrieved hits, is a use of this engine, not a second product. That walkthrough is [What is local RAG?](/answers/local-rag).

## Start it

Put the data dir outside the folder you will index.

```sh
curl -fsSL https://xerj.org/get | sh
xerj --insecure --data-dir ./.xerj-data
xerj autoindex ./docs --url http://127.0.0.1:9200 --prefix docs --progress plain
xerj search "how is pagination implemented"
```

## Read next

[Hybrid search](/science/hybrid-search), [BM25](/science/bm25), [grounded answers](/science/grounded-answers) and [semantic code search](/answers/semantic-code-search).

## FAQ

### What is a local AI search engine?

It is a search engine that runs on your machine, indexes your files, and returns cited hits an agent can use. The corpus stays local. XERJ is one Apache-2.0 binary built for that job.

### How does an agent talk to it?

Through the CLI, through an MCP server, or over the Elasticsearch REST API. On main, xerj mcp registers 24 tools, or 21 with no Corpus Hub key.

### Does it need a vector database?

XERJ does not. The embedder ships in the binary. The default embedding mode is lexical, not neural. Start the node with --embed-mode neural when you want the built-in neural embedder.

### How is this different from Elasticsearch?

XERJ speaks the Elasticsearch REST API as a transport and passes 1444 of 1454 YAML cases on every commit. It is a single-node search engine for AI agents, not a cluster.

### Can it also keep agent memory?

Yes. The same process serves namespaced memory at /_memory/{namespace}. See What is agentic memory? for the concept.

## Evidence

- On main, xerj mcp registers 24 MCP tools, or 21 when the binary has no Corpus Hub key. — `landing/docs/agents/schemas/mcp-tools.json`
- XERJ's conformance suite runs on every commit and passes 1444 of 1454 cases. — `README.md`

## Related

- [What is hybrid search?](/science/hybrid-search)
- [What is semantic search?](/science/semantic-search)
- [What is the Model Context Protocol?](/science/model-context-protocol)
- [What is agentic memory?](/science/agentic-memory)
- [What is XERJ?](/answers/what-is-xerj)
- [What is local RAG?](/answers/local-rag)
- [Elasticsearch alternatives, with published tests](/compare/elasticsearch-alternatives)
- [What's a local MCP search engine for Claude?](/compare/xerj-vs-localsynapse) (same intent: Find the right tool)
- [Can ChatGPT search a folder on my laptop, or do I need something else?](/answers/give-chatgpt-claude-local-file-access) (same intent: Find the right tool)
- [How do I let an agent search a folder on my laptop instead of crawling the web?](/compare/xerj-vs-web-agent-search) (same intent: Find the right tool)
