Memory Mason

Capture AI conversations. Build an Obsidian knowledge base. One command.

What It Does
Memory Mason hooks into your AI coding agent and silently captures every conversation into daily Obsidian logs. When you're ready, run /mmc to compile raw logs into structured knowledge articles — concepts, synthesis pages, and MOCs — all interlinked with [[wikilinks]]. Then use /mmq to retrieve answers from your compiled knowledge base without leaving the conversation.
No API key needed. No cloud sync. Everything stays local in your Obsidian vault.
How data flows in
[AI Conversation] ──> [Hook Runtime] ──> [Smart Filter] ──> [Obsidian Vault]
(any agent) (automatic) (6-stage pipe) _raw/YYYY-MM-DD/
Hooks capture prompts, tool results, and session transcripts into daily log files. Before anything reaches your vault, a six-stage filtering pipeline strips noise and protects sensitive data:
- Tag stripping — Removes system-reminder, system-instruction, and other injected tags
- ANSI removal — Strips terminal control characters from tool output
- Event classification — Categorizes each event as error, test result, discovery, exploration, meta, or noise. Exploration and meta events are discarded; errors and test results are always kept.
- Prose compression — Removes filler words and hedging phrases while preserving code blocks, URLs, inline code, and quoted strings
- Sensitive content blocking — Skips capture when input contains credentials, private keys,
.env contents, or paths like .ssh/ and .aws/
- Deduplication — Content-hash check prevents the same data from being written twice within a session
Memory Mason's own commands (/mmc, /mmq, /mml, /mms, /mma, /mmsetup) and namespaced /memory-mason:* forms are automatically excluded from capture.
Raw captures are stored in session-scoped files: _raw/YYYY-MM-DD/{HHMMSS}-{sid8}-{NNN}.md (session start time, 8-char session id prefix, 3-digit chunk index). Each file is capped at 512 KB; a 2 MB hard cap may force a split, marked with a [!continued] callout. One session's prompt→answer exchange never splits across files at the soft cap. Concurrent sessions never interleave. This keeps Obsidian responsive and ensures each file stays within LLM processing limits. No data is lost — every conversation turn is preserved, and Obsidian indexes all chunks for full-text search. The raw tier is append-only by design and is never auto-deleted; archive manually if desired. Token economics (raw vs. stored token counts and savings percentage) are tracked on every capture and reported by /mms, whether or not minimize is enabled — sanitize-only changes (e.g. tag stripping) still count. Enabling minimize adds prose compression on top, increasing savings further. See docs/README.md for technical details on chunked storage.
How knowledge is built
_raw/YYYY-MM-DD/ ──> /mmc compile ──> concepts/
sessions/ (per-session summaries)
atlas/ (MOCs + Bases views)
synthesis/
index.md
Run /mmc to compile daily logs into structured articles. The host LLM reads your raw logs and produces atomic concept pages, MOC navigation pages in atlas/, cross-session synthesis pages, and per-session summary notes in sessions/ — all linked with [[wikilinks]] for Obsidian graph navigation. atlas/bases/ holds Obsidian Bases views (sessions-timeline, decisions, contradictions, seedlings) for timeline queries; Bases requires Obsidian 1.9+.
How knowledge is retrieved
/mmq "How does auth work?" ──> _meta/context.md ──> concepts/ + atlas/ + synthesis/ ──> answer with [[citations]]