Vault Sync Architecture

The vault must be always current. This doc defines every sync mechanism and how it works.

Data Sources & Sync Status

SourceFolderCountSync MethodFrequencyStatus
Fireflies meetings02-Meetings/208vault_sync_daemon.pyDaily 6AM PST✅ Active
Gmail Nader07-Emails/Nader/~400 filesvault_sync_daemon.pyDaily 6AM PST✅ Active
Gmail Mike07-Emails/Mike/~400 filesvault_sync_daemon.pyDaily 6AM PST✅ Active
Google Calendar (Nader)09-Calendar/Nader/500 eventsvault_sync_daemon.pyDaily 6AM PST✅ Active
Google Calendar (Mike)09-Calendar/Mike/500 eventsvault_sync_daemon.pyDaily 6AM PST✅ Active
GitHub Tickets04-Projects/1,265 ticketsvault_sync_daemon.pyDaily 6AM PST✅ Active
CRM People03-CRM/People/114 notesAgent writes + Apollo syncOn interaction🟡 Partial
CRM Companies03-CRM/Companies/25 notesManual + web researchOn change🟡 Partial
Agent daily logs01-Memory/daily/36 notesAgent writes after each sessionPer session✅ Active
Vault → GitHub → Quartzvault.twill.bizAll filesHourly auto-commit + GitHub ActionHourly✅ Active

Sync Scripts

vault_sync_daemon.py (Primary)

  • Path: /data/.openclaw/workspace/scripts/vault_sync_daemon.py
  • Cron: Daily 6AM PST (vault-daily-sync job)
  • 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 --full flag

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

  1. Calendar ↔ Meeting dedup: Calendar events and Fireflies transcripts should be matched by title + date and cross-linked automatically (partial — title matching exists, not complete)
  2. Person last_contact auto-update: When a new meeting arrives, all attendees’ Person notes should have last_contact updated (code exists in daemon, needs testing)
  3. Apollo → People dedup: 232 people in Twenty CRM not yet merged; Apollo daily sync needs dedup logic
  4. Email → Person linking: When an email thread involves a known contact, their Person note should be updated (planned, not built)
  5. 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:

  1. Before answering a relationship question: Read relevant Person note in 03-CRM/People/
  2. After any interaction: Update last_contact, action_items, next_follow_up on relevant Person notes
  3. After every session: Write summary to 01-Memory/daily/YYYY-MM-DD.md
  4. Hourly cron handles git push — agents just write files, cron handles sync

Dedup Logic

When adding a new Person note:

  1. Search by email (exact match in frontmatter)
  2. Search by name (fuzzy match on filename)
  3. If match found: update existing note, don’t create duplicate
  4. The vault_sync_daemon.py includes 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.