Skip to main content

AI Memory Vault

A unified Obsidian-based memory architecture that synchronises rules, context, and project knowledge across every AI coding agent on the machine via MCP.

  • AI Systems Design
  • Developer Tooling
  • Knowledge Architecture
  • Automation
AI Memory Vault knowledge graph visualization

The Problem

You use 7 different AI coding agents: Claude Code, Cursor, Windsurf, Gemini, GitHub Copilot, Kiro, and Antigravity. Each has isolated memory. Rules, project context, and hard-won lessons live in separate silos. You repeat explanations across tools. Context is lost between sessions. Knowledge doesn't compound.

The Solution: Unified Memory

A single Obsidian vault fed by a Node.js sync engine. All agents read from this source of truth. Rules propagate outward. Memory flows back inward. Sessions are exported as readable markdown. Every agent stays in sync.

Rules Flow Outward: Edit AGENTS.md once in the vault. Run sync-memory.mjs. The script propagates rules to Claude Code (~/.claude/CLAUDE.md), Cursor (~/.cursor/rules/), Windsurf (~/.windsurf/memories/), Gemini, Copilot, and Kiro automatically.

Memory Flows Back Inward: When an agent writes to its local memory directory, directory junctions instantly mirror changes into the vault. No manual sync needed.

Sessions Exported: Chat transcripts (.jsonl) are converted to readable markdown and organized by project in sessions/. Searchable, citable, permanent.

Live MCP Access: All MCP-capable agents (Claude, Cursor, Windsurf, Gemini, Antigravity) access the vault live via Obsidian's Local REST API. Real-time reads and writes.

AI Memory architecture diagram showing sync flows and agent integrations

Architecture

Vault Root: ~/AI-Memory — the single source of truth. Organized by rules (global + language/domain-scoped), memory (cross-project facts), projects (per-project context), and sessions (exported transcripts).

Sync Engine: sync-memory.mjs runs on demand or in --watch mode. It reads rules from the vault and writes to all 7 agent config locations. Supports --project and --dry-run flags for safety.

Directory Junctions: Project memory at ~/.claude/projects/*/memory/ appears in the vault via Windows directory junctions. Bidirectional sync at the filesystem level.

MCP Server: Obsidian Local REST API (port 27123 HTTP, 27124 HTTPS). Agents authenticate with API key and read/write markdown files live. No file watcher needed.

Global Rules (AGENTS.md) — Edit once, syncs to all agents. Includes TypeScript conventions, Azure deployment rules, and universal coding practices.

Scoped Rules (languages/, domains/) — Language-specific (TypeScript, Python) and domain-specific (Azure, Kubernetes) rules. Appended by the sync script.

Project Memory — User profile, feedback, project context, and references. Lives in projects/*/memory/. Junctioned for instant bidirectional sync.

Session Exports — Chat transcripts converted to markdown with INDEX.md dashboard. Organized by project and date. Fully searchable in Obsidian.

Key Features

Multi-Agent Sync: All 7 agents read the same rules. No conflicts, no stale data.

Bidirectional Memory Flow: Agents write local memory → junctions mirror to vault. Vault edits → agents see changes instantly.

Session Preservation: All chat transcripts exported to readable markdown. Build a searchable knowledge base over time.

Watch Mode: Run sync-memory.mjs --watch and changes propagate immediately. Development and deployment integrated.

Per-Project Isolation: Each project has its own memory directory. Rules are global; context is local. Best of both worlds.

Implementation Details

Scripts: sync-memory.mjs (sync rules), link-claude-project.ps1 (migrate memory), register-mcp.mjs (wire up Obsidian MCP), export-sessions.mjs (convert transcripts).

Agent Integrations: Claude Code reads ~/.claude/CLAUDE.md via @import. Cursor uses ~/.cursor/rules/. Windsurf reads ~/.windsurf/memories/. Gemini, Copilot, Kiro, Antigravity each have dedicated rule files.

Runtime: Node.js 18+. Uses file system APIs for junctions (Windows) and POSIX symlinks (Mac/Linux). No external database needed.

Results

✅ Vault live with 9 exported sessions and 3 projects fully migrated. ✅ All agents connected via MCP and receiving synced rules. ✅ Rules propagate in seconds. ✅ Project memory mirrors bidirectionally. ✅ Sessions searchable in Obsidian. ✅ No vendor lock-in — everything is markdown and Node.js scripts.

Why This Matters

AI agents are powerful but stateless. Each starts fresh. By building unified memory infrastructure, you keep context alive across tools, sessions, and projects. Rules compound. Knowledge grows. Your AI assistants become smarter and more coherent over time — because they remember.