AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.
Rust agent-memoryai-agentsbm25claude-codeclicode-searchcursordatabaseelasticsearchfull-text-searchhybrid-searchjsonllocal-firstmcpmcp-servermodel-context-protocolragrustsearch-enginevector-search
docs+site: coding-first agent CTA and a public reference-coding loop in llms.txt
xerj-orgb9719e95d0fc
diff --git a/README.md b/README.mdindex 0e5925adb..729f6fbf7 100644--- a/README.md+++ b/README.md@@ -29,12 +29,15 @@ your PATH if needed): `xerj --insecure --data-dir ./data &`, wait until### Or paste this to your AI agent```text-Install XERJ (docs: https://xerj.org/llms.txt) and make this folder searchable.+Install XERJ (docs: https://xerj.org/llms.txt), index this project's sources, and set up+reference coding: clone and index the open-source repos closest to what we're building,+and search how they solved a problem before writing code.```-One line is enough — [llms.txt](https://xerj.org/llms.txt) gives your agent the-ordered steps (install, start the server, `xerj autoindex .`, query with any-Elasticsearch client).+One prompt is enough — [llms.txt](https://xerj.org/llms.txt) gives your agent the+ordered steps: install, start the server, `xerj autoindex .`, query with any+Elasticsearch client, and the reference-coding loop (clone similar OSS, index it,+retrieve the mechanism before writing, cite what you use, respect licenses).More prompts that work on a fresh install:diff --git a/landing/index.html b/landing/index.htmlindex 0f09d7ac2..63a260db7 100644--- a/landing/index.html+++ b/landing/index.html@@ -63,12 +63,12 @@<div class="hero-install-agent"><span class="hero-install-label">OR PASTE THIS TO YOUR AI AGENT</span><div class="hero-install-cmd">- <code>Install XERJ (docs: https://xerj.org/llms.txt) and make this folder searchable.</code>- <button type="button" class="hero-install-copy" data-copy="Install XERJ (docs: https://xerj.org/llms.txt) and make this folder searchable.">COPY</button>+ <code>Install XERJ (docs: https://xerj.org/llms.txt), index this project's sources, and set up reference coding: clone and index the open-source repos closest to what we're building, and search how they solved a problem before writing code.</code>+ <button type="button" class="hero-install-copy" data-copy="Install XERJ (docs: https://xerj.org/llms.txt), index this project's sources, and set up reference coding: clone and index the open-source repos closest to what we're building, and search how they solved a problem before writing code.">COPY</button></div>- <p class="hero-install-agent-line">One line is enough — llms.txt gives your agent+ <p class="hero-install-agent-line">One prompt is enough — llms.txt gives your agentthe ordered steps: install, start the server, <code>xerj autoindex .</code>,- query with any Elasticsearch client.</p>+ query with any Elasticsearch client, and the reference-coding loop.</p></div></div>diff --git a/landing/llms.txt b/landing/llms.txtindex a96eec6cd..1e90d90b8 100644--- a/landing/llms.txt+++ b/landing/llms.txt@@ -136,6 +136,17 @@ Web hub: [xerj.org/case-studies.html](https://xerj.org/case-studies.html). Each- [Migrate from Elasticsearch](https://xerj.org/docs/recipes/migrate-from-elasticsearch.html): move an ES workload onto XERJ.- [Index a folder of mixed-format docs](https://xerj.org/docs/recipes/document-folder-index.html): walk a recursive folder of PDF/DOCX/HTML/MD/TXT → extract + chunk + auto-embed → lexical/semantic/hybrid search returns ranked, cited passages (measured 21/22 answered vs a fair grep baseline's 14/22; the decisive win is binary_only 6/7 vs 0/7 — grep is structurally blind to binary PDF/DOCX; the differently-phrased set is an honest tie because the built-in embedder is lexical, not neural).+## Reference coding (index the code that already solved your problem)++XERJ turns reference coding — retrieving how existing projects solved a problem before writing your own — into a local loop any agent can run:++1. Index the project you are working on: `xerj autoindex .`+2. Find the open-source projects closest to what you are building (same domain, not necessarily the same language), `git clone --depth 1` each, and `xerj autoindex <clone>`.+3. Before writing non-trivial code, search those indices for the mechanism ("how does the merge policy pick segments", not just the API name) and read the returned passages instead of re-deriving the algorithm. The strongest trigger to retrieve: you have already looped twice on the same error.+4. Cite what you drew on (project + file:line) in your commit message, and say plainly whether you adapted or copied.++License discipline is part of the method, not an afterthought: check each repository's license BEFORE copying anything. Copyleft and source-available code (GPL, AGPL, SSPL, BUSL) is approach-only — read the design, then write your own implementation. Permissive licenses (MIT, BSD, Apache-2.0) allow adaptation with attribution on their terms. And when retrieval returns nothing relevant, say so and work normally — forcing a bad match in is worse than not retrieving. Expect retrieval to pay off most on unfamiliar, niche, or internal code, and least on popular public libraries your model already knows well.+## How to contribute (this protocol is addressed to you, the agent)Most agents that read this project are not working on it — they are working in someone else's codebase, hit a XERJ defect, patch around it locally, and move on, so the fix is lost. XERJ's contribution protocol is written for that reader. The decision rule has three outcomes: