Vault Sync Architecture
The vault must be always current. This doc defines every sync mechanism and how it works.
Data Sources & Sync Status
| Source | Folder | Count | Sync Method | Frequency | Status |
|---|---|---|---|---|---|
| Fireflies meetings | 02-Meetings/ | 208 | vault_sync_daemon.py | Daily 6AM PST | ✅ Active |
| Gmail Nader | 07-Emails/Nader/ | ~400 files | vault_sync_daemon.py | Daily 6AM PST | ✅ Active |
| Gmail Mike | 07-Emails/Mike/ | ~400 files | vault_sync_daemon.py | Daily 6AM PST | ✅ Active |
| Google Calendar (Nader) | 09-Calendar/Nader/ | 500 events | vault_sync_daemon.py | Daily 6AM PST | ✅ Active |
| Google Calendar (Mike) | 09-Calendar/Mike/ | 500 events | vault_sync_daemon.py | Daily 6AM PST | ✅ Active |
| GitHub Tickets | 04-Projects/ | 1,265 tickets | vault_sync_daemon.py | Daily 6AM PST | ✅ Active |
| CRM People | 03-CRM/People/ | 114 notes | Agent writes + Apollo sync | On interaction | 🟡 Partial |
| CRM Companies | 03-CRM/Companies/ | 25 notes | Manual + web research | On change | 🟡 Partial |
| Agent daily logs | 01-Memory/daily/ | 36 notes | Agent writes after each session | Per session | ✅ Active |
| Vault → GitHub → Quartz | vault.twill.biz | All files | Hourly auto-commit + GitHub Action | Hourly | ✅ Active |
Sync Scripts
vault_sync_daemon.py (Primary)
- Path:
/data/.openclaw/workspace/scripts/vault_sync_daemon.py - Cron: Daily 6AM PST (
vault-daily-syncjob) - Sources: Fireflies, Gmail (Nader + Mike), GitHub tickets, Apollo people
- No token burn — pure code, no agent turns required
- Run manually:
cd /data/.openclaw/workspace && python3 scripts/vault_sync_daemon.py --source all - Full backfill: Add
--fullflag
vault_enrich.py (One-time enrichment)
- Path:
/data/.openclaw/workspace/scripts/vault_enrich.py - Purpose: Research company notes, fix tags, add processor data
Auto-commit cron (755bbc17)
- Every 60 minutes:
git add -A && git commit && git push - Triggers GitHub Action on push → Quartz rebuild → vault.twill.biz updated
What Still Needs Work
- Calendar ↔ Meeting dedup: Calendar events and Fireflies transcripts should be matched by title + date and cross-linked automatically (partial — title matching exists, not complete)
- Person
last_contactauto-update: When a new meeting arrives, all attendees’ Person notes should havelast_contactupdated (code exists in daemon, needs testing) - Apollo → People dedup: 232 people in Twenty CRM not yet merged; Apollo daily sync needs dedup logic
- Email → Person linking: When an email thread involves a known contact, their Person note should be updated (planned, not built)
- Calendar → Daily Note: Morning auto-generation of daily note with today’s meetings + follow-ups (capability #2, not yet built)
Agent Protocol (Read-before-Write)
Every agent MUST:
- Before answering a relationship question: Read relevant Person note in
03-CRM/People/ - After any interaction: Update
last_contact,action_items,next_follow_upon relevant Person notes - After every session: Write summary to
01-Memory/daily/YYYY-MM-DD.md - Hourly cron handles git push — agents just write files, cron handles sync
Dedup Logic
When adding a new Person note:
- Search by email (exact match in frontmatter)
- Search by name (fuzzy match on filename)
- If match found: update existing note, don’t create duplicate
- The
vault_sync_daemon.pyincludes dedup by email for Apollo imports
Obsidian = Morty’s Brain
The vault is not a document store. It’s a living memory system:
- Every meeting → note with full transcript + attendee links
- Every email thread → note with preview + sender wikilink
- Every person → note with relationship context + action items
- Every company → note with research + integration status
- Every ticket → note with status + context + related people
When Morty reads the vault before answering, the answer quality scales directly with vault completeness. The more agents write back after each interaction, the smarter every subsequent answer becomes.