brain auto-kb.
The ACE pattern
Brain implements the Autonomous Context Engineering pattern adapted from recent agent research:| Phase | What happens | Commands involved |
|---|---|---|
| Generate | Search with confidence scoring, authority weights, link boost | brain search, brain analyze |
| Reflect | Mark results helpful / harmful, update source reputation, track search quality per domain | brain reflect |
| Curate | Domain routing, semantic dedup, health scoring, auto-link generation | brain dedup, brain link, brain health |
| Evolve | Parameter sweeps, strategy segment tuning, graph-structure analysis | brain sweep, brain strategy, brain graph |
_reflections/, _decisions/, and _domains/ — so everything the optimizer learns is auditable and portable. Nothing is hidden in a database row.
Running it
The one-liner is the autonomous loop:What auto-kb actually does per round
Probes retrieval with a curated question set
Either the defaults shipped with Brain, or a list you provide via
--questions questions.md.Scores every answer against authority + confidence
4-dimension quality grade per question. Bad answers flagged for follow-up curation.
Curates the vault
brain dedup --threshold 0.85— collapse near-duplicates (with audit).brain link— generate tag-overlap and semantic links; boost graph connectivity.brain health— lint the vault, fix obvious issues, re-embed stale chunks.
Sweeps retrieval parameters
Grid search over RRF
k, link-boost cap, source-type weights; picks the setting that wins against the question set.The individual commands
If you want to drive the loop manually instead of viaauto-kb, each phase has its own command:
Why this matters
Most “agent memory” solutions are vector stores with a nice wrapper. They grow; they don’t improve. After six months you have 40,000 chunks and no sense of which ones are actually useful. Brain’s closed loop gives you:- A quality floor.
brain scorereturns a grade. If it drops, you know before your agent starts giving bad answers. - Self-pruning.
brain dedupcatches the copy-paste-from-Slack patterns that bloat vector stores. - Link uplift.
brain linkuplifts search scores for docs that relate to confirmed-good answers — so the good stuff stays findable as the vault grows. - Tuning without guessing.
brain sweepreplaces “is k=60 the right RRF constant?” with an empirical answer against your actual content and questions.
Audit trail
Everythingauto-kb does lands in the vault:
What’s next
Knowledge graph operations
The graph ops that make the closed loop possible — link, dedup, health, score.
Configuration
Deployment modes, env vars, and the
brain.json strategy block.