No history yet

Core Architecture

The Fat Gateway Architecture

To understand OpenClaw, it's essential to move beyond the idea of a simple script. OpenClaw operates as a persistent, self-hosted daemon. This architectural choice is known as the 'Fat Gateway' model. Instead of running discrete commands, you start a central service that manages all intelligence, state, and execution. This gateway is the heart of the entire system.

The gateway's core function is to act as a control plane. It runs a server, listening by default on port 18789. Every other component in the OpenClaw ecosystem, from communication channels to system-level tools, connects to this central hub. This centralized design simplifies management and ensures a single source of truth for the agent's state and tasks. All instructions flow from the gateway, and all results and observations flow back to it.

In the Fat Gateway model, the central daemon is not just a router; it is the system's brain, containing the core logic and workflow engines.

Inside the Gateway

Two key components live inside the gateway and drive the agent's behavior: the Pi Engine and the Lobster Workflow Engine.

The Pi Engine is the agent runtime. It’s responsible for holding the agent's state, managing its memory, and orchestrating the core reasoning loop. When an LLM decides on a course of action, the Pi Engine is what translates that intent into an executable command for a specific Skill or Node.

The Lobster Workflow Engine works alongside the Pi Engine to ensure tasks are executed reliably. LLMs can be non-deterministic, but real-world tasks often require predictable, repeatable steps. The Lobster Engine allows you to define complex workflows that are guaranteed to run the same way every time, providing a layer of on top of the probabilistic nature of the language model.

The components connecting to the gateway are separated into logical categories.

ComponentPurposeExample
NodesHardware & OS abstractionAccessing the file system, running shell commands.
ChannelsCommunication interfacesSending a message via Telegram or reading an email.
SkillsHigh-level capabilitiesComposing a multi-step task like 'summarize a webpage'.
ToolsLow-level, atomic actionsA single function, like readFile or sendEmail.

A 'Skill' is often a workflow that combines multiple 'Tools'. For instance, a 'daily briefing' Skill might use a weather Tool, a calendar Tool, and an email Tool, orchestrating them into a single, useful function.

For distributed systems, OpenClaw uses the Bridge Protocol. This allows you to run a lightweight Node on a separate machine, which then connects back to the main Gateway over the network. This is useful for isolating permissions or accessing hardware on a different computer, like a Raspberry Pi controlling smart home devices, while the main Gateway runs on a more powerful server.

Lesson image

Now that you understand the core architecture, let's test your knowledge.

Quiz Questions 1/5

What architectural model does OpenClaw follow, distinguishing it from simple, discrete scripts?

Quiz Questions 2/5

What is the primary role of the Pi Engine within the OpenClaw gateway?

Understanding this architecture is the key to building scalable, debuggable, and powerful AI agents with OpenClaw. It provides a robust foundation for the more complex projects you'll tackle later.