`obsidian-second-brain`: The Repo That Turns Obsidian Into a Self-Rewriting Memory System

A deep dive into the adapter pattern, anti-fabrication guardrails, and reconciliation loop that keep an AI vault coherent instead of merely full.

11 min read • View on GitHub • More from eugeniughelbur

A mechanical archive turns incoming notes into revised pages. One stream of cards enters from the left, passes through a central reconciliation engine, and emerges on the right as cleaner ledger pages while older pages are kept in circulation rather than discarded. The image explains the repo’s core idea: memory that updates itself instead of only accumulating more text.
The vault is not a drawer. It is a maintenance system that revises its own understanding.
Key Takeaways

A Vault That Rewrites Itself

Most AI note tools are really capture tools. They help you dump more into Obsidian, faster, with a nicer wrapper around the same old accumulation problem. `obsidian-second-brain` is aiming at something sharper: a vault that stays coherent over time, even as new evidence lands and old assumptions age out.

That is the real break from the usual second-brain story. The goal is not a bigger notebook. It is a memory system that can revise itself, protect human edits, and keep a running record of why a claim changed.

The Anti-Clutter Trick: Reconciliation, Not Append

The repo’s core move is to treat new information as something to reconcile against existing pages, not just append beside them. That matters because append-only systems hide contradictions in plain sight. They create a vault that is fuller, but not necessarily truer.

The system does not just ingest evidence. It decides what should change, what should stay, and what should be marked uncertain.

ModelUpdate behaviorContradictionsHuman edit safetyPortability
Append-only second brainAdds another note or another versionHidden in the pileWeak, because the system does not distinguish authorshipHigh, but shallow
Chat-first Obsidian pluginAnswers questions about existing notesUsually surfaced only when askedMedium, because chat and storage stay separateTied to one UI
Karpathy-style LLM WikiBuilds a living knowledge basePartly handled by synthesisBetter than capture tools, but often less explicit about guardrailsConceptual, not always operational
obsidian-second-brainRewrites existing pages when new evidence arrivesSurface and resolve themStrong, because sentinel blocks protect `@user` contentHigh, through adapter-backed commands

An evolution of Karpathy's LLM Wiki pattern: sources rewrite existing pages instead of just appending, contradictions reconcile automatically, and scheduled agents maintain the vault while you sleep.

Why the Repo Is Built Around the AI, Not the Human

The project’s philosophy is blunt: the vault is optimized for future Claude, not for a human skimming the file browser. That sounds unfriendly until you realize what it buys you. It forces notes to become structured retrieval substrates, with preambles, frontmatter, recency markers, and wikilinks that an agent can parse quickly and consistently.

That is why the repo feels less like a note-taking app and more like a knowledge contract. The note is written today for a machine that will read it later, and that machine needs the note to be predictable.

Every note follows an explicit AI-first design rule (preamble, machine-readable frontmatter, recency markers, mandatory wikilinks, sources verbatim) optimized for future-Claude retrieval rather than human reading.

How Sentinel Blocks Prevent the Usual Automation Disaster

The best engineering idea in the repo is the sentinel-safe write model. Generated content lives in an `@generated` block. Human judgment lives in an `@user` block. That split sounds small, but it solves a giant failure mode: automation that silently overwrites the part a person actually cares about.

A close-up Markdown page is divided into protected bands. The top and middle sections are tagged as generated content, while a handwritten user annotation block sits underneath, untouched. A mechanical pen rewrites only the generated section, leaving the human notes visible and intact. The image explains how the repo updates machine-authored text without clobbering manual edits.
Sentinel blocks turn rewriting into a controlled operation instead of a dangerous overwrite.
<!-- @generated:start -->
## Architecture Summary
- New scan data here
- Confidence: high
<!-- @generated:end -->

<!-- @user:start -->
## Notes from the team
- Keep this example intact
- Human context lives here
<!-- @user:end -->

The Adapter Layer Makes One Skill Speak Many Dialects

Once the write model is safe, the next problem is portability. The repo solves that with a neutral `commands/` layer and tool-specific `adapters/` that translate the same intent into Claude Code, Codex CLI, Gemini, and other runtimes. The command is stable. The runtime changes underneath it.

LayerJobWhat changesWhat stays fixed
commands/Defines the intentNothing runtime-specificThe command logic
adapters/Translates for each CLITool names and formattingThe underlying behavior
scripts/Executes research and scansImplementation detailsThe workflow goals
references/Sets the rulesPolicy text and note conventionsThe vault contract

What It Means to Treat Contradiction as a Signal

The repo’s research flow is split between open-web discovery and source-grounded vault work. That split is useful because contradiction becomes legible. If the external web says one thing and the vault says another, the point is not to average them into mush. The point is to inspect the gap.

This is the part many AI second-brain tools miss. They optimize for retrieval and summarization. `obsidian-second-brain` is closer to synthesis with accounting. It keeps track of what came from where, how confident the system is, and whether a claim should be rewritten or just flagged.

TrackPrimary sourceStrengthRisk
Open webPerplexity, Grok, live web pagesFreshnessNoise and inconsistency
Vault-groundedExisting notes and internal contextContinuityStale assumptions
ReconciliationBoth tracks togetherConflict detectionRequires explicit judgment

How It Compares to Other AI Second Brains

The cleanest comparison is not about features, it is about the job each system thinks it is doing. Append-only tools are capture machines. Chat plugins are query surfaces. Karpathy-style wikis are living notes. `obsidian-second-brain` goes one step further and treats the vault as a maintenance system.

Project typePrimary promiseWhat it leaves unresolved
Append-only second brainNever lose an ideaTruth drift and duplicated context
Chat-first Obsidian pluginAsk questions about your notesWhether the notes themselves stay correct
Karpathy-style LLM WikiTurn notes into a living knowledge baseHow to protect human edits and manage contradictions
obsidian-second-brainMaintain a coherent vault over timeThe cost is more structure, but the payoff is less drift

That extra structure is the trade-off. The vault is less casual, less free-form, and more disciplined about format. But if your AI agent is going to keep using the same knowledge base across sessions, that discipline is not overhead. It is the operating system.

Why This Matters Beyond Obsidian

The lesson here is bigger than one repo. If AI is going to live inside our notes, the notes need maintenance semantics. They need boundaries between machine output and human judgment, rules for contradiction, and a way to rewrite stale knowledge without erasing the trail.

That is the real promise of `obsidian-second-brain`. Not a prettier inbox. Not more capture. A memory system that can keep itself honest.