Personal knowledge base compiled from AI conversations. Inspired by Andrej Karpathy's LLM Knowledge Base.
Персональная база знаний, автоматически компилируемая из разговоров с AI. Без RAG, без embeddings — только структурированный markdown и LLM-компилятор.
Система из трёх компонентов:
- Compiler — хуки Claude Code, которые автоматически записывают знания из каждой сессии
- Skills — 14 навыков для работы с вики (обновление, запрос, линтинг, экспорт)
- Vault — Obsidian-совместимое хранилище знаний (markdown + wikilinks)
git clone https://github.com/sergeyramas/memory-karpathy.git
cd memory-karpathy
chmod +x setup.sh
./setup.shSetup script:
- Creates
~/.obsidian-wiki/configpointing to vault location - Installs compiler hooks into
~/.claude/settings.json - Symlinks skills to
~/.claude/skills/ - Sets up Python environment for compiler scripts
You work with Claude Code
↓
[SessionStart] injects knowledge index into conversation
↓
You work, make decisions, learn things
↓
[SessionEnd] captures conversation → flush.py extracts knowledge
↓
daily/YYYY-MM-DD.md (daily log) gets new entries
↓
[After 18:00] compile.py → knowledge articles in vault
↓
Next session — knowledge is injected again (cycle repeats)
# Compile daily logs into knowledge articles
cd compiler && uv run python scripts/compile.py
# Ask a question to the knowledge base
cd compiler && uv run python scripts/query.py "How does the purchase bot work?"
# Lint the knowledge base
cd compiler && uv run python scripts/lint.py --structural-only
# Sync current project to wiki (inside Claude Code)
/wiki-update
# Query wiki from Claude Code
/wiki-query "What patterns did we use?"The vault is pure markdown with [[wikilinks]]. Open the vault/ directory as an Obsidian vault for:
- Graph view (visual connections between concepts)
- Backlinks (automatic reverse linking)
- Search (full-text across all knowledge)
- Templates (in
_templates/)
Each project gets:
AGENTS.md— instructions for AI agentswiki/symlink — points to local vault path
# Local machine
ln -s "/Users/user/Obsidian Vault/obsidian-ramos" ~/project/wiki
# VPS
ln -s /root/obsidian-ramos ~/project/wikiThe rule ./wiki/index.md works everywhere. See docs/symlink-pattern.md.
- Read
vault/index.md— this is the retrieval mechanism - Based on task, identify relevant articles from the index
- Read those articles for full context
- After work, update the vault using the
wiki-updateskill
vault/
├── index.md ← READ THIS FIRST (master catalog)
├── log.md ← Build history
├── .manifest.json ← Ingestion tracking
├── concepts/ ← Atomic knowledge (bugs, patterns, decisions)
├── entities/ ← People, tools, services
├── skills/ ← Reusable how-tos
├── projects/ ← Per-project overviews
│ ├── ebay-automation/ ← eBay dropshipping system
│ └── betaline/ ← AI landing page
└── synthesis/ ← Cross-project insights
Every page has YAML frontmatter with: title, category, tags, sources, summary, provenance, created, updated.
Use [[wikilinks]] for cross-references. Use provenance markers: ^[extracted], ^[inferred], ^[ambiguous].
| Command | What it does |
|---|---|
/wiki-update |
Sync current project knowledge to vault |
/wiki-query "question" |
Ask the knowledge base |
/wiki-lint |
Run health checks |
/wiki-status |
Show what changed since last sync |
Hooks in compiler/hooks/ fire automatically:
- SessionStart → injects
index.md+ recent daily log as context - SessionEnd → captures transcript, spawns
flush.pybackground process - PreCompact → same as SessionEnd, fires before auto-compaction
- Write in encyclopedia style — factual, concise
- Every article links to 2+ related articles
- Sources always trace back to daily logs or project files
- No RAG — index-guided retrieval at personal scale (50-500 articles)
| Operation | Cost |
|---|---|
| Memory flush (per session) | ~$0.02-0.05 |
| Compile one daily log | ~$0.45-0.65 |
| Query (no file-back) | ~$0.15-0.25 |
| Structural lint | Free |
| Full lint (with LLM) | ~$0.15-0.25 |
- Python 3.12+
- uv — Python package manager
- Claude Code — CLI tool
claude-agent-sdk >= 0.1.29- Obsidian (optional, for visual browsing)
No API key needed — uses Claude Code's built-in credentials.
MIT