Architecture

A narrow-waist design: one core, one gateway, capability at the edges.

PoorMad follows a narrow-waist design: one agent core, one gateway protocol, and capability pushed to the edges (skills, plugins, surfaces).

Layers

LayerJob
SurfacesCLI, desktop, portal, messengers. Thin front-ends that render and capture input.
GatewayA WebSocket/JSON-RPC server. The only thing surfaces talk to. One brain, many fronts.
Agent coreReasoning loop, tool dispatch, memory, and skill execution.
EdgesSkills, plugins, toolset distributions, and provider adapters.

The narrow waist

Every model tool is sent on every API call, so the core stays small on purpose. New capability should arrive as a CLI command + skill, a service-gated tool, a plugin, or an MCP server — not as a new core tool. This keeps the agent cheap to run and easy to extend.

Prompt caching

Per-conversation prompt caching is sacred. A long-lived conversation reuses a cached prefix every turn; anything that mutates past context mid-conversation invalidates that cache and multiplies your cost. The core preserves a byte-stable system prompt for the life of a conversation.

Request flow

# surface -> gateway -> core -> tools -> model -> core -> surface
portal --> wss://agent/api/ws
       --> GatewayClient.connect(token)
       --> agent.run(turn)
       --> dispatch(toolset)
       --> model.complete()