Skip to content

armgit / xerj

Public Imported from GitHub
0

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.

61.8 KB
Raw Blame
<!DOCTYPE html>
<html lang="en" data-theme="day">
<head>
<!-- ga4:begin — generated by scripts/seo/seo_head.py · do not hand-edit -->
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z77ETCDJYL"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-Z77ETCDJYL');
</script>
<!-- ga4:end -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>XERJ.ai · Docs · Config TOML</title>
<meta name="description" content="The complete xerj.toml surface: every section, key and production-ready default, with runnable examples and the config-file precedence order.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@400;700;800;900&family=Inter:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' fill='%230b0b0d'/><text x='50' y='68' font-size='60' font-family='Big Shoulders Display,sans-serif' font-weight='900' fill='%23ffc400' text-anchor='middle'>X</text></svg>">
<script src="/theme.js"></script>
<link rel="stylesheet" href="/style.css?v=90f643e">
<!-- seo:begin — generated by scripts/seo/fix_heads.py · do not hand-edit -->
<link rel="canonical" href="https://xerj.org/docs/config">
<meta property="og:site_name" content="XERJ.ai">
<meta property="og:type" content="article">
<meta property="og:title" content="XERJ.ai · Docs · Config TOML">
<meta property="og:description" content="The complete xerj.toml surface: every section, key and production-ready default, with runnable examples and the config-file precedence order.">
<meta property="og:url" content="https://xerj.org/docs/config">
<meta property="og:image" content="https://xerj.org/og/xerj-card.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="XERJ.ai — the search engine built for AI agents">
<meta property="og:locale" content="en_US">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="XERJ.ai · Docs · Config TOML">
<meta name="twitter:description" content="The complete xerj.toml surface: every section, key and production-ready default, with runnable examples and the config-file precedence order.">
<meta name="twitter:image" content="https://xerj.org/og/xerj-card.png">
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "@id": "https://xerj.org/#organization",
  "name": "XERJ",
  "alternateName": "XERJ.ai",
  "url": "https://xerj.org/",
  "logo": "https://xerj.org/brandbook/xerj-mark.svg",
  "description": "A new way for AI to search for data: one local Rust binary that indexes your code, docs, specs and logs, plus Corpus Hub packs, and returns cited answers.",
  "sameAs": [
    "https://github.com/xerj-org/xerj",
    "https://x.com/xerj_org"
  ]
}
</script>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "@id": "https://xerj.org/#website",
  "name": "XERJ.ai",
  "url": "https://xerj.org/",
  "inLanguage": "en",
  "publisher": {
    "@id": "https://xerj.org/#organization"
  }
}
</script>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "TechArticle",
  "headline": "XERJ.ai · Docs · Config TOML",
  "description": "The complete xerj.toml surface: every section, key and production-ready default, with runnable examples and the config-file precedence order.",
  "url": "https://xerj.org/docs/config",
  "image": "https://xerj.org/og/xerj-card.png",
  "inLanguage": "en",
  "datePublished": "2026-06-29",
  "dateModified": "2026-09-19",
  "author": {
    "@id": "https://xerj.org/#organization"
  },
  "publisher": {
    "@id": "https://xerj.org/#organization"
  },
  "isPartOf": {
    "@id": "https://xerj.org/#website"
  },
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://xerj.org/docs/config"
  }
}
</script>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "Home",
      "item": "https://xerj.org/"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "Docs",
      "item": "https://xerj.org/docs/"
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": "Config TOML"
    }
  ]
}
</script>
<!-- seo:end -->
</head>
<body>


<nav class="nav" aria-label="Primary">
  <a href="/" class="brand">XERJ</a>
  <a href="/product">PRODUCT</a>
  <a href="/use-cases">USE CASES</a>
  <a href="/answers/">ANSWERS</a>
  <a href="/benchmarks/">BENCHMARKS</a>
  <a href="/blog/">BLOG</a>
  <span class="spacer"></span>
  <a href="/for-agents">FOR AGENTS</a>
  <a href="/docs/" class="active">DOCS</a>
  <a href="/playground">DASHBOARDS</a>
  <a href="https://hub.xerj.org" rel="external">HUB</a>
  <a class="nav-stars" href="https://github.com/xerj-org/xerj" rel="external" title="XERJ on GitHub" aria-label="XERJ on GitHub, 14,225 stars"><svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg><span class="nav-stars-n" data-gh-stars="14225">★ 14.2k</span></a>
  <a href="https://x.com/xerj_org" rel="external" title="XERJ on X" style="display:inline-flex;align-items:center"><svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg></a>
  <a href="https://discord.com/invite/yetXFusXfs" rel="external" title="XERJ on Discord" style="display:inline-flex;align-items:center"><svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M20.317 4.37a19.79 19.79 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.74 19.74 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 00.031.057 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 00-.041-.106 13.1 13.1 0 01-1.872-.892.077.077 0 01-.008-.128 10.2 10.2 0 00.372-.292.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.01c.12.098.246.198.373.292a.077.077 0 01-.006.127 12.3 12.3 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.84 19.84 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"/></svg></a>
  <span class="theme">
    <button type="button" data-theme="day" class="active">DAY</button>
    <span class="dash">·</span>
    <button type="button" data-theme="night">NIGHT</button>
  </span>
</nav>

<div class="docs-search" id="docsSearch">
  <input type="text" id="docsSearchInput" placeholder="Search docs · keys, flags, endpoints, playbooks…" aria-label="Search docs" autocomplete="off" spellcheck="false">
  <span class="hint">⌘ K</span>
  <div class="results" id="docsSearchResults" aria-live="polite"></div>
</div>

<div class="docs-shell">
<nav class="docs-nav" aria-label="Docs">  <div class="group">
    <span class="label">START</span>
    <a href="/docs/" class=""><span class="eyebrow">01</span>Overview</a>
      <a href="/docs/quickstart" class=""><span class="eyebrow">02</span>Quickstart</a>
      <a href="/docs/install" class=""><span class="eyebrow">03</span>Install</a>
      <a href="/docs/migration-from-es" class=""><span class="eyebrow">04</span>Migrate from ES</a>
  </div>
  <div class="group">
    <span class="label">REFERENCE</span>
    <a href="/docs/cli" class=""><span class="eyebrow">01</span>CLI</a>
      <a href="/docs/config" class="active"><span class="eyebrow">02</span>Config TOML</a>
      <a href="/docs/env" class=""><span class="eyebrow">03</span>Environment</a>
      <a href="/docs/api-native" class=""><span class="eyebrow">04</span>Native REST API</a>
      <a href="/docs/api-es-compat" class=""><span class="eyebrow">05</span>ES-compat API</a>
  </div>
  <div class="group">
    <span class="label">DATA MODEL</span>
    <a href="/docs/queries" class=""><span class="eyebrow">01</span>Query types</a>
      <a href="/docs/aggregations" class=""><span class="eyebrow">02</span>Aggregations</a>
      <a href="/docs/analyzers" class=""><span class="eyebrow">03</span>Analyzers</a>
      <a href="/docs/vectors" class=""><span class="eyebrow">04</span>Vectors & kNN</a>
  </div>
  <div class="group">
    <span class="label">ENGINE</span>
    <a href="/docs/ingest" class=""><span class="eyebrow">01</span>Ingest pipelines</a>
      <a href="/docs/storage" class=""><span class="eyebrow">02</span>Storage & WAL</a>
      <a href="/docs/compression" class=""><span class="eyebrow">03</span>Compression</a>
      <a href="/docs/clustering" class=""><span class="eyebrow">04</span>Clustering</a>
      <a href="/docs/metrics" class=""><span class="eyebrow">05</span>Metrics</a>
      <a href="/docs/security" class=""><span class="eyebrow">06</span>Auth & TLS</a>
  </div>
  <div class="group">
    <span class="label">OPERATIONS</span>
    <a href="/docs/operations" class=""><span class="eyebrow">01</span>Running in production</a>
      <a href="/docs/backup-restore" class=""><span class="eyebrow">02</span>Backup & restore</a>
      <a href="/docs/upgrades" class=""><span class="eyebrow">03</span>Upgrades</a>
      <a href="/docs/troubleshooting" class=""><span class="eyebrow">04</span>Troubleshooting</a>
  </div>
  <div class="group">
    <span class="label">PLAYBOOKS</span>
    <a href="/docs/playbooks/siem" class=""><span class="eyebrow">01</span>SIEM</a>
      <a href="/docs/playbooks/log-analytics" class=""><span class="eyebrow">02</span>Log analytics</a>
      <a href="/docs/playbooks/vector-search" class=""><span class="eyebrow">03</span>Vector · RAG</a>
      <a href="/docs/playbooks/full-text" class=""><span class="eyebrow">04</span>Full-text search</a>
      <a href="/docs/playbooks/observability" class=""><span class="eyebrow">05</span>Observability</a>
  </div>
  <div class="group">
    <span class="label">RECIPES</span>
    <a href="/docs/recipes/" class=""><span class="eyebrow">00</span>All recipes</a>
    <a href="/docs/recipes/semantic-search-rag" class=""><span class="eyebrow">01</span>Semantic search &amp; RAG</a>
    <a href="/docs/recipes/agentic-memory" class=""><span class="eyebrow">02</span>Agent memory</a>
    <a href="/docs/recipes/passage-retrieval" class=""><span class="eyebrow">03</span>Passage retrieval</a>
    <a href="/docs/recipes/vector-search-knn" class=""><span class="eyebrow">04</span>Vector search &middot; kNN</a>
    <a href="/docs/recipes/vector-quantization" class=""><span class="eyebrow">05</span>Vector quantization</a>
    <a href="/docs/recipes/hybrid-search" class=""><span class="eyebrow">06</span>Hybrid search</a>
    <a href="/docs/recipes/log-analytics" class=""><span class="eyebrow">07</span>Log analytics</a>
    <a href="/docs/recipes/anomaly-detection" class=""><span class="eyebrow">08</span>Anomaly detection</a>
    <a href="/docs/recipes/continuous-anomaly-datafeeds" class=""><span class="eyebrow">09</span>Anomaly datafeeds</a>
    <a href="/docs/recipes/migrate-from-elasticsearch" class=""><span class="eyebrow">10</span>Migrate from ES</a>
  </div>
  <div class="group">
    <span class="label">CORPUS HUB</span>
    <a href="/docs/corpus-hub" class=""><span class="eyebrow">01</span>Ask, pull &amp; contribute</a>
  </div>
</nav>

<main class="docs-content">
  <!-- Print-only branded header (hidden on screen, visible in PDF) -->
  <div class="print-header" style="display:none;">XERJ</div>

  <div class="breadcrumb"><a href="/docs/">DOCS</a><span class="sep">·</span>REFERENCE<span class="sep">·</span>CONFIG
    <button class="pdf-btn" onclick="window.print()" title="Save this page as PDF">
      <svg viewBox="0 0 24 24"><path d="M12 3v12M12 15l-4-4M12 15l4-4"/><path d="M4 17v2a2 2 0 002 2h12a2 2 0 002-2v-2"/></svg>
      PDF
    </button>
  </div>
  <div class="kicker"><span>02 · REFERENCE</span></div>
  <h1>Config TOML</h1>


  <p>XERJ reads one TOML file. Every key has a production-ready default, so the smallest working config is an empty file. The table below is the full surface; the sections below it walk each group with a runnable example.</p>

  <p>The config file is read from <code class="inline">--config /path/to/xerj.toml</code> on the command line, else from the path in <code class="inline">XERJ_CONFIG</code>. Nothing else is searched: with neither set, the built-in defaults are used even when <code class="inline">./xerj.toml</code> or <code class="inline">/etc/xerj/xerj.toml</code> exists.</p>

  <h2>Full key table</h2>
  <div class="cfg"><div class="head">KEY</div><div class="head">TYPE</div><div class="head">DEFAULT</div><div class="head">DESCRIPTION</div><div class="group" id="server">[server]</div><div class="cell k">rest_port</div><div class="cell t">u16</div><div class="cell d">8080</div><div class="cell dsc">Native REST API listener port. All native endpoints (/v1/*) live here.</div><div class="cell k">grpc_port</div><div class="cell t">u16</div><div class="cell d">8081</div><div class="cell dsc">gRPC API (<code class="inline">xerj.v1.XerjSearch</code>, the same engine calls as REST, same authorization). Cleartext h2c even when <code class="inline">[tls]</code> is on: off loopback with TLS enabled the node refuses to start unless <code class="inline">tls.allow_insecure_grpc_h2c = true</code>.</div><div class="cell k">es_compat_port</div><div class="cell t">u16</div><div class="cell d">9200</div><div class="cell dsc">Elasticsearch-compatible wire port. Point Kibana, Logstash, or the ES client here. 0 binds an OS-assigned port (logged at startup); it does not disable the listener.</div><div class="cell k">bind_address</div><div class="cell t">string</div><div class="cell d">"127.0.0.1"</div><div class="cell dsc">Interface to bind every listener to. Loopback by default, so an unconfigured node is unreachable from the network. Set "0.0.0.0" or a private address to expose it (also --bind / XERJ_BIND_ADDRESS). Must be an IPv4 or IPv6 literal — host names are not resolved, and a node given one refuses to start.</div><div class="cell k">allow_insecure_network_bind</div><div class="cell t">bool</div><div class="cell d">false</div><div class="cell dsc">Permit a non-loopback bind_address while tls.enabled = false. Startup refuses that combination otherwise: every listener would serve plain HTTP, so the API key in every Authorization header crosses the network in cleartext. Set true only when a proxy, sidecar, mesh or container boundary terminates TLS in front of the node. Env: XERJ_ALLOW_INSECURE_NETWORK_BIND.</div><div class="cell k">data_dir</div><div class="cell t">path</div><div class="cell d">"./data"</div><div class="cell dsc">Root for indices, WAL files, and segments. Needs fast I/O and enough free space.</div><div class="group" id="auth">[auth]</div><div class="cell k">enabled</div><div class="cell t">bool</div><div class="cell d">true</div><div class="cell dsc">Require an API key on every request. Set to false only on a trusted network.</div><div class="cell k">admin_api_key</div><div class="cell t">string</div><div class="cell d">""</div><div class="cell dsc">Static admin key. Left empty, a 256-bit key is generated on first run and written to &lt;data_dir&gt;/admin.key.</div><div class="group" id="tls">[tls]</div><div class="cell k">enabled</div><div class="cell t">bool</div><div class="cell d">false</div><div class="cell dsc">Terminate TLS at the server. Requires cert_path + key_path. If you terminate at a proxy, leave false.</div><div class="cell k">cert_path</div><div class="cell t">path</div><div class="cell d">""</div><div class="cell dsc">PEM X.509 certificate. Use a CA-signed cert in production.</div><div class="cell k">key_path</div><div class="cell t">path</div><div class="cell d">""</div><div class="cell dsc">PEM private key. Permissions should be 0600.</div><div class="group" id="storage">[storage]</div><div class="cell k">wal_sync</div><div class="cell t">enum</div><div class="cell d">"batched"</div><div class="cell dsc">"sync" · "batched" · "async". Durability vs throughput. Batched is the recommended default.</div><div class="cell k">wal_batch_ms</div><div class="cell t">u32</div><div class="cell d">100</div><div class="cell dsc">Fsync cadence when wal_sync="batched" (ms). Range 1–10000. Lower = smaller loss window.</div><div class="cell k">wal_max_size_mb</div><div class="cell t">u32</div><div class="cell d">1024</div><div class="cell dsc">WAL rollover threshold (MiB). Larger means fewer rollovers, longer crash recovery.</div><div class="cell k">flush_size_mb</div><div class="cell t">u32</div><div class="cell d">512</div><div class="cell dsc">Memtable buffer size that triggers a segment flush (MiB).</div><div class="cell k">flush_interval_secs</div><div class="cell t">u32</div><div class="cell d">30</div><div class="cell dsc">Maximum wall-clock interval between flushes even if the buffer is not full.</div><div class="group" id="merge">[merge]</div><div class="cell k">strategy</div><div class="cell t">enum</div><div class="cell d">"size_tiered"</div><div class="cell dsc">Only "size_tiered" is implemented; "log_structured" is refused at startup rather than silently running the other policy.</div><div class="cell k">min_segments</div><div class="cell t">u32</div><div class="cell d">10</div><div class="cell dsc">Accepted and validated (must be ≥ 2) but <strong>not wired</strong>: the merge trigger is per-tier and comes from min_merge_count. Setting it away from the default logs a warning at startup.</div><div class="cell k">max_segment_mb</div><div class="cell t">u32</div><div class="cell d">8192</div><div class="cell dsc">Upper bound on a mergeable segment (MiB). Segments at or above this size are never merged again.</div><div class="cell k">io_rate_mb_per_sec</div><div class="cell t">u32</div><div class="cell d">100</div><div class="cell dsc">Accepted but <strong>not wired</strong>: merge I/O is not throttled in this build — the rate limiter that honours it sits in an unused storage-crate merge executor. Setting it away from the default logs a warning at startup.</div><div class="cell k">max_concurrent</div><div class="cell t">u8</div><div class="cell d">1</div><div class="cell dsc">Accepted but <strong>not wired</strong>: merge parallelism comes from the XERJ_MERGE_PARALLELISM environment variable, which also defaults to 1. Setting it away from the default logs a warning at startup.</div><div class="group" id="compression">[compression]</div><div class="cell k">enabled</div><div class="cell t">bool</div><div class="cell d">true</div><div class="cell dsc">Accepted but <strong>not wired</strong>: every durable artifact is a compressed envelope with no uncompressed write path, so false changes nothing on disk. Setting it away from the default logs a warning at startup.</div><div class="cell k">level</div><div class="cell t">enum</div><div class="cell d">"balanced"</div><div class="cell dsc">"fast" (Zstd L1), "balanced" (Zstd L3, default), "best" (Zstd L6, cold storage). Applied when segments are re-encoded <strong>at merge</strong>; flush always writes L3, because raising the flush level collapses sustained ingest. Force-merge to apply a change to data already on disk.</div><div class="cell k">block_size_docs</div><div class="cell t">u32</div><div class="cell d">128</div><div class="cell dsc">Accepted but <strong>not wired</strong>: the stored codec is columnar over the whole segment section, not blocked by document count. Range 16–4096 is enforced at startup, and a non-default value logs a warning.</div><div class="group" id="fts">[fts]</div><div class="cell k">default_analyzer</div><div class="cell t">enum</div><div class="cell d">"standard"</div><div class="cell dsc">"standard" · "whitespace" · "simple" · "english". Override per-field in the mapping. <strong>Not wired</strong>: nothing reads this key — a text field uses its own analyzer, else the index's <code class="inline">analysis.analyzer.default</code>, else standard. Setting it away from the default logs a warning at startup.</div><div class="group" id="vector">[vector]</div><div class="cell k">default_metric</div><div class="cell t">enum</div><div class="cell d">"cosine"</div><div class="cell dsc">"cosine" · "dot_product" · "euclidean". Cosine for text embeddings is the usual choice. <strong>Not wired</strong>: similarity comes from the field mapping, and a mapping without one gets cosine whatever this says. Setting it away from the default logs a warning at startup.</div><div class="cell k">hnsw_m</div><div class="cell t">u32</div><div class="cell d">16</div><div class="cell dsc">Accepted and validated; the built-in HNSW graph currently builds with fixed M=16 — this key is not yet wired to the build.</div><div class="cell k">hnsw_ef_construction</div><div class="cell t">u32</div><div class="cell d">200</div><div class="cell dsc">Accepted; must be ≥ hnsw_m. The graph currently builds with fixed ef_construction=200 — this key is not yet wired to the build.</div><div class="cell k">hnsw_ef_search</div><div class="cell t">u32</div><div class="cell d">100</div><div class="cell dsc">Accepted but not read by the serving path — the ANN beam width comes from the request's num_candidates (floored at 800).</div><div class="cell k">default_quantization</div><div class="cell t">enum</div><div class="cell d">"none"</div><div class="cell dsc">"none" (the default) or "scalar8" = kNN scored from 1-byte-per-dimension codes, 1–2% recall loss. scalar8 buys precision, <strong>not</strong> RAM: the scan reads the full-precision vector from <code class="inline">_source</code> and quantizes it per query, so resident memory is unchanged and the field also gives up HNSW-served kNN (<a href="https://github.com/xerj-org/xerj/issues/392">#392</a>). "binary" has no quantizer behind it and is refused at startup rather than silently stored at full precision; "scalar4" is not a value this key accepts at all (the 4-bit quantizer in the vector crate is unreachable from config or mapping). <strong>Not wired as a node-wide default</strong>: only the "binary" refusal reads it; quantization comes from each field's <code class="inline">index_options</code> in the mapping. Setting it away from the default logs a warning at startup.</div><div class="cell k">max_dimensions</div><div class="cell t">u32</div><div class="cell d">16384</div><div class="cell dsc">Upper bound on vector dimensionality. 4× the Elasticsearch limit of 4096. <strong>Not wired</strong>: validated (≥ 1), but no mapping or document is checked against it. Setting it away from the default logs a warning at startup.</div><div class="group" id="logs">[logs]</div><div class="cell k">retention_days</div><div class="cell t">u32</div><div class="cell d">90</div><div class="cell dsc">Accepted but <strong>not wired</strong>: no retention job runs and nothing deletes log data in this build — delete old indices or documents yourself. Setting it away from the default logs a warning at startup.</div><div class="cell k">time_partition</div><div class="cell t">enum</div><div class="cell d">"1h"</div><div class="cell dsc">"1m" · "5m" · "15m" · "1h" · "6h" · "1d". Time-slice granularity for retention pruning. <strong>Not wired</strong>: log indices are not partitioned by time. Setting it away from the default logs a warning at startup.</div><div class="group" id="embedding">[embedding]</div><div class="cell k">default_endpoint</div><div class="cell t">string</div><div class="cell d">""</div><div class="cell dsc">OpenAI-compatible embeddings URL. Empty disables auto-embedding on ingest. Example: "https://api.openai.com/v1/embeddings".</div><div class="cell k">default_model</div><div class="cell t">string</div><div class="cell d">""</div><div class="cell dsc">Model name passed to the endpoint. Example: "text-embedding-3-small" or "nomic-embed-text".</div><div class="cell k">batch_size</div><div class="cell t">u32</div><div class="cell d">64</div><div class="cell dsc">Docs per embedding API call. Range 1–2048. Bigger batches amortise round-trip cost.</div><div class="cell k">timeout_ms</div><div class="cell t">u32</div><div class="cell d">5000</div><div class="cell dsc">HTTP timeout for each embedding request attempt (ms, at least 1). A timed-out attempt is retried up to 3 times with backoff before ingest fails with the error.</div><div class="group" id="limits">[limits]</div><div class="cell k">max_query_memory_mb</div><div class="cell t">u32</div><div class="cell d">512</div><div class="cell dsc">Per-query memory cap (MiB). Queries that exceed it are cancelled.</div><div class="cell k">max_concurrent_searches</div><div class="cell t">u32</div><div class="cell d">64</div><div class="cell dsc">Global in-flight search ceiling. Extras are queued.</div><div class="cell k">max_fields_per_index</div><div class="cell t">u32</div><div class="cell d">500</div><div class="cell dsc">Field-explosion protection. ES default is 1000; 500 is intentionally stricter.</div><div class="cell k">max_result_window</div><div class="cell t">u64</div><div class="cell d">10000</div><div class="cell dsc">Largest <code class="inline">from + size</code> a search may ask for, for any index whose settings carry no <code class="inline">index.max_result_window</code> (that setting wins when present, above or below this). 1–2147483647. Page past it with <code class="inline">search_after</code> or a point-in-time cursor.</div><div class="group" id="indexing">[indexing]</div><div class="cell k">turbo_batch_size</div><div class="cell t">u32</div><div class="cell d">1000</div><div class="cell dsc">Docs per batch in turbo mode. Range 500–5000. Larger = higher throughput, slightly higher latency. <strong>Not wired</strong>: a turbo request is indexed as one batch. Setting it away from the default logs a warning at startup.</div><div class="cell k">turbo_parallel</div><div class="cell t">bool</div><div class="cell d">true</div><div class="cell dsc">Parallel tokenisation on Rayon threads. Disable only for debugging. <strong>Not wired</strong>: turbo ingest no longer pre-tokenises, so there is nothing to parallelise. Setting it away from the default logs a warning at startup.</div><div class="cell k">turbo_fast_analyzer</div><div class="cell t">bool</div><div class="cell d">false</div><div class="cell dsc">Skip stemming and stop-word removal in turbo mode. Trades recall for speed. <strong>Not wired</strong>: the turbo path ignores it; fields keep their analyzers. Setting it away from the default logs a warning at startup.</div><div class="group" id="cluster">[cluster]</div><div class="cell k">enabled</div><div class="cell t">bool</div><div class="cell d">false</div><div class="cell dsc">Enable multi-node cluster mode. When true, the Raft state machine and cluster transport are started on port.</div><div class="cell k">port</div><div class="cell t">u16</div><div class="cell d">9300</div><div class="cell dsc">TCP port for intra-cluster Raft and search messages. Must be reachable from every peer.</div><div class="cell k">peers</div><div class="cell t">array</div><div class="cell d">[]</div><div class="cell dsc">Peer list, one "host:port=host:port" entry per node — the label must equal the address, or the node refuses to start (#1171). The local node identifies itself from the entry matching bind_address and cluster.port. Example: ["10.0.0.1:9300=10.0.0.1:9300","10.0.0.2:9300=10.0.0.2:9300","10.0.0.3:9300=10.0.0.3:9300"].</div><div class="cell k">tick_ms</div><div class="cell t">u64</div><div class="cell d">50</div><div class="cell dsc">Raft tick interval (ms). Lower = faster leader election at the cost of CPU.</div><div class="cell k">auth_secret</div><div class="cell t">string</div><div class="cell d">""</div><div class="cell dsc">Cluster-wide shared secret authenticating every control frame on port (HMAC-SHA256 over a per-connection challenge). Mandatory when enabled = true — with cluster mode on and no secret here or in XERJ_CLUSTER_AUTH_SECRET the node refuses to start. Same value on every node; minimum 16 chars; generate with `openssl rand -hex 32`. Authenticates, does not encrypt.</div><div class="group" id="wal_tap">[wal_tap]</div><div class="cell k">enabled</div><div class="cell t">bool</div><div class="cell d">false</div><div class="cell dsc">Push a filtered subset of indices to an external ES-compatible target (Elasticsearch, OpenSearch, or another XERJ node) in near-real-time. One-directional and single-node — this is not cross-cluster replication. Off by default.</div><div class="cell k">target_url</div><div class="cell t">string</div><div class="cell d">""</div><div class="cell dsc">Base URL of the target cluster; the tap POSTs to {target_url}/_bulk. Example: "https://central:9200". Empty disables the tap even with enabled = true. Must not carry credentials in the URL (user:pass@host is refused at startup): target_url is echoed by GET /_xerj/wal_tap, by _stats and in the log. Put the credential in target_auth.</div><div class="cell k">target_auth</div><div class="cell t">string</div><div class="cell d">""</div><div class="cell dsc">Verbatim Authorization header for the target, e.g. "ApiKey abc123". Write-only: GET /_xerj/wal_tap reports whether one is set, never its value.</div><div class="cell k">indices</div><div class="cell t">array</div><div class="cell d">[]</div><div class="cell dsc">Index allowlist, glob patterns. Empty ships nothing; ["edge-*","metrics"] ships those. A wildcard never expands to a hidden index, and XERJ&#39;s own .xerj* system indices are never shipped whatever this says.</div><div class="cell k">poll_interval_ms</div><div class="cell t">u64</div><div class="cell d">500</div><div class="cell dsc">How often each allowlisted index&#39;s WAL is polled (ms). Range 50–60000. This is the floor on end-to-end latency; the tap adds nothing to the write path.</div><div class="cell k">max_batch_docs</div><div class="cell t">usize</div><div class="cell d">1000</div><div class="cell dsc">Maximum WAL entries read and shipped per poll, per index. Must be at least 1.</div><div class="cell k">max_batch_bytes</div><div class="cell t">usize</div><div class="cell d">5242880</div><div class="cell dsc">Maximum _bulk body size (bytes). Bounds one HTTP request against the target&#39;s http.max_content_length — a larger batch is split across requests, never truncated.</div><div class="cell k">request_timeout_secs</div><div class="cell t">u64</div><div class="cell d">30</div><div class="cell dsc">Per-request timeout against the target. A timed-out batch is retried; the cursor does not advance, so nothing is dropped.</div><div class="cell k">max_retry_backoff_secs</div><div class="cell t">u64</div><div class="cell d">60</div><div class="cell dsc">Ceiling on the exponential, jittered retry backoff when the target is down. Range 1&ndash;86400 (one day), enforced at startup as well as by PUT /_xerj/wal_tap.</div><div class="cell k">min_retained_generations</div><div class="cell t">u64</div><div class="cell d">0</div><div class="cell dsc">Rotated WAL generations kept per shard after every entry in them is durable in a segment, so a tap whose target is briefly unreachable still finds them. At the default 0, WAL retention never waits for the target: an outage longer than storage.flush_interval_secs loses entries and reports them as gaps in GET /_xerj/wal_tap/_stats. This is a bounded floor, not a retention lease — the extra cost is at most n × storage.wal_max_size_mb per WAL shard per index, whether or not a tap is running, so a stalled target can never fill this node&#39;s disk. Capped at 64 and range-checked at startup, not only by PUT /_xerj/wal_tap &mdash; the config file must not be a way around the bound.</div><div class="group" id="rerank">[rerank]</div><div class="cell k">enabled</div><div class="cell t">bool</div><div class="cell d">true</div><div class="cell dsc">Allow the <code class="inline">rerank</code> search stage. It is the only search-time feature that sends document text off this node, and it does nothing until a key is set. <strong>false</strong> refuses every rerank request with HTTP 403, whatever the environment holds, and nothing is sent.</div><div class="cell k">api_key</div><div class="cell t">string</div><div class="cell d">""</div><div class="cell dsc">Rerank provider key. Empty falls back to the TYPESAFE_API_KEY environment variable; a value here wins over the environment. Empty in both places means reranking is not configured and a rerank request gets HTTP 503. Write-only: GET /_xerj/rerank reports whether a key is set and where it came from, never its value. There is no per-request key.</div><div class="cell k">endpoint</div><div class="cell t">string</div><div class="cell d">""</div><div class="cell dsc">Where judged document text is POSTed. Empty falls back to TYPESAFE_ENDPOINT, then to https://api.typesafe.ai/v1/systemone. Must be an absolute http:// or https:// URL with no credentials in it (user:pass@host is refused at startup, whether it came from this file or from TYPESAFE_ENDPOINT): the endpoint is echoed by GET /_xerj/rerank.</div></div>

  
  <h2 id="server-section">[server]</h2>
  <p>Network listeners and the data directory. Most deployments only touch <code class="inline">data_dir</code> and the bind address.</p>
<pre class="code">[server]
rest_port      = 8080            # native /v1/* API
es_compat_port = 9200            # ES wire-compatible API
grpc_port      = 8081            # gRPC (xerj.v1.XerjSearch), plaintext h2c
bind_address   = "0.0.0.0"       # not a default — the default is "127.0.0.1" (loopback only)
allow_insecure_network_bind = true   # not a default (false) — required for a non-loopback bind while TLS is off
data_dir       = "/var/lib/xerj" # not a default ("./data") — an absolute path is strongly recommended</pre>
  <p>The default bind is loopback, so an unconfigured node is not reachable from the network. Exposing it while <code class="inline">tls.enabled = false</code> refuses to start unless <code class="inline">allow_insecure_network_bind</code> says the cleartext exposure is intended — enable TLS and neither line is needed.</p>

  <h2 id="auth-section">[auth]</h2>
  <p>Static API-key authentication. The first-run admin key is written to <code class="inline">&lt;data_dir&gt;/admin.key</code>; subsequent starts reuse it. Clients pass <code class="inline">Authorization: ApiKey &lt;key&gt;</code> on every request.</p>
<pre class="code">[auth]
enabled       = true
admin_api_key = ""               # blank → auto-generated on first run

# Or provide your own:
# admin_api_key = "ak_live_c8f9a4…"</pre>

  <h2 id="tls-section">[tls]</h2>
  <p>TLS termination at the server. In Kubernetes or behind a load balancer, leave this off and terminate at the proxy instead — one place to rotate certs, one place to log handshakes.</p>
<pre class="code">[tls]
enabled   = true                         # not a default (false) — this block switches TLS on
cert_path = "/etc/xerj/certs/server.crt" # not a default ("") — your certificate
key_path  = "/etc/xerj/certs/server.key" # not a default ("") — your private key</pre>

  <h2 id="storage-section">[storage]</h2>
  <p>The WAL and flush tuning. <code class="inline">wal_sync</code> is the durability knob everyone looks for — pick <code class="inline">"sync"</code> for financial/compliance workloads, <code class="inline">"batched"</code> for everything else, and <code class="inline">"async"</code> only in benchmarks.</p>
<pre class="code">[storage]
wal_sync            = "batched"
wal_batch_ms        = 100        # fsync every 100 ms
wal_max_size_mb     = 1024       # roll WAL every 1 GiB
flush_size_mb       = 512        # flush memtable at 512 MiB
flush_interval_secs = 30</pre>

  <h2 id="merge-section">[merge]</h2>
  <p>Segment compaction. <code class="inline">size_tiered</code> is the only implemented policy: it merges same-size segments, which is cheap and write-optimal. <code class="inline">log_structured</code> is a name in the enum with no merge policy behind it, so the server <strong>refuses to start</strong> on it rather than silently running size-tiered merging for an operator who picked a levelled policy for its read amplification. If full-range scans are what hurts, that is a real gap in this build — setting the key will not change it.</p>
<pre class="code">[merge]
strategy           = "size_tiered" # the only one implemented — log_structured is refused at startup
min_segments       = 10          # accepted, not wired
max_segment_mb     = 8192        # 8 GiB cap
io_rate_mb_per_sec = 100         # accepted, not wired — merges are not throttled
max_concurrent     = 1           # accepted, not wired (see XERJ_MERGE_PARALLELISM)
tier_floor_mb      = 4
min_merge_count    = 4           # the real per-tier merge trigger
max_merge_count    = 16          # caps peak merge RAM</pre>

  <h2 id="compression-section">[compression]</h2>
  <p>See <a href="/docs/compression">Compression</a> for the encoding catalog. This section picks the outer <em>block</em> codec effort only — the inner per-column encodings are chosen automatically at write time.</p>
<pre class="code">[compression]
enabled         = true           # accepted, not wired — no uncompressed write path exists
level           = "balanced"     # Zstd L1 / L3 / L6, applied at MERGE (flush is always L3)
block_size_docs = 128            # accepted, not wired — 16-4096, range-checked at startup</pre>

  <h2 id="fts-section">[fts]</h2>
  <p>This key is accepted but <strong>not wired</strong>: a <code class="inline">text</code> field without an analyzer of its own uses the index's <code class="inline">analysis.analyzer.default</code> when the index declares one, and <code class="inline">standard</code> otherwise. Set the analyzer per field or per index in the mapping when creating an index. See <a href="/docs/analyzers">Analyzers</a> for the built-ins.</p>
<pre class="code">[fts]
default_analyzer = "standard"    # accepted, not wired — see the table</pre>

  <h2 id="vector-section">[vector]</h2>
  <p>Vector search settings. Unfiltered kNN is served by a <strong>persisted HNSW graph with exact rescoring</strong> (measured recall@10 1.00 on the official bench query); filtered kNN and SQ8 fields run the exact scan. The <code class="inline">hnsw_*</code> keys are accepted and validated but not yet wired: the graph builds with fixed M=16 / ef_construction=200, and the query-time beam width comes from the request's <code class="inline">num_candidates</code> (floored at 800). Quantization trades recall for scoring precision, not for memory — see <code class="inline">default_quantization</code> below and <a href="https://github.com/xerj-org/xerj/issues/392">#392</a>.</p>
<pre class="code">[vector]
default_metric         = "cosine"    # accepted, not wired — similarity comes from the mapping
hnsw_m                 = 16          # accepted, not wired — the graph builds with M=16
hnsw_ef_construction   = 200         # accepted for compat; no effect on results
hnsw_ef_search         = 100         # accepted for compat; no effect on results
default_quantization   = "none"      # "scalar8" = int8 precision, 1–2% recall loss.
                                     # NOT a RAM saving today — see issue #392
max_dimensions         = 16384       # accepted, not wired — nothing checks dims against it</pre>

  <h2 id="logs-section">[logs]</h2>
  <p>Time-series retention is <strong>not implemented in this build</strong>: both keys are accepted and nothing reads them, no retention job runs, and log data is kept until you delete it. Setting either away from its default logs a warning at startup.</p>
<pre class="code">[logs]
retention_days = 90              # accepted, not wired — nothing deletes log data
time_partition = "1h"            # accepted, not wired</pre>

  <h2 id="embedding-section">[embedding]</h2>
  <p>Delegates vector generation to an OpenAI-compatible endpoint. Leave <code class="inline">default_endpoint</code> empty if clients provide vectors themselves. Token limits are model-specific; the chunker in the <code class="inline">ai</code> crate splits long documents to fit the model's window.</p>
<pre class="code">[embedding]
# OpenAI:
default_endpoint = "https://api.openai.com/v1/embeddings"  # not a default ("" disables auto-embedding)
default_model    = "text-embedding-3-small"                # not a default ("")
batch_size       = 64
timeout_ms       = 5000

# Or a local Ollama:
# default_endpoint = "http://localhost:11434/v1/embeddings"
# default_model    = "nomic-embed-text"</pre>

  <h2 id="limits-section">[limits]</h2>
  <p>Hard caps to protect the server from runaway queries and mapping explosions. Lower these on shared nodes, raise <code class="inline">max_query_memory_mb</code> for aggregation-heavy workloads. Leave <code class="inline">max_process_memory_mb</code> out to auto-size the process-wide cap from the machine (8 / 16 / 32 GiB tiers); set an explicit MiB ceiling only to raise headroom on a large host — for example if a big <code class="inline">xerj autoindex</code> trips <code class="inline">429 circuit_breaking_exception</code>.</p>
<pre class="code">[limits]
max_query_memory_mb     = 512
max_concurrent_searches = 64
max_fields_per_index    = 500
# max_process_memory_mb = 0   # omit → AUTO (8/16/32 GiB by machine); 0 = whole machine</pre>

  <h2 id="indexing-section">[indexing]</h2>
  <p>Turbo mode knobs. Turbo is opt-in per-request via <code class="inline">POST /v1/indices/:name/turbo-ingest</code> or the <code class="inline">X-Turbo: true</code> header on <code class="inline">_bulk</code>; none of the three settings below changes anything in this build (each logs a warning at startup when set away from its default).</p>
<pre class="code">[indexing]
turbo_batch_size    = 1000       # accepted, not wired
turbo_parallel      = true       # accepted, not wired
turbo_fast_analyzer = false      # accepted, not wired</pre>

  <h2 id="cluster-section">[cluster]</h2>
  <p>Multi-node mode. Default is off — single-node doesn't need a consensus layer. When enabled, the embedded Raft implementation replicates <strong>metadata only</strong> (schemas, shard assignments, node roster). See <a href="/docs/clustering">Clustering</a> for the full story.</p>
<pre class="code">[cluster]
enabled = true                   # not a default (false) — this block switches cluster mode on
port    = 9300                   # intra-cluster gRPC + Raft
peers   = [                      # not a default ([]) — your node roster; label = address (#1171)
  "10.0.0.11:9300=10.0.0.11:9300",
  "10.0.0.12:9300=10.0.0.12:9300",
  "10.0.0.13:9300=10.0.0.13:9300",
]
tick_ms = 50
auth_secret = "&lt;secret&gt;"         # not a default ("") — required when enabled, 16+ chars, same on every node</pre>

  <h2 id="rerank-section">[rerank]</h2>
  <p><strong>This feature sends your data off the machine.</strong> A search that carries a <code class="inline">rerank</code> block POSTs the question and the text of up to <code class="inline">window</code> hits (default 30, maximum 300) to a third-party relevance judge, and reorders the hits by the probability that comes back. It is the only search-time feature that sends document text off the node. Two other features send text off the node, both operator configuration and off by default: <code class="inline">[embedding] default_endpoint</code> (proxy embeddings) and the WAL tap. The neural model download and cluster Raft traffic carry no document text. Nothing is sent until an operator sets a key, a request only triggers it by asking for it, and <code class="inline">enabled = false</code> forbids it outright. Settings are resolved once at startup; a value in this file wins over the environment. Ranking quality with the provider's model has <strong>not been verified</strong> by this project. Full reference: <a href="https://github.com/xerj-org/xerj/blob/main/docs/RERANK.md" rel="external">docs/RERANK.md</a>.</p>
<pre class="code">[rerank]
enabled  = true
api_key  = "ts-..."                                  # not a default ("") — or set TYPESAFE_API_KEY
endpoint = "https://api.typesafe.ai/v1/systemone"    # not a default ("") — this is where "" resolves to</pre>
  <p>Check it without printing the key: <code class="inline">GET /_xerj/rerank</code> (superuser only) returns <code class="inline">configured</code>, whether a key is set and whether it came from <code class="inline">config</code> or <code class="inline">env</code>, the endpoint with any query string removed, and the server-side limits.</p>


  <p class="source-note">Source · engine/xerj.default.toml · engine/crates/xerj-common/src/config.rs</p>
  

<div class="next">
      <div class="step"><span class="dir">◀ PREV</span><a href="/docs/cli">CLI</a></div>
      <div class="step right"><span class="dir">NEXT ▶</span><a href="/docs/env">Environment</a></div>
    </div>

  <!-- Print-only branded footer (hidden on screen, visible in PDF) -->
  <div class="print-footer" style="display:none;">
    <span>XERJ.AI · V1.0.0-RC.100 · 2026-08-11</span>
    <a href="https://xerj.org/docs/">https://xerj.org/docs/</a>
    <span>Config TOML</span>
  </div>
</main>
</div>

<!-- seo:footer-begin — generated by scripts/seo/fix_links.py · do not hand-edit -->
<nav class="footer-map" aria-label="Site map">
  <div class="fm-col">
    <span class="fm-h">PRODUCT</span>
    <a href="/product">PRODUCT</a>
    <a href="/architecture/">ARCHITECTURE</a>
    <a href="/benchmarks/">BENCHMARKS</a>
    <a href="/pricing/">PRICING</a>
    <a href="/security/">SECURITY</a>
    <a href="/playground">DASHBOARDS</a>
    <a href="/demo/">REAL-DATA DEMO</a>
    <a href="/aise-demo">PRODUCT TOUR</a>
  </div>
  <div class="fm-col">
    <span class="fm-h">LEARN</span>
    <a href="/answers/">ANSWERS</a>
    <a href="/compare/">COMPARE</a>
    <a href="/use-cases">USE CASES</a>
    <a href="/case-studies">CASE STUDIES</a>
    <a href="/industries/">INDUSTRIES</a>
    <a href="/blog/">BLOG</a>
  </div>
  <div class="fm-col">
    <span class="fm-h">SOLUTIONS</span>
    <a href="/solutions/">SOLUTIONS</a>
    <a href="/industries/finserv">FINANCIAL SERVICES</a>
    <a href="/industries/public-sector">PUBLIC SECTOR</a>
    <a href="/industries/healthcare">HEALTHCARE</a>
    <a href="/industries/retail">RETAIL</a>
    <a href="/use-cases/code-security-audit">AI CODE-SECURITY AUDIT</a>
    <a href="/use-cases/semantic-analytics">SEMANTIC ANALYTICS</a>
    <a href="/resources/">SALES KIT</a>
  </div>
  <div class="fm-col">
    <span class="fm-h">DOCS</span>
    <a href="/docs/">DOCUMENTATION</a>
    <a href="/docs/quickstart">QUICKSTART</a>
    <a href="/docs/install">INSTALL</a>
    <a href="/docs/migration-from-es">MIGRATE FROM ELASTICSEARCH</a>
    <a href="/docs/recipes/">RECIPES</a>
    <a href="/docs/agents/">DOCS FOR AI</a>
    <a href="/for-agents">FOR AI AGENTS</a>
    <a href="/agent-search/">AGENTIC SEARCH DEMO</a>
    <a href="/llms.txt">LLMS.TXT</a>
    <a href="https://github.com/xerj-org/xerj" rel="external">GITHUB</a>
  </div>
</nav>
<!-- seo:footer-end -->
<footer class="footer">
  <span>XERJ.AI · DOCS · V1.0.0-RC.100</span>
  <span>READ THE SOURCE</span>
  <span><a href="/">HOME</a> · <a href="/product">PRODUCT</a> · <a href="/answers/">ANSWERS</a> · <a href="/playground">DASHBOARDS</a> &middot; <a href="/llms.txt">LLMS.TXT</a></span>
</footer>

<script type="application/json" id="docs-index">[{"title":"Corpus Hub","slug":"/docs/corpus-hub","kicker":"CORPUS HUB","snip":"Ask a pinned, signed, pre-indexed corpus: xerj ask, xerj hub pull/sync, the MCP hub tools, and how to contribute a corpus."},{"title":"Overview","slug":"/docs/","kicker":"START","snip":""},{"title":"Quickstart","slug":"/docs/quickstart","kicker":"START","snip":""},{"title":"Install","slug":"/docs/install","kicker":"START","snip":""},{"title":"Migrate from ES","slug":"/docs/migration-from-es","kicker":"START","snip":""},{"title":"CLI","slug":"/docs/cli","kicker":"REFERENCE","snip":""},{"title":"Config TOML","slug":"/docs/config","kicker":"REFERENCE","snip":""},{"title":"Environment","slug":"/docs/env","kicker":"REFERENCE","snip":""},{"title":"Native REST API","slug":"/docs/api-native","kicker":"REFERENCE","snip":""},{"title":"ES-compat API","slug":"/docs/api-es-compat","kicker":"REFERENCE","snip":""},{"title":"Query types","slug":"/docs/queries","kicker":"DATA MODEL","snip":""},{"title":"Aggregations","slug":"/docs/aggregations","kicker":"DATA MODEL","snip":""},{"title":"Analyzers","slug":"/docs/analyzers","kicker":"DATA MODEL","snip":""},{"title":"Vectors & kNN","slug":"/docs/vectors","kicker":"DATA MODEL","snip":""},{"title":"Ingest pipelines","slug":"/docs/ingest","kicker":"ENGINE","snip":""},{"title":"Storage & WAL","slug":"/docs/storage","kicker":"ENGINE","snip":""},{"title":"Compression","slug":"/docs/compression","kicker":"ENGINE","snip":""},{"title":"Clustering","slug":"/docs/clustering","kicker":"ENGINE","snip":""},{"title":"Metrics","slug":"/docs/metrics","kicker":"ENGINE","snip":""},{"title":"Auth & TLS","slug":"/docs/security","kicker":"ENGINE","snip":""},{"title":"Running in production","slug":"/docs/operations","kicker":"OPERATIONS","snip":""},{"title":"Backup & restore","slug":"/docs/backup-restore","kicker":"OPERATIONS","snip":""},{"title":"Upgrades","slug":"/docs/upgrades","kicker":"OPERATIONS","snip":""},{"title":"Troubleshooting","slug":"/docs/troubleshooting","kicker":"OPERATIONS","snip":""},{"title":"SIEM","slug":"/docs/playbooks/siem","kicker":"PLAYBOOKS","snip":""},{"title":"Log analytics","slug":"/docs/playbooks/log-analytics","kicker":"PLAYBOOKS","snip":""},{"title":"Vector · RAG","slug":"/docs/playbooks/vector-search","kicker":"PLAYBOOKS","snip":""},{"title":"Full-text search","slug":"/docs/playbooks/full-text","kicker":"PLAYBOOKS","snip":""},{"title":"Observability","slug":"/docs/playbooks/observability","kicker":"PLAYBOOKS","snip":""},{"title":"CLI · --config","slug":"/docs/cli#config-flag","kicker":"CLI","snip":"-c, --config <PATH>  Path to the TOML config file."},{"title":"CLI · --data-dir","slug":"/docs/cli#data-dir-flag","kicker":"CLI","snip":"-d, --data-dir <PATH>  Override [server] data_dir at the command line."},{"title":"CLI · --insecure","slug":"/docs/cli#insecure-flag","kicker":"CLI","snip":"-k, --insecure  Disable TLS and API-key auth. Dev only."},{"title":"[server] rest_port","slug":"/docs/config#server","kicker":"CONFIG","snip":"u16 · default 8080 · Native REST API listener port."},{"title":"[server] es_compat_port","slug":"/docs/config#server","kicker":"CONFIG","snip":"u16 · default 9200 · Elasticsearch-wire-format port. 0 = OS-assigned port."},{"title":"[storage] wal_sync","slug":"/docs/config#storage","kicker":"CONFIG","snip":"enum · default batched · sync · batched · async. Durability knob."},{"title":"[vector] hnsw_ef_search","slug":"/docs/config#vector","kicker":"CONFIG","snip":"u32 · default 100 · Accepted but not wired — the beam width comes from the request num_candidates."},{"title":"[vector] default_quantization","slug":"/docs/config#vector","kicker":"CONFIG","snip":"enum · none (default) · scalar8. binary is refused at startup; scalar4 is not accepted."},{"title":"GET /v1/health","slug":"/docs/api-native#health","kicker":"NATIVE API","snip":"Liveness + readiness. {status, uptime_s, version}."},{"title":"GET /v1/metrics","slug":"/docs/api-native#metrics","kicker":"NATIVE API","snip":"Prometheus text format. Scrape-friendly."},{"title":"POST /v1/indices/:name/turbo-ingest","slug":"/docs/api-native#turbo-ingest","kicker":"NATIVE API","snip":"NDJSON bulk path with parallel tokenization."},{"title":"POST /v1/indices/:name/search","slug":"/docs/api-native#search","kicker":"NATIVE API","snip":"Unified query endpoint — full-text, term, range, KNN, hybrid."},{"title":"POST /:index/_bulk","slug":"/docs/api-es-compat#bulk","kicker":"ES API","snip":"NDJSON bulk. Actions: index, create, update, delete."},{"title":"POST /:index/_search","slug":"/docs/api-es-compat#search","kicker":"ES API","snip":"ES query DSL. Drop-in migration path."},{"title":"match_all","slug":"/docs/queries#match-all","kicker":"QUERY","snip":"Everything in the index."},{"title":"bool","slug":"/docs/queries#bool","kicker":"QUERY","snip":"must / should / must_not / filter clauses."},{"title":"knn","slug":"/docs/queries#knn","kicker":"QUERY","snip":"Vector kNN — HNSW-served when unfiltered (exact-rescored); filtered runs the exact scan."},{"title":"semantic","slug":"/docs/queries#semantic","kicker":"QUERY","snip":"Embed the query text at query time and search the vector field."},{"title":"hybrid","slug":"/docs/queries#hybrid","kicker":"QUERY","snip":"RRF / linear fusion of sub-queries."},{"title":"terms aggregation","slug":"/docs/aggregations#terms","kicker":"AGG","snip":"Exact, pre-computed terms histograms over keyword fields."},{"title":"date_histogram","slug":"/docs/aggregations#date-histogram","kicker":"AGG","snip":"Time-bucketed counts."},{"title":"kNN serving","slug":"/docs/vectors#knn-query","kicker":"VECTORS","snip":"Unfiltered kNN via persisted HNSW + exact rescore; filtered kNN exact scan."},{"title":"SQ8 quantization","slug":"/docs/vectors#quantization","kicker":"VECTORS","snip":"8-bit scalar quantization. int8 scoring precision, not a memory saving (#392)."},{"title":"turbo-ingest","slug":"/docs/ingest#turbo","kicker":"INGEST","snip":"NDJSON bulk path. Parallel tokenization across cores."},{"title":"delta-of-delta","slug":"/docs/compression#delta-of-delta","kicker":"COMPRESSION","snip":"Timestamp encoding. Apache/Nginx/ISO auto-detect."},{"title":"dictionary encoding","slug":"/docs/compression#dictionary","kicker":"COMPRESSION","snip":"Up to 256 unique strings per column."},{"title":"api_key","slug":"/docs/security#api-key","kicker":"SECURITY","snip":"Static admin key. Auto-generated on first run."},{"title":"SIEM playbook","slug":"/docs/playbooks/siem","kicker":"PLAYBOOK","snip":"Terms agg over source IPs for SIEM, with detection rules."},{"title":"RAG playbook","slug":"/docs/playbooks/vector-search","kicker":"PLAYBOOK","snip":"Embeddings, kNN, hybrid search, BM25 + kNN fusion."},{"title":"[cluster] enabled","slug":"/docs/config#cluster","kicker":"CONFIG","snip":"bool · default false · Enable multi-node Raft cluster mode."},{"title":"[cluster] peers","slug":"/docs/config#cluster","kicker":"CONFIG","snip":"array · \"host:port=host:port\" · label must equal address (#1171)."},{"title":"[cluster] port","slug":"/docs/config#cluster","kicker":"CONFIG","snip":"u16 · default 9300 · Intra-cluster Raft + search port."},{"title":"[embedding] default_endpoint","slug":"/docs/config#embedding","kicker":"CONFIG","snip":"string · OpenAI-compatible embeddings URL for auto-embedding on ingest."},{"title":"[embedding] default_model","slug":"/docs/config#embedding","kicker":"CONFIG","snip":"string · Model name (e.g. text-embedding-3-small, nomic-embed-text)."},{"title":"Raft","slug":"/docs/clustering","kicker":"CLUSTER","snip":"Embedded Raft ring — leader election, heartbeats, authenticated transport."},{"title":"Leader failover","slug":"/docs/clustering","kicker":"CLUSTER","snip":"Kill the leader of a 3-node ring: survivors elect a new leader in ~250 ms."},{"title":"Cluster honesty","slug":"/docs/clustering","kicker":"CLUSTER","snip":"Create-time number_of_replicas copies acknowledged document writes. Bulk, replica promotion, and snapshot catch-up are still open (#1170)."},{"title":"Systemd unit","slug":"/docs/operations","kicker":"OPS","snip":"Production unit file with hardening directives."},{"title":"Readiness probe","slug":"/docs/operations","kicker":"OPS","snip":"GET /v1/health/ready — only 200 once WAL replay is complete."},{"title":"Config reload","slug":"/docs/operations","kicker":"OPS","snip":"SIGHUP reloads most keys without restart."},{"title":"Hot backup","slug":"/docs/backup-restore","kicker":"OPS","snip":"rsync the data dir after POST /v1/admin/flush."},{"title":"S3 backup","slug":"/docs/backup-restore","kicker":"OPS","snip":"POST /v1/admin/backup → any S3-compatible endpoint."},{"title":"Cluster upgrade","slug":"/docs/upgrades","kicker":"OPS","snip":"The cluster wire has no version negotiation — full stop/start, not rolling."},{"title":"Merge pressure","slug":"/docs/troubleshooting","kicker":"OPS","snip":"Segment count climbing → raise merge.max_concurrent + io_rate."},{"title":"Cluster flapping","slug":"/docs/troubleshooting","kicker":"OPS","snip":"Sustained leader churn is a defect — capture RUST_LOG=xerj_cluster=debug and file it."},{"title":"WAL warnings after a crash","slug":"/docs/troubleshooting","kicker":"OPS","snip":"Repaired on startup; no manual repair command."},{"title": "Recipes", "slug": "/docs/recipes/", "kicker": "RECIPES", "snip": "Task-oriented AI & search recipes, each verified end-to-end against a live XERJ."},{"title": "Semantic search & RAG", "slug": "/docs/recipes/semantic-search-rag", "kicker": "RECIPE", "snip": "Retrieval by meaning with semantic_text — auto-embed on ingest, no separate vector DB."},{"title": "Agent memory", "slug": "/docs/recipes/agentic-memory", "kicker": "RECIPE", "snip": "Long-term memory for agents via /_memory — store, recall, forget, per-agent isolation."},{"title": "Passage retrieval", "slug": "/docs/recipes/passage-retrieval", "kicker": "RECIPE", "snip": "Auto-chunk long docs; best-passage (max-sim) scoring — 98% top-3."},{"title": "Vector search · kNN", "slug": "/docs/recipes/vector-search-knn", "kicker": "RECIPE", "snip": "Nearest-neighbor over dense_vector — HNSW-served unfiltered, exact with filters."},{"title": "Vector quantization", "slug": "/docs/recipes/vector-quantization", "kicker": "RECIPE", "snip": "scalar8 (accepts ES int8_hnsw; exact code scan) — int8 scoring at recall@10 = 0.998. Precision, not memory."},{"title": "Hybrid search", "slug": "/docs/recipes/hybrid-search", "kicker": "RECIPE", "snip": "Keyword + vector in one query — RRF fusion."},{"title": "Log analytics", "slug": "/docs/recipes/log-analytics", "kicker": "RECIPE", "snip": "Raw logs to dashboards — error rates, p95 latency, top services."},{"title": "Anomaly detection", "slug": "/docs/recipes/anomaly-detection", "kicker": "RECIPE", "snip": "Statistical _ml detectors that flag spikes in metrics/logs."},{"title": "Anomaly datafeeds", "slug": "/docs/recipes/continuous-anomaly-datafeeds", "kicker": "RECIPE", "snip": "Live _ml datafeed re-scores an index on a timer, stores anomaly records."},{"title": "Migrate from ES", "slug": "/docs/recipes/migrate-from-elasticsearch", "kicker": "RECIPE", "snip": "Point your existing ES client at XERJ — same wire, change the URL."}]</script>

<script>
  // IIFE — js-auth navigates between decrypted pages in the same
  // JS realm, so const bindings must be lexically scoped.
  (function () {
    const root = document.documentElement;

    // Client-side docs search — filters the inline JSON index.
    const searchEl    = document.getElementById('docsSearch');
    const inputEl     = document.getElementById('docsSearchInput');
    const resultsEl   = document.getElementById('docsSearchResults');
    const indexJson   = document.getElementById('docs-index');
    if (searchEl && inputEl && resultsEl && indexJson) {
      let index = [];
      try { index = JSON.parse(indexJson.textContent || '[]'); } catch {}
      const render = (q) => {
        const query = q.trim().toLowerCase();
        if (!query) { searchEl.classList.remove('active'); resultsEl.innerHTML = ''; return; }
        const scored = [];
        for (const e of index) {
          const hay = (e.title + ' ' + (e.kicker || '') + ' ' + (e.snip || '')).toLowerCase();
          if (hay.includes(query)) {
            let score = 0;
            if (e.title.toLowerCase().includes(query)) score += 10;
            if ((e.kicker || '').toLowerCase() === query.toUpperCase()) score += 5;
            if ((e.snip || '').toLowerCase().includes(query)) score += 1;
            scored.push({ e, score });
          }
        }
        scored.sort((a, b) => b.score - a.score);
        const top = scored.slice(0, 20);
        if (top.length === 0) {
          resultsEl.innerHTML = '<div class="no-results">NO MATCHES — TRY A SHORTER QUERY</div>';
        } else {
          resultsEl.innerHTML = top.map(({e}) => {
            const kicker = e.kicker || '';
            const snip = e.snip ? '<div class="snip">' + escHtml(e.snip) + '</div>' : '';
            return '<a href="' + e.slug + '">' +
              '<span class="kicker">' + escHtml(kicker) + '</span>' +
              '<span class="title">' + escHtml(e.title) + '</span>' +
              snip + '</a>';
          }).join('');
        }
        searchEl.classList.add('active');
      };
      const escHtml = (s) => String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
      inputEl.addEventListener('input', (e) => render(e.target.value));
      inputEl.addEventListener('focus', () => { if (inputEl.value) render(inputEl.value); });
      document.addEventListener('keydown', (e) => {
        if ((e.key === 'k' || e.key === 'K') && (e.metaKey || e.ctrlKey)) {
          e.preventDefault();
          inputEl.focus();
          inputEl.select();
        }
        if (e.key === 'Escape' && document.activeElement === inputEl) {
          inputEl.value = '';
          searchEl.classList.remove('active');
          resultsEl.innerHTML = '';
          inputEl.blur();
        }
      });
    }
  })();
</script>

</body>
</html>