Architecture Reference

SkillCloud & infra

References Serverless OpenClaw architecture. Covers network design, CDK stack structure, DynamoDB data model, API protocols, and container design.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Architecture Reference skill

What this skill tells your AI

The instructions your AI receives, as published by serithemage/serverless-openclaw in .agents/skills/architecture/SKILL.md and read by ahel’s review.

Design Documents

Core Architecture Principles

  1. Cost minimization: No NAT Gateway, no ALB, no Interface Endpoints
  2. Serverless-first: Lambda (events), Fargate Spot (long-running), DynamoDB (PAY_PER_REQUEST)
  3. Single responsibility: 7 separate Lambdas, 9 separate CDK stacks
  4. Layer separation: API Gateway → Lambda → Bridge → OpenClaw Gateway
  5. Protocol translation: Lambda(HTTP) ↔ Bridge ↔ OpenClaw Gateway(JSON-RPC 2.0 WebSocket)

AGENT_RUNTIME Feature Flag

Controls which agent backend handles requests:

ValueBehavior
fargateRoute all agent requests to Fargate container (Phase 1 mode)
lambdaRoute all agent requests to Lambda agent (Phase 2 mode)
bothSmart routing via classifyRoute(): reuse running Fargate, honor /heavy//fargate hints, default to Lambda, fallback to Fargate on Lambda failure

See architecture.md §12 for full Lambda architecture details and smart routing rules.

Lambda Data Flow (Phase 2)

Client → API Gateway (WS/REST) → Gateway Lambda → Lambda Agent Function
                                                  → runEmbeddedPiAgent()
                                                  → OpenClaw in-process

CDK Stacks (9 total)

SecretsStack + NetworkStack → StorageStack → {AuthStack, ComputeStack} → ApiStack → WebStack + MonitoringStack + LambdaAgentStack

Signals

GitHub stars
195
Forks
40
Last commit
Mar 2026
Advanced
Catalog kind
skill
Gateway key
architecture-serithemage
Source
github.com/serithemage/serverless-openclaw