System Overview
Components
Context Hub
The central coordination daemon. Runs locally on a port (default 4360).- Memory database — SQLite with 349+ indexed memories, semantic embeddings, graph edges
- Event bus — MAP (Multiplayer Agent Protocol) events for agent coordination
- Periodic indexer — Indexes journal entries every 60s, code headers every 5 min, auto-backfills embeddings
- API server — REST endpoints for memory, events, context, eval
Journal System
Append-only JSONL files that capture everything that happens:- Features, fixes, decisions, discoveries
- Session starts and ends
- Pivots (context checkpoints)
- Agent actions and outcomes
Memory System
Hybrid search combining lexical (BM25+) and semantic (embeddings):- 349+ memories with
text-embedding-3-smallembeddings - Graph edges: updates, contradicts, related_to, caused_by, part_of
- Code header indexing:
@purposeannotations → searchable knowledge - Reciprocal Rank Fusion for combining lexical and semantic results
Eval System
Bash or TypeScript scripts that measure real metrics:eval/test-coverage.sh— jest--coveragepercentageeval/code-quality.sh— console.logs,anyusage, @purpose coverageeval/product-metrics.sh— startup speed, session reliability, hub uptimeeval/cli-speed.sh— p90 command latency
Peter Parker
Meta-orchestrator that coordinates the nightly improvement loop:- Mines training tuples from journals
- Synthesizes product context
- Uses Stratus for strategic reasoning (which agents to run)
- Runs agents with budgeted rounds
- Picks up kanban backlog items
Policy Head
14M-parameter transformer (4-layer, 512 hidden, 8 heads) trained on the training buffer:- Input: system state (scores, trajectories, agent history)
- Output: predicted reward for each candidate action
- Trained on MPS (Apple Silicon), retrained nightly when 50+ new tuples
Flow Engine
YAML-defined automation flows:- Cron triggers (every 30 min, daily)
- Event triggers (eval:scored, kanban:pickup)
- Actions: commands, journal entries, agent spawns
- Gates: approval requirements, cooldowns, iteration limits
Subway Mesh
P2P agent coordination via WebSocket relay:- Agents register as
name.relay - Send/receive messages, RPC calls
- Pub/sub topics for broadcasts
- Enables multi-agent coordination across machines
File Structure
Local-First
Everything runs on your machine. No cloud dependency:- Context Hub is a local daemon
- Memory is SQLite
- Training data is JSONL files
- Policy head trains on MPS/CPU
- Git is the transport layer