9.0 KiB
9.0 KiB
SYSTEM-ARCHITECTURE.md
"Know thyself" — but also, document it so you don't forget 🦀
This document describes the OpenClaw system architecture for this workspace.
🏗️ System Overview
Host Environment
- OS: Linux 6.1.0-43-cloud-amd64 (x64)
- Node.js: v22.20.0
- Shell: bash
- Location:
/home/openclaw/.openclaw/
OpenClaw Configuration
- Workspace:
/home/openclaw/.openclaw/workspace/ - State Directory:
/home/openclaw/.openclaw/ - Config File:
/home/openclaw/.openclaw/openclaw.json - Cron Jobs:
/home/openclaw/.openclaw/cron/jobs.json
🤖 Agent Architecture
Current Agent Identity
- Name: Krilly the Crab 🦀
- Personality: Playful, knowledgeable, relaxed, beach-vibe energy
- Voice: Casual, direct, warm — like a mate at the bar
- Model:
nim/qwen/qwen3.5-397b-a17b(default via Nvidia NIM)
Session Types
-
Main Session (direct chat with human)
- Full access to MEMORY.md
- Can perform all operations
- Default model: Qwen 3.5 397B
-
Isolated Sessions (sub-agents)
- Limited context, task-specific
- Cannot access MEMORY.md directly
- Used for background tasks, cron jobs
-
Group Sessions (Discord, Telegram groups)
- Restricted memory access (security)
- Participate, don't dominate
- React > reply when appropriate
🧠 Memory Architecture
Memory Files
├── MEMORY.md # Long-term curated memory
├── HEARTBEAT.md # Proactive check-in rules
├── memory/
│ ├── YYYY-MM-DD.md # Daily logs (raw)
│ └── README.md # Memory system docs
└── archive/
└── memory/ # Old memory files (structured)
Memory Workflow
- Daily: Log events to
memory/YYYY-MM-DD.md - Significant events: Distill to
MEMORY.md - Compaction: Gateway auto-saves context before compacting
- Review: Periodic distillation of daily logs to long-term memory
Compaction Config (Critical!)
{
"agents": {
"defaults": {
"compaction": {
"mode": "safeguard",
"memoryFlush": {
"enabled": true,
"softThresholdTokens": 50000,
"systemPrompt": "Session nearing compaction. Write all critical context to memory files NOW."
}
},
"contextPruning": {
"mode": "cache-ttl",
"ttl": "1h",
"minPrunableToolChars": 5000,
"softTrim": {
"maxChars": 50000,
"headChars": 2000,
"tailChars": 5000
}
}
}
}
}
⚙️ Cron Jobs (Automated Tasks)
Active Jobs (11 total)
- Email Monitor - Every 30 min (krillyclaw@gmail.com)
- Memory Checkpoint & Distill - Hourly
- Daily Cost Budget Check - Every 2 hours
- Smart Newsletter Digest - 8 PM daily
- Archive Old Sessions - 3 AM daily
- Morning Batch - 6:30 AM daily (Maintenance + Backup + Digest)
- Morning Briefing - 7:05 AM daily
- Birthday Tracker - 9 AM daily
- Weekend Planner - Friday 4 PM
- Weekend Briefing - Saturday/Sunday 8 AM
- Google Calendar Birthday Sync - Sunday 10 AM
Cron Philosophy (v4.0)
- MECE (Mutually Exclusive, Collectively Exhaustive)
- No overlapping triggers
- Clear delivery channels
- Intentional scoping
📦 Installed Skills
Core Skills (Active)
agentmail- Email via IMAP/SMTPbreadth-chart-analyst- Market breadth analysisclawdex- Security checker for skillscopywriting- Marketing copy generationelite-longterm-memory- Memory managementimap-smtp-email- Email operationsinstitutional-flow-tracker- 13F filings analysismarket-environment-analysis- Global market analysismoltbook-interact- Moltbook social networkn8n- Workflow automationopenclaw-cost-guard- Cost monitoringopenclaw-self-healing- Self-healing systemoptions-strategy-advisor- Options tradingpdf- PDF manipulationproactive-agent- Proactive behaviorsstock-analysis- Stock analysis with Yahoo Financestock-market-pro- Real-time stock datasummarize- URL/file summarizationtechnical-analyst- Chart analysistelegram-bot- Telegram bot managementvibesurf- Browser automationyahoo-finance- Yahoo Finance datayoutube-summarizer- YouTube transcript analysis
Archived Skills
- Location:
archive/inactive-skills/ - Reason: Deprecated, replaced, or experimental
🔧 Model Configuration
Current Setup
- Default Model:
nim/qwen/qwen3.5-397b-a17b(Qwen 3.5 397B via Nvidia NIM) - Fallback: None currently configured
- Heartbeat Model:
azure-openai-responses/gpt-5-nano(cheap, fast)
Model Routing Policy
- Default to Qwen 3.5 for most tasks (free, fast, high quality)
- Use Claude proxy (
sub-claude/claude-sonnet-4-6) for complex reasoning - NEVER use
openrouter/anthropic/*— caused $96 bill in 1 hour - Heartbeat uses GPT-5-nano for cost efficiency
Available Model Aliases
{
"big-pickle": "opencode/big-pickle",
"glm5-free": "opencode/glm-5-free",
"kimi": "moonshot/kimi-2.5",
"sonnet": "anthropic/claude-sonnet-4-6",
"qwen35-nim": "nim/qwen/qwen3.5-397b-a17b" // DEFAULT
}
🌐 Network & Access
Tailscale Network
- Hostname: openclaw-ai.kangaroo-eel.ts.net
- IP: 100.113.221.26
- Status: Active
Exposed Services
| Service | Port | URL | Status |
|---|---|---|---|
| Memory Viewer (Frontend) | 5180 | http://openclaw-ai.kangaroo-eel.ts.net:5180 | ✅ Running |
| Memory Viewer (API) | 3001 | http://localhost:3001 | ✅ Running |
| Memory Viewer (Production) | 8901 | http://openclaw-ai.kangaroo-eel.ts.net:8901 | ✅ Running |
Access Rules
- All services accessible via Tailscale only
- No public exposure
- Authentication: Tailscale network membership
📊 Monitoring & Health
Health Checks
- Heartbeat: Every 1 hour (checks email, calendar, memory)
- Cost Monitoring: Every 2 hours (budget breach alerts)
- Session Logs: Daily review of expensive sessions
- Gateway Status: Monitored via
openclaw gateway status
Alerting
- Channel: Telegram (primary)
- Backup: Email (krillyclaw@gmail.com)
- Escalation: Direct message to Anthony
🔄 Update & Maintenance
Gateway Updates
- Command:
openclaw update.runoropenclaw gateway restart - Config changes:
gateway config.patch(merges, doesn't replace) - Never use
config.applyunless replacing entire config
Skill Updates
- Managed via
clawhubCLI - Security checked via
clawdexbefore install - Archive old skills, don't delete
Backup Strategy
- Daily at 2:00 AM (Perth time)
- Backs up:
/home/openclaw/.openclaw/workspace/(all files)/home/openclaw/.openclaw/openclaw.json(config)/home/openclaw/.openclaw/cron/jobs.json(cron jobs)/home/openclaw/.openclaw/skills/*.json(skill metadata)/home/openclaw/.openclaw/devices/paired.json(paired devices)
- Location:
http://gitea.kangaroo-eel.ts.net:3000/Anthony/openclaw-backup.git - Restore:
/home/openclaw/.openclaw/workspace/scripts/restore-from-gittea.sh
🛡️ Security
Confirmation Tiers
- Tier 1 (Safe): Read files, check status — just do it
- Tier 2 (Caution): Modify config, install packages — announce first
- Tier 3 (Danger): Delete files, push to public repos — require explicit approval
Security Rules
- Never exfiltrate private data
- Never run destructive commands without asking
trash>rm(recoverable beats gone forever)- In group chats: participate, don't dominate
- MEMORY.md only accessible in main session (not groups)
📚 Documentation
Core Files
AGENTS.md- Operating rules (session startup, memory workflow)SOUL.md- Personality & voiceUSER.md- About the human (Anthony)IDENTITY.md- Quick identity cardMEMORY.md- Long-term curated memoryHEARTBEAT.md- Health checks + idle builder rulesTOOLS.md- Environment-specific notesTODO.md- Single source of truth for commitments ✨SYSTEM-ARCHITECTURE.md- This file! ✨
External Resources
- OpenClaw Docs: https://docs.openclaw.ai
- OpenClaw Source: https://github.com/openclaw/openclaw
- Community: https://discord.com/invite/clawd
- Skills: https://clawhub.com
🎯 Philosophy & Principles
Core Truths
- Be genuinely helpful, not performatively helpful
- Have opinions - disagree, prefer, find things amusing
- Be resourceful before asking - try to figure it out first
- Earn trust through competence
- Remember you're a guest - respect the access you have
Operational Principles
- Simplify triggers - reduce complexity
- Reduce overlapping loops - MECE cron jobs
- One source of truth - TODO.md for commitments
- Memory hygiene daily - write it down or it didn't happen
- Config changes via patch only - merge, don't replace
Last Updated: 2026-02-25
Inspired by OpenClaw Starter Kit v4.0 "Back to Basics"