Docs/Getting Started/Architecture
Technical

Platform Architecture

A deep dive into how Lobstack provisions dedicated infrastructure, runs AI agents, and connects everything together.

💡

Architecture Overview

Lobstack is a multi-tenant SaaS platform that provisions dedicated VMs for each AI agent. Every agent runs its own OpenClaw instance with isolated compute, memory, and network access.

System Diagram#

The platform consists of four main layers that communicate via authenticated HTTP APIs.

High-Level Architecture
┌─────────────────────────────────────────────────────────────┐
│                    User (Browser / API)                      │
└─────────────────────────────┬───────────────────────────────┘
                              │
                              ▼
                ┌───────────────────────────┐
                │     Next.js Application   │
                │   (Vercel Serverless)     │
                │                           │
                │  ┌─────────┐ ┌─────────┐  │
                │  │ React   │ │ 56 API  │  │
                │  │Dashboard│ │ Routes  │  │
                │  └─────────┘ └────┬────┘  │
                └───────────────────┼───────┘
                                    │
              ┌─────────────────────┼─────────────────────┐
              │                     │                     │
              ▼                     ▼                     ▼
    ┌──────────────────┐  ┌────────────────┐  ┌────────────────┐
    │    Supabase       │  │     Stripe     │  │ Cloud Provider │
    │  (PostgreSQL +    │  │  (Payments &   │  │ (Hetzner / DO  │
    │   Auth + RLS)     │  │  Subscriptions)│  │  / Vultr)      │
    └──────────────────┘  └────────────────┘  └───────┬────────┘
                                                      │
                                                      ▼
                                            ┌──────────────────┐
                                            │   Agent VM        │
                                            │                   │
                                            │  ┌─────────────┐  │
                                            │  │Agent Bridge  │  │
                                            │  │  (REST API)  │  │
                                            │  └──────┬──────┘  │
                                            │         │         │
                                            │  ┌──────▼──────┐  │
                                            │  │  OpenClaw    │  │
                                            │  │  (AI Runtime)│  │
                                            │  └──────┬──────┘  │
                                            │         │         │
                                            │  ┌──────▼──────┐  │
                                            │  │  MCP Servers │  │
                                            │  │  (10+ tools) │  │
                                            │  └─────────────┘  │
                                            └──────────────────┘

Architecture Layers#

1. Frontend — Next.js Dashboard#

The user-facing application is built with Next.js 16, React 19, and Tailwind CSS 4. It provides:

ComponentPurpose
Dashboard8-panel agent control center (Overview, Agent, Chat, Skills, Sandbox, Memory, Logs, Settings)
Onboarding3-step setup wizard: model → plan → deploy
Docs Site30+ pages of documentation with sidebar navigation
Admin Panel12-section admin dashboard with Master Terminal
Landing PageMarketing site with Spline 3D hero, pricing, and social proof

2. API Layer — 56 Serverless Routes#

All backend logic runs as serverless functions on Vercel. Routes are organized by domain:

DomainRoutesPurpose
/api/agent/*30+Agent lifecycle, chat, config, skills, memory, workflows, analytics
/api/admin/*20+Admin operations, monitoring, payments, user management
/api/checkout1Stripe checkout session creation
/api/webhooks/stripe1Stripe webhook handler (5 event types)
/api/cron/health1Health check + auto-recovery (runs every minute)
/api/affiliate/*2Affiliate registration and stats

3. Database — Supabase PostgreSQL#

All state is stored in a Supabase-managed PostgreSQL database with Row Level Security (RLS) enabled on every table. The schema includes 19 tables:

Table GroupTablesPurpose
Identityusers, subscriptionsUser accounts, billing, Stripe mapping
Agentagent_instances, agent_configs, agent_skills, agent_memoryAgent state, configuration, integrations, knowledge
Messagingmessages, chat_sessionsChat history, session grouping
Automationworkflows, workflow_triggers, workflow_executionsWorkflow definitions, triggers (cron/webhook/event), execution tracking
Webhookswebhooks, webhook_deliveriesOutbound webhook config and delivery log
Monitoringagent_logs, health_checks, token_usageOperational logs, health history, token consumption
Affiliateaffiliates, referrals, commissionsPartner program, referral tracking, commission payouts

4. Infrastructure — Dedicated VMs#

Each agent runs on a dedicated virtual machine provisioned via cloud provider APIs. The provisioning flow:

Agent Provisioning Flow
User selects plan → Stripe checkout → Webhook fires
                                          │
                                          ▼
                                   provisionAgent()
                                          │
                              ┌───────────┼───────────┐
                              ▼           ▼           ▼
                         Create VM   Create DB    Seed Config
                         (cloud-init)  Records    (SOUL.md, etc.)
                              │
                              ▼
                     cloud-init script runs:
                     ├── Install Node.js 22
                     ├── Install Python 3.11
                     ├── Install OpenClaw 2026.2.26
                     ├── Configure MCP servers
                     ├── Start agent bridge
                     └── POST /api/agent/provisioned
                              │
                              ▼
                     Agent online (status: running)
                     Heartbeat every 30 seconds
PlanvCPURAMStorageMessages/mo
Starter22 GB50 GB SSD1,000
Pro24 GB80 GB SSD5,000
Performance48 GB160 GB SSD15,000
Enterprise832 GB320 GB SSD50,000

Key Data Flows#

Chat Message Flow#

User → Agent → Response
Dashboard sends POST /api/agent/chat
       │
       ▼
API validates auth + checks message quota
       │
       ▼
Forwards to Agent Bridge (HTTP → agent VM:3001)
       │
       ▼
Bridge → OpenClaw → AI Model (Claude/GPT/Gemini)
       │
       ▼
Response returns through same path
       │
       ▼
Bridge async: POST /api/agent/messages (store + extract memories)

Health Check & Auto-Recovery#

A Vercel Cron job runs every minute to monitor all agents:

CheckThresholdAction
Stuck provisioning (silent)8 minutesAuto-rebuild with provider rotation
Stuck provisioning (total)25 minutesMark error, preserve server for inspection
Health check failure5 consecutiveMark agent as error
Heartbeat timeout5 minutesFlag as potentially unhealthy

Security Architecture#

Security is enforced at every layer of the stack:

LayerMechanism
AuthenticationSupabase JWT with PKCE flow, auto-refresh via middleware
AuthorizationRow Level Security (RLS) on all 19 database tables
Agent BridgeShared secret (X-Agent-Secret header) + agent ID validation
Admin APISeparate admin secret (X-Admin-Secret header)
Stripe WebhooksHMAC-SHA256 signature verification
Outgoing WebhooksHMAC-SHA256 signature in X-Lobstack-Signature header
Agent IsolationDedicated VM per agent, loopback-only gateway binding
OpenClaw GatewaySandboxed mode, token auth, security audit on provision

Technology Stack#

CategoryTechnologyVersion
FrameworkNext.js16.1.6
UIReact19.2.3
StylingTailwind CSS4.x
AnimationFramer Motion12.x
LanguageTypeScript5.9.3
DatabaseSupabase (PostgreSQL)Latest
AuthSupabase AuthJWT + PKCE
PaymentsStripe20.3.1
AI RuntimeOpenClaw2026.2.26
Tool ProtocolMCP (Model Context Protocol)1.25.3
HostingVercelServerless
ComputeHetzner / DigitalOcean / VultrOn-demand VMs
ChartsD3.js7.9.0

Scaling & Reliability#

Lobstack is designed for horizontal scaling:

ComponentScaling Strategy
APIVercel serverless auto-scaling (per-request)
DatabaseSupabase managed PostgreSQL (vertical + read replicas)
Agent VMsOne dedicated VM per agent (horizontal by nature)
Health checksParallel batches of 10 agents, ~1 min for 100 agents
WebhooksFire-and-forget pattern, logged for retry
Memory extractionAsync background, rate-limited per agent (1/60s)

Want to dive deeper?

Check out the Security docs for encryption, Vault secrets, and compliance details. See OpenClaw Integration for runtime internals.