| type | reference | ||||
|---|---|---|---|---|---|
| scope | shared | ||||
| tags |
|
First-time users: Run
kairix setupto configure your environment before proceeding. See docs/getting-started/quick-start.md for full installation instructions.
This guide is for AI agents using kairix to search and retrieve knowledge from the shared knowledge store. Read it before your first session, and use it as a reference when queries return unexpected results.
Kairix is the retrieval layer between you and the team's knowledge base. It indexes the document store (Obsidian markdown files), runs hybrid search (BM25 + vector), and returns ranked snippets within a token budget. It understands query intent — so a question about "what happened last week" gets different treatment than "what is the engineering pattern for retries".
You do not need to use basic keyword search. Kairix routes your query to the right retrieval strategy automatically.
kairix search "<your query>" --agent <your-agent-name>Examples:
kairix search "what decisions were made about the Azure connector" --agent builder
kairix search "knowledge management positioning" --agent builder --budget 3000
kairix search "how do I run the embedding pipeline" --agent builder
kairix search "what happened last week" --agent builder
kairix search "tell me about Acme Corp" --agent builderIf kairix is not on PATH (you get command not found):
/usr/local/bin/kairix search "<query>" --agent <name>| Flag | Default | When to use |
|---|---|---|
--agent <name> |
None | Always — scopes results to your agent's collections + shared |
--scope <value> |
shared+agent |
Override the default scope. See "Scope" section below. |
--budget <tokens> |
5000 | Reduce if context window is tight; 2000–3000 is usually enough |
--json |
Off | Machine-readable output — use when parsing results programmatically |
Every retrieval tool (search, prep, timeline, contradict) accepts a scope value. It controls which document collections the search reaches.
| Scope | Reaches | When to use |
|---|---|---|
shared |
Shared collections only (vault content not tied to any agent) | When the agent's own memory shouldn't influence the answer — e.g. fact-checking a claim against curated knowledge. |
agent |
Only the calling agent's own memory | When you specifically want to recall what this agent has previously written — e.g. session continuity. |
shared+agent (default) |
Shared + the calling agent's memory | Usual case — the agent has access to organisational knowledge plus its own history. |
all-agents |
Every agent's memory, no shared | Cross-agent synthesis — "what has the team collectively discovered about X?" Requires agents: configured in kairix.config.yaml. |
everything |
Shared + every agent's memory | Maximum-recall queries; treat as a last resort because it dilutes precision. |
MCP equivalents: the same values (as strings) are accepted on the scope parameter of mcp-kairix__search, mcp-kairix__prep, mcp-kairix__timeline, and mcp-kairix__contradict.
Kairix classifies your query before running search. The classification changes which retrieval strategy fires:
| Intent | Triggered by | What happens |
|---|---|---|
| keyword | Version strings, error codes, file names, proper nouns | BM25 + vector in parallel; exact terms weighted highly |
| entity | "tell me about X", "what has Y been working on", person/org names | Entity graph lookup + ranked knowledge store docs |
| temporal | "last week", "April 2026", "decisions in March", "what happened recently" | Date-filtered retrieval; handles both absolute dates ("April 2026") and relative phrases ("last week") |
| procedural | "how do I", "what are the steps to", runbook queries | Path-weighted re-rank; step-relevant docs ranked above background |
| multi_hop | "connection between X and Y", "how does A relate to B" | Query decomposed into sub-queries, results fused; cross-encoder re-ranked if [rerank] extra installed |
| semantic | Abstract conceptual questions | Pure vector search with HyDE (hypothetical document embedding); cross-encoder re-ranked if [rerank] extra installed |
You don't need to worry about this. It's automatic. But if a query returns poor results, knowing the intent can help you rephrase it.
A healthy search result in JSON format (--json) has:
{
"intent": "entity",
"results": [...],
"vec_count": 4,
"bm25_count": 3,
"vec_failed": false,
"total_tokens": 1823
}Key fields to check:
vec_failed: false— vector search is working. Iftrue, you're on BM25-only.vec_count > 0— vectors returned. If 0 withvec_failed: false, the query had no semantic matches.results— list of ranked documents withpath,score, andsnippet
You're hitting the legacy /sse endpoint and the gateway is dropping the idle connection. Update your MCP client config to point at /mcp instead — see MCP-CLIENT-MIGRATION.md. The migration is a one-line URL change in your client config; the old /sse path stays mounted, so this is a fix for your client, not a kairix change.
This means Azure credentials aren't loaded. Every search falls back to BM25-only, which misses semantic matches.
Do not proceed with a session on BM25-only retrieval. Flag it and run:
kairix onboard checkThis will tell you exactly which credential is missing and how to fix it.
Try rephrasing more specifically, or check if the relevant document store section has been embedded:
kairix search "the exact title of a document you know exists" --agent builderIf known documents don't appear, the document store may need a re-embed.
The intent classifier may have routed incorrectly. Try rephrasing:
- For entity queries: "tell me about [name]" or "what do we know about [organisation]"
- For temporal queries: include explicit relative time language ("last week", "this month", "recent")
- For procedural queries: start with "how do I" or "what are the steps"
kairix search "<query>" --agent <name> [--budget N] [--json]Generates a ~800-token briefing synthesising relevant knowledge store content for the start of a session.
kairix brief <agent-name>
kairix brief shape --budget 5000Output written to $KAIRIX_DATA_DIR/briefing/<agent>-latest.md.
kairix entity lookup "Jordan Blake"
kairix entity lookup "Acme"Returns entity summary, type, vault_path, and related documents.
kairix curator health
kairix curator health --jsonReports: entity counts, synthesis failures (no summary), missing vault_paths.
kairix vault crawl --vault-root /path/to/vault
kairix vault crawl --vault-root /path/to/vault --dry-runRun after adding new organisation or person stubs to the document store.
kairix classify "We decided to use PostgreSQL for the jobs table"
# → type: decision, destination: decisions.md, confidence: 0.95kairix contradict check "We use PostgreSQL for all persistence" --top-k 5Returns contradicting knowledge store documents with conflict scores. Also exposed as the tool_contradict MCP tool (see below).
kairix contradict check "We use PostgreSQL for all persistence" --top-k 5Also available as the tool_contradict MCP tool. Agents can call it before writing new content to verify it does not conflict with existing knowledge. Returns contradicting documents with conflict scores.
kairix onboard check
kairix onboard check --jsonRun this if search is behaving unexpectedly. Reports: PATH, wrapper, secrets, document store root, vector search, Neo4j.
kairix timeline query "decisions last week"kairix wikilinks inject --vault /path/to/vaultkairix benchmark run --suite suites/example.yaml# Pull a briefing for context before the session
kairix brief shape
# Then search for session-specific context
kairix search "current status of [project]" --agent builder
kairix search "outstanding items from last week" --agent builder# Start with entity lookup for curated summary
kairix entity lookup "Acme"
# Follow up with related knowledge store docs
kairix search "Acme engagement history and decisions" --agent builderkairix search "how we decided to handle [topic]" --agent builder
kairix search "engineering pattern for [approach]" --agent builderkairix search "what decisions were made last month" --agent builder
kairix search "recent activity on the Azure connector" --agent builder
# Use explicit relative time language for best resultskairix search "connection between Acme and TechCorp on the platform project" --agent builderThe tool_research MCP tool runs iterative multi-turn search, refining queries until it finds a good answer. It always returns a synthesis — if no relevant documents are found, it synthesises what it can from the best available results rather than returning a failure message.
| Use case | Recommended budget |
|---|---|
| Session-start context | 5000 (default) |
| Quick fact lookup | 2000 |
| Deep research | 8000–10000 |
| Briefing synthesis context | 5000 |
Set with --budget N. The budget caps total tokens returned, not the number of documents. Kairix ranks documents and returns as many as fit.
| Symptom | Likely cause | Fix |
|---|---|---|
command not found |
kairix not on PATH | Use /usr/local/bin/kairix or run scripts/install.sh |
vec_failed: true |
Azure credentials not loaded | Run kairix onboard check; fix secrets_loaded issue |
| 0 results, no error | Document store not embedded | Run kairix embed --limit 20 to test |
| Results are all from one section | Scope issue | Check --agent flag is correct |
| Entity lookup returns nothing | Entity not in Neo4j | Run kairix vault crawl --vault-root $KAIRIX_VAULT_ROOT |
| Temporal query returns non-temporal docs | Time phrase not detected | Use relative ("last N days/weeks", "this month") or absolute ("April 2026", "March 15") date references |
| BM25-only (vec_count=0) with valid creds | usearch vector index not built | Run kairix embed to build the index |
kairix onboard check # full deployment diagnostics
kairix --help # subcommand list
kairix search --help # search-specific flagsIf the diagnostics pass but results are still poor, run a benchmark to establish a baseline:
kairix benchmark run --suite suites/example.yaml --agent <name>This guide is installed at 04-Agent-Knowledge/shared/kairix-usage.md in the knowledge store and is searchable via kairix search "how do I use kairix".