1 / 14
🤖 Reghar · Chief of Staff

Ragnar’s AI System

Chief of Staff Architecture

🤖 12 Agents ⏰ 74+ Cron Jobs 🔒 3 Isolated Groups 🔍 3 QMD Instances 🚀 4 Live Projects 💰 Claude Max €200/mo
🧭 Architecture · Slide 2

System Philosophy

01
🏛 Chief of Staff Pattern
One agent (Reghar) owns all routing, gatekeeping, and synthesis. Specialists never reach Ragnar directly — all output passes through the CoS quality gate first.
02
✍ Write Boundaries
Every agent has clearly scoped write permissions. No agent writes outside its lane. Changes touching 3+ agents require a diagram update before execution.
03
♻ Idempotency
All operations are safely retried. Crons check state before acting. File writes are atomic. Deploy scripts verify current state before applying changes.
04
📋 Report-Back Rule
Every spawned agent must report back — completed, partially done, or timed out. Going silent is a failure mode. All spawn prompts include this mandate explicitly.
05
🔬 First Principles
Before any system change: (1) What outcome? (2) Simplest path? (3) What assumption makes this unnecessary? “Why not do nothing?” before every new system.
🏢 Structure · Slide 3

Org Chart

graph TD RAGNAR["Ragnar Human Principal"]:::human REGHAR["Reghar Chief of Staff"]:::cos RAGNAR --> REGHAR PIP["Pip Ops Monitoring"]:::cpip SIGRID["Sigrid Research"]:::csig INKWELL["Inkwell Writer"]:::cink KODEX["Kodex Developer"]:::ckodex DAIS["Dais Designer"]:::cdais MECHANIC["Mechanic Emergency"]:::cmech REGHAR --> PIP REGHAR --> SIGRID REGHAR --> INKWELL REGHAR --> KODEX REGHAR --> DAIS REGHAR --> MECHANIC subgraph NOLEA["Nolea Group Camilla ISOLATED"] VESSEL["Vessel Orchestrator"]:::orch ANSELME["Anselme"]:::agent2 MARGOT["Margot"]:::agent2 VESSEL --> ANSELME VESSEL --> MARGOT end subgraph LEON["Leon Group Leon ISOLATED"] CHARLES["Charles Orchestrator"]:::orch2 KEVING["Kevin-G"]:::agent3 COSTCO["Costco Guy"]:::agent3 CHARLES --> KEVING CHARLES --> COSTCO end REGHAR -.->|Bridge only| VESSEL REGHAR -.->|Bridge only| CHARLES classDef human fill:#1a1200,stroke:#f5a623,stroke-width:2px,color:#f5a623 classDef cos fill:#1a1200,stroke:#f5a623,stroke-width:3px,color:#fff,font-weight:bold classDef cpip fill:#0f1525,stroke:#60a5fa,color:#90bcf8 classDef csig fill:#180f25,stroke:#a78bfa,color:#c4b5fd classDef cink fill:#0f1a18,stroke:#2dd4bf,color:#5eead4 classDef ckodex fill:#1a0f0f,stroke:#f87171,color:#fca5a5 classDef cdais fill:#1a1500,stroke:#fbbf24,color:#fde68a classDef cmech fill:#1a1a1a,stroke:#9ca3af,color:#d1d5db classDef orch fill:#0f1a0f,stroke:#4ade80,stroke-width:2px,color:#4ade80 classDef orch2 fill:#1a0f05,stroke:#f97316,stroke-width:2px,color:#f97316 classDef agent2 fill:#0a1a10,stroke:#2d5a3a,color:#7de0a4 classDef agent3 fill:#1a0f05,stroke:#5a3a1a,color:#f9b87a
🔒 Cross-group isolation enforced — Leon ↔ Nolea BLOCKED. Only Reghar bridges groups, and only on Ragnar's instruction.
🚦 Routing · Slide 4

Agent Routing

flowchart TD R["Ragnar Sends Request"]:::input REG["Reghar Receives and Classifies"]:::cos Q1{"Task longer than 2 min?"}:::decision Q2{"Specialist work?"}:::decision BG["Spawn Background non-blocking"]:::action QUAL["Reghar Quality Gate all output passes here"]:::gate KODEX["Kodex Code Config"]:::spec SIGRID["Sigrid Research"]:::spec INKWELL["Inkwell Writing"]:::spec DAIS["Dais Design"]:::spec MECH["Mechanic Emergency"]:::spec R --> REG REG --> Q1 Q1 -->|Yes| BG Q1 -->|No| Q2 BG --> Q2 Q2 -->|Code or Config| KODEX Q2 -->|Research| SIGRID Q2 -->|Writing| INKWELL Q2 -->|Design| DAIS Q2 -->|Emergency| MECH KODEX --> QUAL SIGRID --> QUAL INKWELL --> QUAL DAIS --> QUAL MECH --> QUAL QUAL --> R classDef input fill:#1a1200,stroke:#f5a623,stroke-width:2px,color:#f5a623 classDef cos fill:#1a1200,stroke:#f5a623,stroke-width:3px,color:#fff classDef decision fill:#1a1500,stroke:#888,color:#ccc classDef action fill:#0f0f1a,stroke:#60a5fa,color:#60a5fa classDef gate fill:#0a1a0a,stroke:#4ade80,stroke-width:2px,color:#4ade80 classDef spec fill:#141414,stroke:#444,color:#ccc
🧠 Agent Lifecycle · Slide 5

How an Agent Works

Spawn
🧠Load Context
Execute
📁Write Output
📋Report Back
💤Session Ends
🔴 No Persistent MemoryWhen a session ends, in-memory state is completely wiped. There is no RAM carry-over between runs.
🟢 But Files PersistAgents compensate via the file system. Everything meaningful is written before session ends.
📦 Files Read at Session Start
🧭 SOUL.md + AGENTS.mdIdentity, rules, routing contracts — loaded every session.
📚 MEMORY.md + knowledge/Strategic decisions and hard-won learnings from prior sessions.
🔍 QMD vsearchSemantic search across all indexed files. Surfaces relevant prior context on demand.
📝 working-buffer.mdMax 30-line recovery doc written at 60% context. Read first on next spawn.
🔄 Memory Continuity Cycle
🔵 Session A — Executes
Writes memory/YYYY-MM-DD.md
Activity log for the day
📖
Writes SYSTEM/LEARNINGS.md
Hard-won fixes and patterns
🤝
Writes handoff-YYYY-MM-DD.md
Blockers and context for next session
💡
Promotes to knowledge/
Durable cross-session findings
RAM wiped
Files persist
QMD indexes at 03:00 CET
🟢 Session B — Reads
📚
Reads MEMORY.md
Strategic decisions, max 120 lines
📋
Reads handoff-YYYY-MM-DD.md
Picks up blockers from Session A
🔍
QMD vsearch on task
Finds what Session A learned
Continuity achieved
Session B “knows” what Session A did
💬 Coordination · Slide 6

Agent Coordination

📋 Blackboard (SystemDB) = the ONLY inter-agent communication channel. No direct agent-to-agent messaging.
flowchart LR AGENTA["Agent A completes work"]:::agent BB["Blackboard SystemDB
python3 libs/systemdb.py bb write"]:::bb REGHAR["Reghar reads inbox
classifies and routes"]:::cos AGENTB["Agent B receives task"]:::agent BLOCKED["BLOCKED
Leon to Nolea
Direct Link"]:::blocked AGENTA -->|"bb write --to reghar"| BB BB -->|"bb read --agent reghar"| REGHAR REGHAR -->|"bb write --to agentB"| BB BB -->|"bb read --agent agentB"| AGENTB BLOCKED -. "CANNOT COMMUNICATE" .-> BLOCKED classDef agent fill:#141414,stroke:#444,color:#ccc classDef bb fill:#1a1500,stroke:#f5a623,stroke-width:2px,color:#f5a623 classDef cos fill:#1a1200,stroke:#f5a623,stroke-width:3px,color:#fff classDef blocked fill:#1a0505,stroke:#e05252,stroke-width:2px,color:#e05252
📋 Blackboard Commandsbb write --to <agent> --from <you> --task "..." --priority normal --intent action
bb read --agent <you>
bb done --id <N>
🔴 Cross-Group RuleLeon group ↔ Nolea group: PERMANENTLY BLOCKED. No direct communication ever. Reghar is the only permitted bridge, and only when Ragnar instructs it.
📨 Intent Typesaction — do this task
review — Ragnar must decide
fyi — no action needed
🔍 Knowledge · Slide 7

QMD Knowledge System

graph TB subgraph T1["Tier 1 System Always Searched"] WS["workspace"]:::t1 WSS["workspace-system"]:::t1 end subgraph T2["Tier 2 Domain Agent Default"] MEM["memory"]:::t2 WK["workspace-knowledge"]:::t2 SK["sigrid-knowledge"]:::t2 SKILLS["skills"]:::t2 end subgraph T3["Tier 3 Deep Reference On Demand"] SO["sigrid-output"]:::t3 IO["inkwell-output"]:::t3 EA["email archives"]:::t3 CRM["CRM code"]:::t3 end subgraph CORE["Core QMD Instance default"] T1 T2 T3 end subgraph NOLEA_QMD["Nolea QMD Instance ISOLATED"] VK["vessel-knowledge"]:::nolea CEM["camilla-emails-intressanta"]:::nolea MK["margot-knowledge"]:::nolea end subgraph LEON_QMD["Leon QMD Instance ISOLATED"] CK["charles-knowledge"]:::leon CP["charles-projects"]:::leon end CRON["Daily Index 03:00 CET"]:::cron CRON --> CORE CRON --> NOLEA_QMD CRON --> LEON_QMD classDef t1 fill:#1a1500,stroke:#f5a623,stroke-width:2px,color:#f5a623 classDef t2 fill:#0f1525,stroke:#60a5fa,color:#60a5fa classDef t3 fill:#141414,stroke:#555,color:#aaa classDef nolea fill:#0a1a10,stroke:#4ade80,color:#4ade80 classDef leon fill:#1a0a10,stroke:#a78bfa,color:#a78bfa classDef cron fill:#1a1000,stroke:#f5a623,stroke-dasharray:5 5,color:#f5a623
💻 Core Usageqmd vsearch "topic" --collection workspace -n 5
Always use vsearch not query (avoids GPU OOM)
🚢 Nolea InstanceXDG_CONFIG_HOME=.../Vessel/qmd/config XDG_CACHE_HOME=.../Vessel/qmd/cache qmd vsearch "topic" -n 5
🧠 Memory · Slide 8

Memory & Knowledge Flow

flowchart TD ACT["Daily Activity"]:::input DAILY["memory/YYYY-MM-DD.md
Activity log one-liners"]:::mem CONSOL["MEMORY.md strategic
max 120 lines nightly consolidation"]:::mem HAND["memory/handoff-YYYY-MM-DD.md
Blockers for next session"]:::mem LEARN["SYSTEM/LEARNINGS.md
Hard-won fixes all agents"]:::know AGENT_K["agents/core/agentname/knowledge/
Per-agent durable learnings"]:::know BUF["memory/working-buffer.md
Context recovery max 30 lines"]:::buf QMD["QMD indexes all
daily at 03:00 CET"]:::qmd ACT --> DAILY DAILY --> CONSOL ACT --> HAND ACT --> LEARN LEARN --> AGENT_K BUF -->|"written at 60% context"| BUF DAILY --> QMD CONSOL --> QMD LEARN --> QMD AGENT_K --> QMD classDef input fill:#1a1200,stroke:#f5a623,color:#f5a623 classDef mem fill:#0f1525,stroke:#60a5fa,color:#90bcf8 classDef know fill:#0a1a10,stroke:#4ade80,color:#7de0a4 classDef buf fill:#1a0505,stroke:#e05252,color:#f08080 classDef qmd fill:#1a1500,stroke:#f5a623,stroke-width:2px,color:#f5a623
📅 Daily Log FormatAppend one-liner after every major task: - HH:MM — [what happened]. EOD cron reads this at 22:15 CET.
📖 Learnings RuleIf you fixed it, you log it. Symptom / Root cause / Fix / Date. Reghar logs to SYSTEM/LEARNINGS.md. Sub-agents log to their own knowledge dir.
📝 WAL ProtocolBefore responding to any correction, number, or critical ID from Ragnar — write it to working-buffer.md FIRST, then respond.
⏰ Operations · Slide 9

Cron & Heartbeat System

74+
Total Cron Jobs
30m
Pip Watchdog Interval
08-22
Watchdog Active Window CET
21:45
EOD Summary Start
flowchart LR subgraph FLEET["Cron Fleet 74+ Jobs"] PIP["Pip Watchdog
every 30 min 08-22 CET"]:::cron EOD["EOD Summary
21:45-22:15 CET"]:::cron DOCTOR["Weekly Doctor
Sunday"]:::cron QMD["QMD Index
03:00 CET daily"]:::cron OTHERS["Business crons
Nolea Leon ATG"]:::cron end subgraph OUTPUTS["Output Routing"] HEART["#heartbeats
Info and reports"]:::info TG["Telegram
Urgent items"]:::urgent YOURCALL["#your-call
Decisions for Ragnar"]:::decision end PIP -->|health ok| HEART PIP -->|agent down| TG EOD --> HEART DOCTOR -->|issues found| YOURCALL OTHERS --> HEART classDef cron fill:#1a1200,stroke:#f5a623,color:#f5a623 classDef info fill:#0f1525,stroke:#60a5fa,color:#90bcf8 classDef urgent fill:#1a0505,stroke:#e05252,color:#f08080 classDef decision fill:#1a1500,stroke:#fbbf24,color:#fde68a
🚨 Escalation Rules3 consecutive cron errors: auto-spawn Kodex. Same request 3 times: flag as Automation Candidate to #your-call.
📋 CRON-REGISTRY.mdSource of truth for all cron jobs. Read before adding or modifying any cron. Never add a cron without updating the registry.
⚖ Decisions · Slide 10

Decision Routing

flowchart TD NEW["New item arrives"]:::input REGHAR["Reghar classifies"]:::cos Q1{"Ragnar must decide?"}:::decision Q2{"Is it a code or config change?"}:::decision Q3{"Reversible change?"}:::decision TG["Telegram Decisions Topic
-1003705013070 thread 6
with inline buttons"]:::urgent YC["Discord #your-call
simultaneously"]:::urgent HEART["Discord #heartbeats
Informational reports"]:::info KODEX["Kodex review gate
REQUIRED before deploy"]:::gate ACT70["Act at 70% info
move fast"]:::action WRITE["Write thinking first
then act"]:::caution NEW --> REGHAR REGHAR --> Q1 Q1 -->|Yes| TG TG --> YC Q1 -->|No informational| HEART Q1 -->|Code change| Q2 Q2 -->|Yes| KODEX KODEX --> Q3 Q3 -->|Reversible| ACT70 Q3 -->|Irreversible| WRITE classDef input fill:#1a1200,stroke:#f5a623,color:#f5a623 classDef cos fill:#1a1200,stroke:#f5a623,stroke-width:3px,color:#fff classDef decision fill:#1a1500,stroke:#888,color:#ccc classDef urgent fill:#1a0505,stroke:#e05252,stroke-width:2px,color:#e05252 classDef info fill:#0f1525,stroke:#60a5fa,color:#90bcf8 classDef gate fill:#1a1500,stroke:#fbbf24,stroke-width:2px,color:#fde68a classDef action fill:#0a1a0a,stroke:#4ade80,color:#7de0a4 classDef caution fill:#1a0a00,stroke:#f97316,color:#f97316
🔴 Inline Buttons RequiredAny Telegram message containing "Want me to...", "Should I...", "Approve?", "Proceed?" MUST include inline buttons. Min: Yes / No / Defer.
⏳ Defer is MandatoryAll polls and approval gates must include a Defer option. Reghar never votes in polls.
🗂 Structure · Slide 11

Workspace File Tree

~/.openclaw/
├─ workspace/                    ← Reghar root
│  ├─ SOUL.md                   Identity + rules
│  ├─ AGENTS.md                 Agent contracts + routing
│  ├─ MEMORY.md                 Strategic decisions (max 120 lines)
│  ├─ TOOLS.md                  Environment reference
│  ├─ SYSTEM/                   System reference docs
│  │  ├─ SYSTEM-MASTER.md      L0 single source of truth
│  │  ├─ LEARNINGS.md          Hard-won fixes
│  │  ├─ CHANNEL-REGISTRY.md   Discord channel IDs
│  │  ├─ QMD-ARCHITECTURE.md   Vector search spec
│  │  └─ MODEL-PROFILES.md     Model stack + fleet profiles
│  ├─ memory/                   Daily logs + handoffs
│  │  ├─ YYYY-MM-DD.md         Daily activity log
│  │  ├─ handoff-YYYY-MM-DD.md Handoff to next session
│  │  ├─ working-buffer.md     Context recovery (max 30 lines)
│  │  └─ errors_recent.md      Failure index
│  ├─ knowledge/                Promoted cross-agent findings
│  ├─ scripts/                  Utility scripts (PII check etc)
│  └─ skills/                   Installed agent skills
├─ agents/core/                  ← Agent workspaces
│  ├─ sigrid/knowledge/         Durable research findings
│  ├─ inkwell/knowledge/        Writing style + templates
│  ├─ kodex/knowledge/          Dev patterns + learnings
│  ├─ dais/knowledge/           Design system + deploy patterns
│  └─ pip/                      Ops monitoring state
├─ users/Camilla/                ← Nolea group (ISOLATED)
│  └─ Vessel/                   Nolea orchestrator workspace
│     ├─ qmd/                   Nolea QMD instance
│     └─ nolea/anselme/         Anselme agent workspace
├─ users/Leon/                   ← Leon group (ISOLATED)
│  └─ Charles/                  Leon orchestrator workspace
│     ├─ qmd/                   Leon QMD instance
│     └─ nordic-webpartner/     Leon business agents
└─ projects/                     ← Active builds
   ├─ nolea-homepage/           Nolea site source
   ├─ atg-horse-racing/         ATG paper trading
   └─ mission-control/          Mission Control dashboard
🚀 Projects · Slide 12

Active Projects

Live
🗄 Nolea CRM
Cloudflare Workers + D1 + Pages
1,109 contacts 58 paying clients Live in production
Paper Trading
🐎 ATG Horse Racing
Python + Amarillo agent + ATG API
Paper trading live 500-trade gate for real money Amarillo agent active
Live
📈 Yahoo Terminal
Cloudflare Pages + vanilla JS
9 analysis panels yahoo-terminal.pages.dev
Tunnel Broken
🗺 Mission Control
Cloudflare Pages + Cloudflare Tunnel
Pages: live mc.reghar.dev: tunnel broken
📊 Models · Slide 13

Model Stack

🟠 Claude Max
€200/mo — OAuth, no token billing
claude-sonnet-4-6 claude-haiku-4-5 claude-opus-4-6
Primary • All agents
🟢 ChatGPT Plus
$20/mo — OAuth, weekly cap
gpt-5.4 via Codex CLI
Secondary • Codex agent
⚪ API Fallbacks
OpenAI API + OpenRouter ~$89 + DeepInfra $50 + NVIDIA free
openrouter deepinfra nvidia free
Fallback tiers
🚗 Fleet Profiles
🟠 Normal
All Claude via Claude Max subscription. Default mode. All agents on Sonnet 4.6.
💰 Cost-Saving
DeepSeek for most tasks. Claude only for complex reasoning or final output.
🚨 Emergency
Full pivot to OpenRouter or DeepInfra. Used when Claude API is down or rate-limited.
🛡 Safety · Slide 14

Safety Rules

🔴Never Do
openclaw gateway stop / restart / doctor --fix
rm -rf anything — always use trash instead
Uncontrolled external API writes
Deploy without Kodex review gate
Block main thread for tasks over 60 seconds
Post reports to #your-call (decisions only)
Always Do
Kodex review before ANY code or config deploy
trash over rm for all file deletions
API keys to ~/.zshrc immediately, never hardcoded
Report back — completed, partial, or timed out
Backup irreversible changes before applying
Write thinking first for irreversible decisions
🔒Cross-Group Rules
Leon group to Nolea group: PERMANENTLY BLOCKED
Only Reghar may bridge groups
Bridging only on Ragnar's explicit instruction
No Camilla context leaks to Leon and vice versa
Check context leakage before Discord posts
🤖ACP + Exec Rules
sessions_spawn: always mode run, never mode session
Exec over 60s: always background or spawn, never block
Outbound PII check before any external send
Inline buttons required on all Telegram approval gates
Defer always present in polls — Reghar never votes