Date: 2026-04-20 Status: approved for implementation Owner: mnemosyne
Agents currently have no fast, deterministic way to locate a wiki page by keyword. Two retrieval paths exist, both wrong for this job:
mnemosyne wiki query <question> — calls Ollama (gemma), synthesizes prose. Slow (seconds to minutes), token-heavy, returns narrative not paths. Designed for "answer the question" not "locate the doc."mcp__aion__aion_wiki — MCP wrapper around the same Ollama path. Same cost profile.Real incident captured during this brainstorm: a second session's agent spent 6+ minutes and 4k tokens running four wiki query calls to locate the Mastra framework decision doc. None succeeded — partly because the answer was synthesized away from the actual paths, partly because the source research doc was not ingested into the vault.
Baseline capability missing: "does a wiki page exist for X, and where is it?"
Operator requirements:
Non-goals:
Read the returned path if they want content.wiki query — complementary primitive.mnemosyne wiki find <keyword> [<keyword>...] [--cat] [--json] [--limit N]
Compact list, one page per line:
analyses/mastra-framework-decision-trail.md — Mastra Framework Decision Trail
hermes/hermes-mastra-changelog-analysis.md — Hermes Mastra Changelog Safety Analysis
Format: <relative-path> — <title>. Path is relative to vault root (stable across machines, operator knows the vault). Title is the page's frontmatter title field, falling back to filename stem when missing.
--cat — dump full page content to stdout if and only if exactly one match. With 0 or 2+ matches, exit with error (no partial behavior).--json — machine-readable output: [{"path": ..., "title": ..., "constellation": ..., "type": ...}, ...]. Empty array on no match.--limit N — cap results (default 20). Prevents pathological floods.0 — one or more matches found, output written to stdout1 — zero matches; stderr prints no wiki page matches '<keyword>[ <keyword>...]'2 — --cat with wrong match count (0 or 2+); stderr explainsSame surface as _list_wiki_pages() in src/mcp/aion_tools.py:132:
VAULT_ROOT (atlas, hades, mnemosyne, proteus, metis, apollo, hermes, hephaistos, athena)analyses/ cross-cutting dir*.md at one level deep per existing conventionVAULT_ROOT and CONSTELLATIONS imported from src/wiki/config.py — no hardcoded paths.
New: src/wiki/find.py
find_pages(keywords: list[str], limit: int = 20) -> list[dict] — pure function, returns matches_list_wiki_pages pattern but inlined + extended with body scanNew: tests/test_wiki_find.py
Modified: src/mnemosyne.py
find subcommand to existing wiki subparser--cat, --json, --limit flags wiredModified: .claude/context/commands.md
wiki find with exampleModified: CLAUDE.md (wiki section) — add wiki find as primary retrieval primitive; wiki query demoted to "when you need synthesis, not location"
mnemosyne wiki find mastra returns existing matches in under 500ms on current vault (94 pages)mnemosyne wiki find nonexistent exits 1, stderr has error message, stdout emptymnemosyne wiki find mastra slack applies AND — fewer or equal results than single-keywordmnemosyne wiki find <unique-keyword> --cat dumps full matching page bodymnemosyne wiki find mastra --cat (multiple matches) exits 2 with helpful stderrmnemosyne wiki find mastra --json produces valid JSON parseable by agentsagent-ecosystem-report-2026-03.md (from archived mimir-agent repo) ingested into Aion vault under analyses/ with constellation owner = atlas. Verifies the real-world use case that triggered this design.find — can be added later if CLI-over-MCP rule is relaxed for this specific case, but not nowwiki query already does that via _rank_pages_by_relevancesrc/wiki/config.pywiki query: CLAUDE.md update + mnemosyne-reflex skill nudge lead agents to find first. Not enforced by hook (too brittle), just documented as primary.src/mcp/aion_tools.py:132 (_list_wiki_pages)src/wiki/engine.py:237-299 (different primitive — scored synthesis)backlog/mcp--deregister-legacy-mnemosyne-tools.done.md~/.claude/rules/05-skill-enforcement.md (CLI-over-MCP)$AION_VAULT/SCHEMA.md