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.
AGENT_FTX_HARNESS — the first-time-agent, zero-experience E2E
What this is. The replayable harness that answers one question: can an
agent (or a person) with no prior XERJ experience, following only what
the product itself prints and the public llms.txt, go from nothing to —
- one CLI to get results (install → node → autoindex → query),
- see them (console + data map: volume, structure, relations),
- connect AI (
xerj init/ MCP, verified by driving the MCP server), - measure XERJ's impact on the AI in tokens and values (counted usage
from
xerj gain+ a same-question token A/B),
— without any undocumented step? Every place the naive path stalls is a defect to file, not a footnote to coach around.
Referenced by docs/research/llms-txt-2026-09/README.md §11. First landed
2026-10-01 after the rc.80 reference run (results below). Run it before AND
after any rewrite of the agent-facing surface.
Ground rules
- Fresh state every run: new data dir, new project dir, no
~/.xerj*, noXERJ_URL/XERJ_API_KEYin the environment, emptyPATHadditions. Install via the public installer (curl -fsSL https://xerj.org/get | sh), optionally pinningXERJ_VERSIONto the release under test. - Knowledge budget = the product's own output +
https://xerj.org/llms.txt- the installer page. No repo-internal knowledge (no README in the repo, no docs/). If a step cannot be completed from those sources alone, that is a finding.
- Record verbatim: every command, its exit code, and the output the novice actually saw. The transcript is the artifact.
- Do not coach. If the naive command fails, the harness does not retry with a smarter flag — it records the stall and, only then, consults the documented path.
Personas
| Persona | Surface | Phases |
|---|---|---|
| P1 shell novice | CLI only, follows printed hints | 1–4 |
| P2 MCP-only | no shell; operator ran xerj init; only the 13 MCP tools |
3–4 (search/map/plan; assert autoindex and gain are documented CLI-only) |
| P3 HTTP-only | curl only: console API, ES-compat _search, _ask |
2–4 (same CLI-only assertions) |
Phase 1 — one CLI to get results (P1)
curl -fsSL https://xerj.org/get | sh # or XERJ_VERSION pinned
export PATH="$HOME/.local/bin:$PATH" # the installer prints this hint
xerj --insecure --data-dir ~/xerj-data & # per llms.txt "First run"
xerj autoindex "$CORPUS" # CORPUS = a real mixed folder
xerj search "<plain question about the corpus>"
xerj def "<a symbol that exists in the corpus>"
Assertions:
- A1 install verifies checksum and prints the PATH consequence.
- A2 the node banner names the console URL.
- A3
autoindexwith no node running produces an error that names the fix (open: #1102 — currently onlyendpoint unreachable ... Connection refused). - A4
autoindexcloses with anext:hint that pastes and works (open: #1103 — the hint exists on the graph path but not on--no-graph, which is exactly the recovery path the journal guard recommends). - A5
xerj search/defwork with zero flags against the node the novice started. Against an auth-enabled node the failure must print numbered fixes (rc.80: it does, including the admin.key path). - A6 zero-hit and no-node cases cross-sell the recovery command (rc.80: the
lexical_on_semantic_texthint fires on a paraphrase-shaped zero-hit with a pasteablesemantic/hybridrequest — pass).
Phase 2 — see them (P1/P3)
- P1:
xerj autoindex map— datasets table, per-field types/examples, ready-to-send queries. - P3:
GET /_xerj-console/(SPA) andGET /_xerj-console/api/v1/knowledge— totals, per-dataset fields, inferred relations, capability strip (#1095's knowledge surface). - P3:
POST /autoindex-catalog/_searchanswers over plain HTTP, and_sourceprojections report their own_savingsblock. - Assert: counts (records/files) match
xerj autoindex status; relations shown are labelled as inferred; nothing claims vectors when the node is lexical (the default). Known rough edge:POST /{index}/_askis a bare 404 (no guidance) — rootPOST /_askexists and refuses unknown phrases honestly.
Phase 3 — connect AI (P1 sets up, P2 verifies)
- P1:
xerj initin a project dir →.mcp.json(binary path +xerj mcp),.claude/skills/xerj/SKILL.mdand.claude/skills/xerj-hub/SKILL.md,.cursor/rules/xerj.mdcand.cursor/rules/xerj-hub.mdcwhen the dirs exist,AGENTS.mdappend..bakfor anything edited. No secrets written. It ends by printing the MCP registration for the clients.mcp.jsondoes not cover (claude mcp add,mcpServers, VS Code'sservers). - P2: drive
xerj mcpover stdio JSON-RPC —tools/list(13 tools),xerj_search,xerj_map,xerj_plan— with a scripted client:printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{...}}' \ '{"jsonrpc":"2.0","method":"notifications/initialized"}' \ '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \ '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"xerj_search","arguments":{"query":"..."}}}' \ | xerj mcp - Assert: every tool answers on the FIRST session (MCP
max_tokensgate), and the CLI-only boundary (autoindex, gain, init) is whatllms.txtsays. rc.80: MCPxerj_searchreturns the same top-3 as the CLI for the same question, and the response carries the same honest hints. - Hub (Corpus Hub v2, plan section 9; run it on a build whose
tools/listnamesxerj_hub_ask): P2 asks one public-material question throughxerj_hub_askand reaches the answer in ONE tool call — nocorpus add, nocorpus index, no shell. Assert the result is the three lines the llms.txt section prints (corpus, pin date and licence on the first line; the passage;answered from:). P1 does the same withxerj "<question>".
Phase 4 — measure impact on the AI, in tokens and values
- Values (counted):
xerj gain— searches served, hit rate, p50/p95, busiest indices, straight from the node's audit log. No estimates: the module doc refuses counterfactuals by design. Two open traps: the audit API is on the native listener (default 8080, not port+1 — #1104), and autoindex's internal count-polls are audited as user searches, so the hit rate reads ~3% after a flawless onboarding (#1105). - Tokens (A/B, same questions): for each of N fixed questions over the
same corpus, count the context an AI would need to answer:
- arm A "read the tree": the whole files behind the hits — report BOTH the all-hits variant and the conservative top-1-file variant;
- arm B "XERJ": the wire response of the exact request the shipped CLI
builds (defs-first bool + projected
_source+fields:["_passage"],xerj-autoindex/src/search.rs:140-155), minus the_xerjhints block (its size is reported separately). Report bytes and tokens with the conversion stated (wire-bytes model indocs/TOKEN_USAGE.md, 4 B/token). Both arms from recorded transcripts of commands actually run — measured, never asserted.
- Assert:
xerj gain's search count matches the transcript's query count (fails today per #1105 — the count is inflated by internal polls).
Reference run — v1.0.0-rc.80 (2026-10-01, 32-core sandbox)
Corpus: 90 files / 4.3 MB (a Rust source tree + 2 PDFs + 1 JSONL); autoindex wall 7.7–8.1 s, 2 datasets, 3,796 records.
| Phase | Result |
|---|---|
| 1 install/search/def | pass (A1, A2, A5, A6); A3 → #1102, A4 → #1103 |
| 2 map + console + catalog | pass; index-scoped _ask bare 404 (noted above) |
| 3 init + MCP (13 tools) | pass — same top-3 as CLI, honest hints on MCP too |
| 4 gain | blocked naively (#1104); with the port worked around, values polluted (#1105) |
| 4 token A/B (5 questions) | arm A all-hits 3,705,970 B (926,492 tok) vs arm B 24,267 B (6,066 tok) → 152.7×; conservative top-1-file arm 829,553 B (207,388 tok) → 34.2× (97.1% less) |
Re-run before and after any change to the agent-facing surface; the verdict is publishable only with the losses left in (house rule).