aaak-vault-sync
v1.0.4
Published
Sync an Obsidian vault to AAAK memory format for LLM context loading
Downloads
590
Readme
aaak-vault-sync
Sync your Obsidian vault to AAAK format for LLM memory loading. Converts markdown files into compact symbolic summaries that any LLM can scan to load relevant context from your vault.
AAAK encoding is provided by dialect.py from the mempalace project.
How it works
aaak-scanwalks your Obsidian vault and converts each.mdfile to AAAK format usingdialect.py— a lossy summarization that extracts entities, topics, key sentences, emotions, and flags into a token-efficient representation- Output files are written to
$VAULT/aaak/alongside a human/LLM-readable index (aaak_index.md) - A generic prompt template can be used with any LLM to check the index and follow relevant entries to their AAAK summaries (or the original markdown if needed)
- An optional Claude integration can install a skill and CLAUDE.md rule
- A launchd agent (macOS) keeps the index updated hourly in the background
AAAK is lossy — it summarizes, not compresses. The original files are always preserved. AAAK files point back to their source via a SOURCE: header line.
Requirements
- Python 3.7+
- Node.js 14+ (for the CLI shim and setup script)
- macOS (for the launchd scheduler, Linux/Windows users can set up a cron job manually)
- Optional: Claude Code if you want the
/scan-vaultskill and CLAUDE.md memory rule
Installation
npm install -g aaak-vault-syncGlobal install quickstart
npm install -g aaak-vault-sync
export OBSIDIAN_VAULT_PATH=/path/to/your/vault
aaak-setup
aaak-scan --verboseFor Claude Code integration:
aaak-setup --target claudeOr clone and install locally:
git clone https://github.com/yourname/aaak-vault-sync
cd aaak-vault-sync
npm install -g .Setup
1. Set your vault path
Add to your shell profile (~/.zshrc or ~/.bashrc):
export OBSIDIAN_VAULT_PATH=/path/to/your/vaultReload your shell:
source ~/.zshrc2. Run setup
If you installed the package globally, use the global setup command:
aaak-setupIf you're working from a local clone of the repo, you can also use:
npm run setupThis installs two generic things:
| What | Where |
|------|-------|
| launchd agent (hourly sync) | ~/Library/LaunchAgents/com.aaak.vault-sync.plist |
| generic memory-loader prompt | ~/.aaak/generic-memory-loader.md |
Optional Claude integration:
aaak-setup --target claudeFrom a local clone, this also works:
npm run setup -- --target claudeThat also installs:
| What | Where |
|------|-------|
| Claude Code skill (/scan-vault) | ~/.claude/skills/scan-vault/SKILL.md |
| CLAUDE.md memory rule | ~/.claude/CLAUDE.md (appended) |
3. Activate the scheduler
launchctl load ~/Library/LaunchAgents/com.aaak.vault-sync.plist4. Run an initial sync
aaak-scan --verboseThis scans your vault, generates AAAK files in $VAULT/aaak/, and writes both aaak_index.md and aaak_index.json.
Usage
CLI
# Sync new and updated files
aaak-scan
# Show what would change without writing anything
aaak-scan --dry-run
# Verbose output
aaak-scan --verbose
# Force re-scan all files (ignore mtime)
aaak-scan --force
# Combine flags
aaak-scan --dry-run --verboseGeneric LLM integration
After setup, you can use this prompt file with any LLM app that supports system prompts or custom instructions:
~/.aaak/generic-memory-loader.md
That prompt tells the model to:
- Read
$OBSIDIAN_VAULT_PATH/aaak/aaak_index.md - Scan the Topics column for relevant entries
- Read linked AAAK summaries
- Fall back to original markdown via
SOURCE:if needed - Optionally use
aaak_index.jsonfor structured tooling
Claude Code skill
Once setup is complete, invoke from any Claude Code session:
/scan-vaultReports how many files were converted, updated, or skipped.
Memory loading
For any LLM, use the generated prompt file at ~/.aaak/generic-memory-loader.md.
If you installed the Claude integration, every Claude Code session automatically:
- Reads
$OBSIDIAN_VAULT_PATH/aaak/aaak_index.md - Scans the Topics column for entries relevant to the current task
- Reads linked AAAK files for compressed summaries of relevant docs
- Follows
SOURCE:lines to original markdown if full detail is needed
If OBSIDIAN_VAULT_PATH is not set, this step is silently skipped.
Vault output structure
After the first sync, your vault will contain:
your-vault/
└── aaak/
├── aaak_index.md ← LLM-readable index + embedded JSON for sync tracking
├── aaak_index.json ← Tool-friendly structured index
├── entities.json ← Auto-detected proper noun → code mappings
├── note-title.aaak.md ← Compressed AAAK summary of note-title.md
└── folder--nested.aaak.md ← Nested paths use -- as separatorEach .aaak.md file starts with a SOURCE: line pointing back to the original:
SOURCE: projects/my-project.md
?|?|2026-04-07|my-project
0:ALJ+PRF|project_launch_decision|"We decided to launch in Q2"|determ|DECISIONThe aaak_index.md table looks like:
| Source | AAAK | Last Scanned | Topics |
|--------|------|--------------|--------|
| projects/my-project.md | aaak/projects--my-project.aaak.md | 2026-04-07 | project_launch_decision |
AAAK format
AAAK is defined in dialect.py, which is part of mempalace — a broader LLM memory system. The dialect.py included here is sourced from mempalace/dialect.py.
The dialect is a structured symbolic summary:
FILE_NUM|PRIMARY_ENTITY|DATE|TITLE ← Header
ZID:ENTITIES|topic_keywords|"key_quote"|WEIGHT|EMOTIONS|FLAGS ← Zettel
T:ZID<->ZID|label ← Tunnel (connection)
ARC:emotion->emotion->emotion ← Emotional arcEmotion codes: joy, fear, trust, grief, wonder, rage, love, hope, despair, peace, anx, determ, convict, frust, curious, grat, satis, excite, and more.
Flags: ORIGIN, CORE, SENSITIVE, PIVOT, GENESIS, DECISION, TECHNICAL
Any LLM reads AAAK natively — no special decoder required.
Entity detection
aaak-scan automatically detects proper nouns (people, organizations, project names) across your vault and assigns stable 3-character codes:
Alice Johnson→ALJProject Falcon→PRFBob Smith→BOS
Codes are saved to $VAULT/aaak/entities.json and stay stable across runs — new entities are appended, existing codes are never changed.
Configuration
All configuration is via environment variables:
| Variable | Required | Description |
|----------|----------|-------------|
| OBSIDIAN_VAULT_PATH | Yes | Absolute path to your Obsidian vault |
No config files needed. The scanner is intentionally zero-config beyond the vault path.
Scheduling
macOS (launchd)
The setup script installs a launchd agent that runs aaak-scan every hour.
# Check status
launchctl list | grep aaak
# View logs
cat /tmp/aaak-vault-sync.log
cat /tmp/aaak-vault-sync.err
# Stop
launchctl unload ~/Library/LaunchAgents/com.aaak.vault-sync.plist
# Start again
launchctl load ~/Library/LaunchAgents/com.aaak.vault-sync.plistTo change the interval, edit ~/Library/LaunchAgents/com.aaak.vault-sync.plist and update StartInterval (in seconds). Then reload:
launchctl unload ~/Library/LaunchAgents/com.aaak.vault-sync.plist
launchctl load ~/Library/LaunchAgents/com.aaak.vault-sync.plistLinux / Windows (cron)
Add a cron job:
crontab -e0 * * * * OBSIDIAN_VAULT_PATH=/path/to/vault aaak-scan >> /tmp/aaak-vault-sync.log 2>&1Uninstall
# Stop the scheduler
launchctl unload ~/Library/LaunchAgents/com.aaak.vault-sync.plist
rm ~/Library/LaunchAgents/com.aaak.vault-sync.plist
# Remove the Claude skill
rm -rf ~/.claude/skills/scan-vault
# Remove from CLAUDE.md (delete the "## Obsidian Vault Memory" section)
# Then uninstall the package
npm uninstall -g aaak-vault-syncThe $VAULT/aaak/ directory is not removed, so your AAAK files stay in the vault.
Project structure
aaak-vault-sync/
├── bin/
│ ├── aaak-scan.js ← CLI entry point (Node shim → python scan.py)
│ └── aaak-setup.js ← Global setup command
├── scripts/
│ └── setup.js ← Installs plist, skill, CLAUDE.md rule
├── templates/
│ ├── com.aaak.vault-sync.plist.template
│ └── scan-vault-skill.md.template
├── scan.py ← Core vault scanner
├── dialect.py ← AAAK format encoder/decoder
└── package.jsonLicense
MIT
