7.3 KiB
kind, vault_name, schema_version
| kind | vault_name | schema_version |
|---|---|---|
| brain-manual | Hermes | 1 |
Brain — operating manual
Brain is the observing-memory layer of Open Second Brain. It records what the user likes and dislikes by watching what they accept and reject, then distils that into rules the next agent session can read and apply.
Read this file at the start of every session that may write to the vault.
Cross-reference: Projects/OpenSecondBrain/Plan if the vault carries the
design notes.
Layout
Brain/
_brain.yaml # configuration; hand-editable
_BRAIN.md # this file
inbox/ # raw signals captured during work
processed/ # signals already folded into a preference
preferences/ # active rules (unconfirmed or confirmed)
retired/ # superseded / expired / rebutted / rejected rules
log/ # daily ledger of every state change
bases/ # Obsidian Bases views (projects/people/tasks/daily)
.snapshots/ # pre-`dream` archives for rollback
bases/*.base are native Obsidian structured views over the Brain
collections (entities, obligations, log) — no Dataview plugin required.
They are inert scaffolding: never hand-edit them as a data source.
The directory a note sits in encodes its lifecycle state. The frontmatter
status field duplicates it for convenience. o2b brain doctor reports
mismatches.
Lifecycle of one preference
inbox/sig-* dream unconfirmed
(taste signal) ───► (cluster) ───► preferences/pref-*
│
apply-evidence (applied) ─────┤
▼
confirmed
│
no evidence within window ───────►│
rebuttal signals reach threshold ─┤
stale_evidence_days passed ──────►│
o2b brain reject ────────────────►▼
retired/ret-*
Promotion happens automatically when N positive same-topic signals
accumulate (_brain.yaml: dream.candidate_threshold, default 3). First
real-work application flips a preference from unconfirmed to
confirmed. No human approval step exists in the default loop.
When to call brain_feedback
After a taste signal — the user accepted or rejected a stylistic choice, a structural decision, a tone, a naming convention.
- Sign:
positive(user liked it) ornegative(user pushed back). topicis the dedup anchor: sametopicaccumulates toward promotion. Pick a stable, hyphenated slug (no-internal-abbrev, notabbreviations).principleis one short imperative sentence — what rule should emerge.- Skip pure preferences with no action attached, idle banter, and
repeated agreement on a topic that already has an active preference
(the next
dreamrun notes the redundancy automatically).
When to call brain_apply_evidence
After producing a durable artifact whose form was governed by an active preference. Two outcomes:
applied— the artifact followed the rule.violated— the artifact contradicted it (rare, but record it; the log keeps both columns).
The preference argument is the wikilink target (pref-no-internal-abbrev),
the artifact argument is the wikilink to the produced note / file /
PR / message. Confirmation, confidence, and retire eligibility are
recomputed by the next dream run from log evidence — there is no
separate "promote" call.
Apply-evidence is only meaningful for confirmed preferences and for
unconfirmed ones that the artifact actually exercised. Stay quiet
otherwise — noise drowns the signal.
dream — the batch pass
dream is the one mutating operation. It is deterministic given inputs
and --now. It:
- groups signals by topic, promotes those that cross the threshold;
- recomputes
applied_count/violated_count/last_evidence_atfromlog/; - flips first-applied unconfirmed prefs to confirmed;
- retires expired, stale, rebutted, or user-rejected prefs;
- moves consumed signals into
inbox/processed/; - archives Brain into
.snapshots/<run_id>.tar.zstbefore mutating; - appends one summary entry to
log/<today>.mdif anything changed.
Rerunning dream without new inputs is a no-op (including in the log).
Schedule it on a cron with confidence — duplicate runs do not pollute.
What NOT to do
- Do not hand-edit files under
log/— they are append-only ledgers.dream,apply-evidence,feedback, and the CLI escape hatches are the only writers. - Do not rename preference or signal files. The
idfield is duplicated in frontmatter to survivemv, but slugs are stable for a reason; changing them breaks every wikilink and every log reference. - Do not write into
.snapshots/.dreamproduces archives there;o2b brain rollbackconsumes them; nothing else touches the directory. - Do not edit files in
retired/to undo a retirement. The reason is preserved on purpose; a rule that should return becomes a new preference withsupersedes: [[ret-...]]. - Brain operations stay scoped to
Brain/. User-authored notes (daily journals, etc.) are read-only inputs whose folders are listed in_brain.yaml:notes.read_paths; the agent never writes there. - Do not invent topics. Reuse an existing topic slug if the rule space
is the same;
dreamcollapses near-duplicates only by exact match.
Escape hatches
These are CLI-only, intended for rare manual intervention. Do not call them as part of normal agent work.
o2b brain reject <pref-id>— explicit user-driven retirement. Moves the preference toretired/with reasonuser-rejected. A pinned preference requires--yesand prints a warning.o2b brain rollback <run_id>— restore Brain from a snapshot. Interactive by default;--listenumerates available snapshots. From v0.10.6 a snapshot ships with a sha256 sidecar manifest so rollback aborts when the live tree drifted from the snapshot moment; pass--force-rollbackto override.o2b brain pin <pref-id>/unpin <pref-id>— protect a preference from automatic retirement (still subject to explicit reject).o2b brain upgrade— migrate the release-owned files (_brain.yaml,_BRAIN.md) forward when a new open-second-brain version ships.--dry-run(default) prints a per-file plan;--applyrewrites the files after taking a snapshot namedupgrade-<ts>.o2b brain export --format json|llms-txt— read-only dump of active preferences (confirmed | unconfirmed | quarantine) for backup, prompt injection, or sharing.
The full CLI surface is documented in docs/plans/2026-05-15-brain-observing-memory.md
section 9; the MCP tool surface mirrors it for the most common verbs
(brain_feedback, brain_apply_evidence, brain_dream, brain_brief,
brain_query, brain_doctor).
Reading order for a new agent
- This file (
Brain/_BRAIN.md). Brain/_brain.yamlfor threshold values currently in effect.Brain/preferences/for active rules;confirmedfirst, thenunconfirmed(in trial).Brain/retired/only when checking why a rule no longer applies.
Brain is filesystem-first. A cp -r Brain/ is a complete backup; a
git diff shows the exact state delta. Trust the files.