← Reports

Knowledge Architecture

SecondBrain + GBrain + PKA Vault + System Wiki — unified view as of 2026-04-21

What changed 2026-04-21 (Memory Unification Sessions 1–3): Auto-memory split from per-device (mac/luci/mike/) to per-persona (lucienne/luci/) · Auto-memories now enter GBrain (old invariant retired) · vault.db demoted to secondary, retiring mid-May (4-week parallel run) · Query order consolidated into canonical Rule 14 (4-step stack) · Extractor made portable: PKA_ROOT + PKA_MEMORY_PERSONA env vars · pka-sync.sh now imports curated + auto memories into GBrain · CLAUDE.md trimmed 68% (38KB → 12KB), verbose sections moved to wiki · New wiki pages: projects.md, cowork-integration.md
System Topology — 2026-04-21
Elmar Obsidian + mobile (Obsidian Sync) Lucienne (Mac) Chief of Staff · owns vault.db Luci (Hetzner) Project Manager · owns mc.db GBrain PRIMARY RETRIEVAL · 5,776 pages · ~/.gbrain/ SecondBrain ~/cowork/SecondBrain/ SB Wiki (compiled) SecondBrain/wiki/ · 73 pages PKA Vault vault.db (retiring) · ~/PKA/Vault/ Auto-Memory auto/lucienne/ + auto/luci/ System Wiki ./wiki/ · Atlas owns mc.db (Luci) tickets · runs · heartbeats Vault MCP Server secondary · merges vault.db + mc.db Git sync every 15 min browses local Mac Telegram query (PRIMARY) compile ingest all .mds NEW: pka-sync system-doc owns (retiring) writes HTTP API
SecondBrain
~/cowork/SecondBrain/
Elmar's Obsidian vault — the raw knowledge lake. ~4,650 .md files. Capture first, synthesise later.
Key folders
  • Meetings/ 211+ dated notes (transcribed)
  • sources/ email-attachments, exco, family-docs, imports
  • wiki/ 73 compiled pages (projects + people)
  • ideas/, inbox/ quick capture
Auto-ingestion pipelines
  • exco-sync — Mac LaunchAgent, daily 10:00 SAST
  • sources-sync — Mac LaunchAgent, daily 10:15 SAST
  • email-attachment-sync — Luci, daily 7am SAST
  • dream cycle — Luci, 2am SAST (detect stale + recompile)
  • pka-sync — Mac, every 15 min (feeds GBrain)
Sync
  • Mac auto-commits every 15 min via LaunchAgent
  • Luci pulls every 15 min via cowork-sync task
  • Repo: conrelma/local-cowork (private)
GBrain PRIMARY
~/.gbrain/brain.pglite · 5,776 pages
PGLite + pgvector. Adopted 2026-04-17. Beats vault.db FTS on 4/5 classes, +18% nDCG@5, ~1000× faster. Now indexes everything including auto-memories.
A/B Scorecard
Person queriesGBrain +51% R@5
FinancialGBrain +46% R@5
TemporalGBrain +18%
Entity relationGBrain +40% R@5
Decision recallPKA +44% nDCG (synthesis)
Latency p95<50ms vs 38s
What GBrain indexes (5 sources) CHANGED
  • All SecondBrain .md files (~4,650 files, recursive)
  • PKA system wiki pages (type: system-doc)
  • PKA docs (type: project-doc)
  • Curated memories (Vault/memory/*.md) NEW
  • Auto-memories (auto/lucienne/ + auto/luci/) NEW
Integration
  • MCP: mcp__gbrain__query (primary tool)
  • Sync: com.gbrain.pka-sync LaunchAgent every 15 min
  • Retrieval: RRF hybrid (vector + keyword + multi-query)
  • Embed: OpenAI API (~/gbrain/.env), ~$0.02/machine
PKA Vault RETIRING MID-MAY
~/PKA/Vault/
vault.db is now secondary. 4-week parallel run, then Session 4 deletes index.py, schema.sql, vault.db. Markdown files remain source of truth.
Contents
  • vault.db SQLite — files, edges, FTS5 (retiring)
  • memory/ ~44 curated reference files
  • memory/auto/lucienne/ 206 session memories CHANGED
  • memory/auto/luci/ Luci sessions (populates next session) CHANGED
  • tasks/ YAML frontmatter tasks
  • workspace/ live running workspaces
Two-DB split (unchanged)
  • vault.db — Lucienne owns (rebuildable, retiring)
  • mc.db — Luci owns (Hetzner); tickets, task_runs, heartbeats
  • Vault MCP merges both via HTTP API
Session 4 (mid-May): what gets deleted
  • index.py, session_indexer.py, schema.sql, vault.db
  • vault_mcp.py shrinks to MC proxy (2 tools)
  • dashboard.py rewrites to flat files + GBrain
Auto-Memory CHANGED
Vault/memory/auto/{persona}/
Per-persona split (not per-device). Synced via git. Now ingested into GBrain — old "never enters GBrain" invariant retired 2026-04-21.
Persona directories
lucienne/
All Lucienne machines (Mac, XPS, Mac Mini, Cloud). autoMemoryDirectory: ./Vault/memory/auto/lucienne/
luci/
Luci on Hetzner. Absolute path: /home/lucienne/workspace/PKA/Vault/memory/auto/luci/
Write sources
  • Claude Code built-in memory (mid-session saves)
  • session-memory-extractor.py — SessionStart hook, headless Haiku
  • Env vars: PKA_ROOT, PKA_MEMORY_PERSONA NEW
GBrain integration NEW
  • pka-sync.sh imports both auto/lucienne/ and auto/luci/
  • Embedded alongside curated memories and wiki pages
  • Searchable via mcp__gbrain__query
System Wiki + Atlas
~/PKA/wiki/ · 18 pages
Atlas (Systems Architect) owns the wiki. First voice before PKA system changes, last voice after. Wiki pages indexed in GBrain as type: system-doc.
Wiki pages
  • pka-system.md system overview
  • memory-system.md architecture, invariant flip
  • auto-memory.md persona-split design
  • secondbrain-how-it-works.md 3-layer architecture
  • dashboard.md PKA dashboard vs Luci
  • team.md dispatch model, council, roster
  • projects.md SafairBru + LegalMind NEW
  • cowork-integration.md CoWork + SB patterns NEW
  • infrastructure.md, mission-control.md, repos-and-sync.md, ...
Atlas dispatch model
  • Brief — first voice before any PKA system change
  • Sign-off — last voice after dev loop; wiki updated before return
  • Explain — "how does X work?" dispatched to Atlas
  • Monthly review: first session of each month, all 4 council models
Query Order (Rule 14) CHANGED
Canonical 4-step stack — all retrieval follows this
Consolidated from 3 contradictory blocks into one canonical rule. GBrain is step 2 (primary); vault.db is step 3 (secondary, retiring).
  1. Claude's native auto-memory — session context, MEMORY.md
  2. GBrainmcp__gbrain__query. SB, wiki, docs, curated + auto memories. Primary.
  3. Flat-file / vault.dbmcp__vault__memory_search. Structured queries, stale checks. Secondary (retiring).
  4. Luci MC API — tickets, heartbeats, task_runs, scheduler status.
Routing exceptions
  • PKA system questions → dispatch Atlas (Explain mode)
  • Complex multi-type recall → memory-manager skill
Skills (API Layer)
Interface between agents and vaults. Agents call skills, not edit markdown directly.
/brainQuick capture → classifies into SB
/meeting-notesAudio → transcript → structured note with wikilinks
/wiki-compilervault.db + sources → synthesized wiki pages (feeds GBrain)
/wiki-ingestPDF/DOCX → markdown in sources/ → indexed
/wiki-queryThin GBrain adapter — calls gbrain.query()
/memory-managerRetrieve-before-answer. Searches vault + GBrain before any claim.
/sources-syncYAML-driven folder watcher → SB as markdown
/email-indexSQLite on Luci, 2,026 emails, 23 projects
Actors & Transport
Who reads, who writes, how data moves.
Elmar
Browses SecondBrain via Obsidian. Messages Luci via Telegram when Lucienne is offline.
Lucienne (Mac)
Chief of Staff. Queries GBrain (primary). Owns vault.db (retiring). Dispatches Atlas, Luci, Scott, Tessa. Does not touch mc.db.
Luci (Hetzner)
Project Manager. Owns mc.db. Reads vault.db via git pull (read-only). Runs dream cycle, email-sync, scheduler. Her dashboard is separate.
Atlas (subagent)
Systems Architect. Owns ./wiki/. First + last voice on PKA system changes. Reads all wiki pages on every dispatch.
Git repos
  • conrelma/local-cowork → SecondBrain vault
  • conrelma/PKA → vault.db, memory/, wiki/ (15-min sync)
  • conrelma/claude → ~/.claude/ (vault, skills, hooks)
Key Data Flows
How information moves through the system (2026-04-21 state).
1
Capture
Elmar records meeting → Luci transcribes (Gemini) → /meeting-notes structures it → dream cycle recompiles wiki page overnight → pka-sync pushes to GBrain within 15 min.
SecondBrain/Meetings/YYYY-MM-DD-*.md
2
Retrieval
Elmar asks Lucienne about a project/person. She calls mcp__gbrain__query() → RRF hybrid returns ranked chunks with citations in <1s. No waterfall. No file-reading loop.
GBrain → compiled-truth pages score 0.90-0.97
3
Document Ingest
PDF/DOCX → markitdown or Gemini vision → markdown in sources/ → dream cycle compiles → pka-sync pushes to GBrain.
sources/ → SecondBrain → GBrain
4
Memory Creation CHANGED
Session ends → extractor runs at next SessionStart (Haiku) → writes to auto/{persona}/ → git sync propagates → pka-sync imports to GBrain. Searchable via gbrain.query() within 30 min.
auto/lucienne/ or auto/luci/ → GBrain
5
System Change
Atlas brief → dev loop (architect → developer → QA → reviewer) → Atlas sign-off → wiki updated → GBrain picks up wiki change on next sync.
./wiki/ updated before Atlas returns
6
Ops Data
Luci writes mc.db. Lucienne reads via Vault MCP activity_log + luci_status tools, which call MC API at port 3001 transparently.
mc.db → HTTP API :3001 → Vault MCP → Lucienne
Source of Truth
Markdown files
Primary Retrieval
GBrain (5,776 pages)
Secondary (retiring)
vault.db → delete mid-May
Auto-Memory Split
Per-persona (lucienne + luci)
System Changes
Atlas brief → dev → sign-off