Built by @HR-909 · Based on Karpathy's LLM-Wiki pattern · Powered by MemPalace + Claude Code
Every time you start a new Claude conversation, it forgets everything.
You spend 10 minutes re-explaining your project. You paste the same context over and over. You hit token limits. You lose decisions made in previous sessions.
This architecture fixes all of that.
A three-layer knowledge system where Claude maintains a self-compounding wiki from your raw notes — and remembers everything across every conversation, forever.
_raw/ ← Your sources (articles, PDFs, notes) — you collect, never modified
wiki/ ← Claude-compiled wiki — auto-generated, interlinked, compounding
Your folders/ ← Your project structure — augmented by AI, owned by you
The key insight (from Andrej Karpathy):
Instead of searching raw files on every query (RAG), compile knowledge once into an interconnected wiki. Every answer enriches the wiki. The system gets smarter with every session.
You drop an article into _raw/inbox/
↓
/ingest → Claude reads it, identifies entities and concepts
↓
Creates/updates pages in wiki/ with [[wikilinks]]
↓
Logs the operation to wiki/log.md
↓
Next time you ask a question → Claude reads the compiled wiki
↓
Gives a cited, synthesized answer in seconds
↓
Updates the wiki with the new Q&A (compounding)
Result: Knowledge that genuinely accumulates. The system is smarter on day 100 than day 1.
| Layer | Folder | Owner | Purpose |
|---|---|---|---|
| Raw Sources | _raw/ |
You | Immutable archive of original content |
| Compiled Wiki | wiki/ |
Claude | Synthesized, interlinked knowledge base |
| Projects | 10_Projects/ etc. |
You | Active work, augmented by AI |
| Discovery | MemPalace (local) | Auto | Semantic search, 96.6% recall, $0/month |
| Operator | Claude Code | AI | Reads vault, runs commands, writes wiki |
| Interface | Obsidian | You | Visual browser, graph view, editing |
- L1 (CLAUDE.md, ~600 tokens) — Critical rules loaded every session
- L2 (wiki/, queried on demand) — Deep knowledge, zero idle token cost
This keeps startup context lean while giving Claude access to everything.
Every claim in the wiki is tagged for confidence:
| Tag | Meaning | When to use |
|---|---|---|
^[extracted] |
Direct from source | Default — verbatim facts |
^[inferred] |
Claude synthesis | Connections across sources |
^[ambiguous] |
Sources disagree | Flag for your review |
^[verified] |
You confirmed it | Highest confidence |
This prevents hallucinations from propagating silently.
| Command | What it does |
|---|---|
/ingest [folder] |
Compile any folder into the wiki |
/query [question] |
Search compiled knowledge, get cited answers |
/lint |
Find orphans, contradictions, stale content |
/morning |
Daily briefing — priorities, open questions, status |
/session-end [topic] |
Log session, update wiki, surface open questions |
- Mac or Linux (Windows: use WSL)
- Obsidian installed
- Claude Pro or Max subscription
curl -fsSL https://claude.ai/install.sh | bash
# Open new terminal window, then authenticate
claude
# Follow browser login promptpip3 install mempalaceIf you get "command not found" after install:
# Find where pip installed it
python3 -m site --user-base
# Add to PATH (replace 3.x with your Python version)
echo 'export PATH="$HOME/Library/Python/3.x/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc# Navigate to your vault
cd /path/to/your/obsidian/vault
# Clone the template
git clone https://github.com/HR-909/memory-architecture-template.git .
# Or if vault already has files, copy manually:
# git clone https://github.com/HR-909/memory-architecture-template.git /tmp/template
# cp -r /tmp/template/. .Open CLAUDE.md in Obsidian and fill in:
- Your name and role
- Your active projects
- Your hard constraints (rules Claude must never break)
- Your tech stack
This is the most important step. The more specific you are, the smarter Claude becomes.
# In your vault directory
mempalace init .
# Follow the interactive prompts:
# - Remove fake entities detected
# - Add your real project names
# - Accept the room structure
# Index your existing content
mempalace mine .claude mcp add mempalace -- python3 -m mempalace.mcp_servergit init
git add .
git commit -m "Memory architecture initialized"
# Create private repo on GitHub and push
# (keep your vault private — this template is public)cd /path/to/your/vault
claudeInside Claude Code:
Do you have access to MemPalace tools? List all tools available to you.
You should see MemPalace listed with ~29 tools.
Then drop an article into _raw/inbox/ and run:
/ingest
Watch your wiki build itself in real time.
cd /path/to/vault
claude
/morningDrop anything useful into _raw/inbox/:
- Web articles (copy/paste)
- PDFs (drag in)
- Meeting notes (type directly)
- Voice transcripts (paste)
/ingest
Processes everything in inbox, compiles to wiki, auto-links.
/session-end what-you-worked-on
Creates session log, updates wiki, surfaces open questions.
/lint
Review the health report. Fix contradictions, merge duplicates, update stale content.
vault/
├── _raw/ ← Layer 1: Immutable sources
│ ├── articles/ ← Processed web articles
│ ├── pdfs/ ← PDFs and documents
│ ├── transcripts/ ← Meeting notes, voice memos
│ ├── screenshots/ ← Visual references
│ └── inbox/ ← Drop zone (process with /ingest)
│
├── wiki/ ← Layer 2: Claude-compiled
│ ├── entities/ ← People, companies, products
│ ├── concepts/ ← Ideas, patterns, frameworks
│ ├── sources/ ← One summary per ingested source
│ ├── syntheses/ ← Cross-cutting analyses
│ ├── questions/ ← Open questions to resolve
│ └── log.md ← Append-only operation log
│
├── .claude/
│ └── commands/ ← Slash commands
│ ├── ingest.md
│ ├── query.md
│ ├── lint.md
│ ├── morning.md
│ └── session-end.md
│
├── 99_System/
│ └── Templates/ ← Note templates
│
├── CLAUDE.md ← Master instructions (L1 cache)
├── mempalace.yaml ← MemPalace configuration
└── .gitignore ← Excludes personal data
Install these via Settings → Community Plugins:
| Plugin | Why |
|---|---|
| Templater | Dynamic templates with dates |
| Dataview | Query your vault like a database |
| Calendar | Visual daily notes |
| Graph view | Visualize wiki connections |
echo 'export PATH="$HOME/Library/Python/3.9/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcsource ~/.zshrc
# or open a new terminal window# Re-add the MCP connection
claude mcp add mempalace -- python3 -m mempalace.mcp_server
# Then restart claude/lint
Review the report and apply suggested fixes.
git log --oneline -10 # See recent changes
git checkout HEAD~1 -- wiki/ # Restore wiki to previous stateEverything is modular. You can:
- Add new slash commands → create
.mdfiles in.claude/commands/ - Add new MemPalace wings → edit
mempalace.yaml - Change schema rules → edit
CLAUDE.md - Swap MemPalace → replace with Mem0, ChromaDB direct, or Pinecone
- Change editor → Obsidian, Logseq, VS Code — all work with plain markdown
The data is always just markdown files. Nothing locks you in.
This architecture is built on:
- Andrej Karpathy's LLM-Wiki pattern — The foundational insight: compilation over retrieval
- MemPalace — Local semantic search with 96.6% recall
- Claude Code by Anthropic — The AI operator
- Obsidian — The interface and graph viewer
MIT — use freely, adapt for your needs, share with attribution.
Built and maintained by @HR-909