Tab · Knowledge

Ask the brain

Search your brain like text — every answer cites the file, heading, and line. Free-text query across this repo's .claude/brain/ + docs/ markdown. BM25 ranking, deterministic, no LLM call, no key. Click a hit; deep-link to the cited source at the right #anchor.

See it in motion

Where to find it

  • Localhost: /brain-ask.html?repo=<id>
  • API: GET /api/brain/ask?repo=<id>&q=<query>&k=<n>
  • Keyboard: K then ask
  • Sidebar: Knowledge → Ask the brain

What it does for you

Find the right brain entry without scrolling four files.Type the question; get the top k chunks ranked by Okapi BM25 with a shallow suffix stripper. Each hit shows the path, heading, and matching snippet.
Every answer is traceable.Click a hit → land on the cited brain twin (or docs page) at the right #heading-anchor with the line number in the URL. No “the AI said it” — every claim points at its source.
Local, deterministic, free.Pure markdown walker + BM25 — no embedding service, no API key, no per-query cost. Same query always returns the same ranking. Working-tree-first: newly accepted brain entries are searchable immediately.

Configure

Nothing — the corpus is built from the brain's on-disk markdown on the first request. Caps: 2,000 files / 500 KB per file (prevents pathological brain corruption). v2 follow-up (separate PR) adds optional vector embeddings + RRF fusion + Haiku synthesis when you bring a Voyage/OpenAI key.

Use it well

Open Ask the brain when you suspect the answer is in the brain but you can't name the file. The cited line + snippet is usually enough to decide which hit to open. For specific facts, prefer Brain links (graph view) over Ask (text search); for “what was the reasoning for X”, Ask wins.

Read more