For teams whose docs, schema and rules change faster than their agents are updated.
Updated
To keep what an agent knows fresh, treat the Brain like a synced copy of your sources: re-run brainbox sync when docs change, re-ingest when the schema changes, let events add traces, and review deletes instead of letting them pass silently. Re-ingest retracts what a changed source no longer says, and events that contradict an element show up as stale signals.
Each file is stored under a stable key: the namespace plus its relative path. Re-run sync and new and edited files are ingested while unchanged ones are skipped. Start with --dry-run to see the diff, and use --json in scripts and CI.
npx -y @brainbox-labs/cli@latest sync ./docs --namespace kb --dry-run
npx -y @brainbox-labs/cli@latest sync ./docs --namespace kb --jsonA file you delete is never archived silently. On a terminal, sync lists the pages and asks first. Without a terminal (CI, agents, --json) it reports them as pending deletes; pass --prune to archive all of them, or brainbox prune <key> for specific ones. A rename or move gives a file a new key, so the old page becomes a pending delete. Add sourceKey: my-doc to a file's frontmatter to keep one identity across renames.
npx -y @brainbox-labs/cli@latest prune kb%2Fold.md kb%2Fgone.mdWhen a source changes, the Brain diffs the old and new versions and proposes enrich, add and retract changes, applied as guarded soft-archives. A fact a document no longer states does not linger as an orphan in the Domain Model.
Events can contradict what the Brain holds before the next sync. process_event notices and get_index returns staleSignals: elements that recent events keep contradicting. Each element also carries a validity window and a confirmation date, and confirming an element renews it. Review the signals, correct the source, and sync.
| Source | Refresh with | Suggested trigger |
|---|---|---|
| Docs folder or repo | brainbox sync <dir> | On every merge to the docs, or on a schedule |
| Database schema | brainbox ingest <url> | After a migration |
| Meetings, email, tickets | process_event | As each event happens |
| A correction from an agent or person | create_learning | When it is noticed; a person promotes it |
| Metric definitions | sync the glossary, or re-upload dbt artifacts | When a definition changes |