Obsidian Mind: Persistent Memory for AI Coding Agents

By Prahlad Menon 2 min read

AI coding agents are powerful. They’re also goldfish.

Every session starts fresh. No memory of your goals, your team, your patterns, your wins. You re-explain the same architecture decisions. You lose context from three conversations ago. The knowledge never compounds.

Obsidian Mind fixes this. It’s an open-source Obsidian vault that gives your coding agent a brain.

What It Actually Does

Start a session:

You: "start session"
Agent: *reads North Star, checks active projects, scans recent memories*
Agent: "You're working on Project Alpha, blocked on the BE contract.
       Last session you decided to split the coordinator. Your 1:1
       with your manager is tomorrow — review brief is ready."

Brain dump after a meeting:

/om-dump Just had a 1:1 with Sarah. She's happy with the auth work but wants
us to add error monitoring before release. Also, Tom mentioned the cache
migration is deferred to Q2 — we decided to focus on the API contract first.

The agent then:

  • Updates org/people/Sarah Chen.md with meeting context
  • Creates work/1-1/Sarah 2026-03-26.md with key takeaways
  • Creates a Decision Record: “Defer Redis migration to Q2”
  • Adds to perf/Brag Doc.md: “Auth architecture praised by manager”
  • Updates work/active/Auth Refactor.md with error monitoring task

One brain dump. Five linked notes. Zero manual filing.

The Architecture

The vault structure is purpose-built for agent memory:

brain/           # Topic notes (persistent knowledge)
├── North Star.md    # Your goals and priorities
├── people/          # Person notes
└── topics/          # Domain knowledge

work/            # Active projects
├── active/          # Current work
├── 1-1/            # Meeting notes
└── decisions/       # ADRs

perf/            # Performance tracking
├── Brag Doc.md      # Wins and achievements
└── reviews/         # Review prep

Five lifecycle hooks handle routing automatically:

HookWhenWhat
SessionStartOn startupInjects North Star, active projects, recent changes, tasks
UserPromptSubmitEvery messageClassifies content (decision, incident, win, 1:1)
PostToolUseAfter writing .mdValidates frontmatter, enforces linking
PreCompactBefore context compactionBacks up session transcript
StopEnd of sessionRuns hygiene checks, finds uncaptured wins

QMD: Semantic Search That Runs Locally

The secret sauce is QMD integration. Three small models run locally (~2.2GB total):

ModelSizeJob
embeddinggemma-300M~328MBTurns notes into vectors
qmd-query-expansion-1.7B~1.28GBRewrites queries into better search terms
Qwen3-Reranker-0.6B~640MBReorders results by relevance

No API key. No per-query cost. Works offline. GPU acceleration when available.

So “what did we decide about caching” finds the note titled “Redis Migration ADR” — even when they share no keywords.

Cross-Repo Access via MCP

Here’s what makes this genuinely useful: you can query your vault from ANY repo.

Register the vault as an MCP server:

claude mcp add --scope user om node "/path/to/vault/.claude/scripts/om-mcp.mjs"

Now your coding session in some random project can search your notes, read decisions, follow the link graph, and record what it learned back into the vault.

The MCP tools:

  • search — Find notes by meaning
  • expand — Show a note’s links and backlinks
  • recall — Return durable lessons scoped to a project
  • remember — Store a new lesson
  • record_work — File what happened

Brag Doc Automation

The brag-spotter subagent runs during wrap-up and finds uncaptured wins:

You: "wrap up"
Agent: *verifies all notes have links*
Agent: *updates indexes*
Agent: *scans for wins you didn't log*
Agent: "Found potential brag doc entry: 'Reduced API latency by 40%'
        from your commit messages. Add it?"

Performance review season becomes “open the brag doc” instead of “frantically search Slack history.”

Multi-Agent Support

Works with:

  • Claude Code — Full support (hooks, commands, subagents)
  • Codex CLI — Hooks via .codex/hooks.json
  • Gemini CLI — Hooks via .gemini/settings.json
  • Cursor/Windsurf — Reads AGENTS.md

The vault conventions are agent-agnostic. Pure Markdown, TypeScript, and shell.

Installation

Via ShardMind (recommended):

npm install -g shardmind
mkdir my-vault && cd my-vault
shardmind install github:breferrari/obsidian-mind

The wizard collects your name, organization, and goals, then personalizes brain/North Star.md.

Or clone directly:

git clone https://github.com/breferrari/obsidian-mind.git

Then fill in brain/North Star.md manually.

How This Compares to Built-in Memory

Claude Code has ~/.claude/MEMORY.md. It’s an auto-loaded file. But:

  • It’s not linked to anything
  • It doesn’t survive machine changes
  • It’s not searchable by meaning
  • It’s not part of a knowledge graph

Obsidian Mind uses MEMORY.md as an index pointing to vault locations. The actual knowledge lives in the linked graph, browsable in Obsidian, searchable via QMD, portable across machines.

The Token Cost Question

The vault doesn’t dump everything into context. Tiered loading:

TierWhatWhenCost
AlwaysNorth Star excerpt, git summary, tasksSession startBudget-capped
On-demandQMD search resultsWhen neededTargeted
TriggeredClassification hintsEvery message~100 tokens
TriggeredValidationAfter .md writes~200 tokens
RareFull file readsExplicit requestVariable

SessionStart loads lightweight context. An injection-size meter shows what it cost. Budget enforcement degrades gracefully when you exceed it.

Who This Is For

  • You use Claude Code/Codex/Gemini CLI daily
  • You’re tired of re-explaining context
  • You already live in Obsidian (or want to)
  • You care about performance reviews (brag doc automation)
  • You want decisions to compound, not vanish

Your agent finally has a brain. Use it.