appendix-a-executive-briefing

Appendix A: Architecture Quick Reference

The four-layer stack, five production patterns, and key file conventions — the reference sheet for building OpenClaw-inspired autonomous agents.

The Four-Layer Stack

Every autonomous agent in this handbook converges on the same architecture:

┌─────────────────────────────────────────┐
│  SURFACES (I/O)                         │
│  Chat · Admin UI · API · Webhooks · Voice│
│  How the agent communicates             │
└────────────────┬────────────────────────┘

┌────────────────▼────────────────────────┐
│  REASONING CORE                         │
│  Prompt compiler · ReAct loop           │
│  Tool router · Budget manager           │
│  How the agent thinks and calls tools   │
└────────────────┬────────────────────────┘

┌────────────────▼────────────────────────┐
│  CAPABILITY LAYER                       │
│  Skills · Memory tiers · Objectives     │
│  Workflows · A2A · Automations          │
│  What the agent can do and remember     │
└────────────────┬────────────────────────┘

┌────────────────▼────────────────────────┐
│  INFRASTRUCTURE & GOVERNANCE            │
│  Scheduling · Concurrency · Isolation   │
│  Observability · Approval gates · Audit │
│  Where uptime, safety, accountability live│
└─────────────────────────────────────────┘

Core File Conventions (OpenClaw)

FilePurposeWho edits
SOUL.mdAgent identity, values, tone, hard limitsAgent manager
AGENTS.mdOperating rules, tool permissions, scopeAgent manager
HEARTBEAT.mdRecurring objectives and check scheduleAgent manager
USER.mdContext about the human/organization servedAgent manager
memory/*.mdAccumulated working knowledgeAgent (auto-written each cycle)
skills/*.mdSkill definitions with instructionsDeveloper / agent (self-created)

All files are plain text, version-controlled, readable without tooling. The governance principle: any human with repo access can understand the agent’s complete operational state in under five minutes.


Five Production Patterns

1. Specialist QA Agent

Use OpenClaw as a dedicated auditor for your own SaaS or internal tools.

  • SOUL.md focused on “what good looks like” for the target system
  • Expose a typed /v1/responses task returning structured findings: { findings: [{ severity, location, description, recommendation }] }
  • Trigger after deploys or content changes; store results as objectives
  • The FlowPilot + QA Claw loop in chapter 27 shows this in production

2. Native Business Operator (FlowPilot Pattern)

Apply the soul + heartbeat + skill architecture to a self-hosted business platform.

  • Agent is a first-class component, not a plugin
  • One Supabase instance per business (RLS enforced)
  • Skills cover every business-critical operation (lead qualify, invoice approve, content publish)
  • Agent runs the platform autonomously; human sets direction via objectives

3. Role-Based Swarm (ClawStack)

Multiple specialist agents as services on shared infrastructure:

  • One agent per role: QA Claw, Dev Claw, Research Claw, Support Claw
  • Each has isolated SOUL.md / AGENTS.md and scoped skill set
  • ClawStack provisions containers, TLS, routing, A2A wiring
  • Delegation via /v1/responses (top-down) and A2A (peer-to-peer)
  • Key principle: one agent per role, not one model doing everything

4. Orchestrated Fleet (Paperclip)

Add a coordination layer above individual agents:

  • Paperclip connects to agents via OpenResponses and A2A
  • Acts as Delegator: sets objectives, enforces budgets and approval gates
  • Individual agents remain independently operable; orchestration is additive
  • Maps directly to the responsibility chain: Delegator → Operator → Agent

5. Hardened Perimeter (NemoClaw / DefenseClaw)

Wrap any agent in security and governance layers:

  • NemoClaw — sandboxing via OpenShell, policy-based access control, RTX hardware integration
  • DefenseClaw — skill scanning, action blocking, OWASP-aligned audit logging
  • Apply the patterns directly to your own agent: sandbox, explicit allowlists, append-only audit trail

Key Architectural Decisions

DecisionOptionsWhen to choose each
Agent locationEmbedded (inside platform) vs External (via MCP)Embedded: you own the codebase, need sub-ms access. External: cross-platform, faster to deploy
Memory backendFile-based (OpenClaw) vs DB-based (pgvector)Files: single-user, human-readable. DB: multi-tenant, semantic search needed
Skill storageFile-based registry vs DB-drivenFiles: simple, version-controlled. DB: hot-reload, agent self-creation
Model routingSingle provider vs LiteLLM proxySingle: simpler. LiteLLM: model-agnostic, cost routing, fallback
Approval gatesPer-skill (requires_approval) vs per-actionPer-skill for configuration, per-action for runtime decisions
SchedulingCron-based heartbeat vs event-drivenCron: predictable, auditable. Event: lower latency, harder to govern

Skill Schema Minimum

{
  name: string,               // snake_case, unique
  description: string,        // what the skill does — used by the model to decide when to invoke
  parameters: {               // JSON Schema, strict — GPT-4.1 validates hard
    type: "object",
    properties: {
      [key: string]: {
        type: string,
        description: string,  // required — model uses this to fill the field
        // For arrays: always include items: { type: "..." }
      }
    },
    required: string[]
  },
  requires_approval: boolean, // true = human must confirm before execution
  scope: "internal" | "external",
  instructions: string        // the agent's training material for this skill
}

Common failure: array properties without items definition. Claude tolerates it. GPT-4.1 rejects the tool call entirely. Always define items.


Read Path for Builders

GoalChapters
Understand the architecture01, 02, 03, 04
Build the reasoning core09, 10, 17, 19
Build skills and memory12, 15, 16, 18
Production hardening11, 25, 29, 30, 31, 32
Agent-to-agent coordination26, 27, 28
Multi-agent infrastructure33, 34
Governance and calibration22, 23, 24
Community — Under Development

This is your handbook

Agentic AI is evolving fast. The patterns, the laws, the architecture — they need to stay current with the community's collective knowledge.

If you have thoughts on autonomous agents, or if you want to contribute to the work around AI-operated CMS, CRM, and ERP systems — whether it's a production story, a pattern you've discovered, or an idea you want to explore — I'd love to hear from you.

Connect on GitHub