Community Guide

OpenClaw Architecture

A practical walkthrough of OpenClaw architecture, covering the Gateway, workspace, sessions, memory, nodes, and the operator tradeoffs behind them.

Mar 13, 2026

The architecture in one sentence

OpenClaw is built around a long-running Gateway control plane that coordinates channels, sessions, tools, and nodes while keeping the real assistant state in a workspace you control.

The Gateway is the control plane, not the whole product

The official README makes this distinction very clearly: the Gateway is the control plane, while the assistant experience spans channels, tools, device nodes, and the browser UI.

That is why OpenClaw feels different from a chat wrapper. The Gateway is not there just to proxy messages. It owns:

  • session lifecycle
  • auth and pairing
  • routing
  • tool access
  • browser and web surfaces
  • channel integration
  • node coordination

If the Gateway is unhealthy, the rest of the system will feel unhealthy too.

The basic runtime shape

The simplest practical model is:

  • Gateway: the central long-running service
  • Workspace: the files that define identity, memory, and durable state
  • Channels: Telegram, Discord, WhatsApp, and other message surfaces
  • Nodes: device-side execution and companion capabilities
  • Web surfaces: dashboard, Control UI, and browser-facing tools

This separation is what lets OpenClaw stay always-on without collapsing everything into one terminal process.

The workspace is part of the architecture

One of the most important OpenClaw design choices is that the assistant state stays inspectable.

The workspace can include files like:

  • AGENTS.md
  • SOUL.md
  • USER.md
  • MEMORY.md
  • HEARTBEAT.md
  • memory/YYYY-MM-DD.md
  • skills/
  • sessions.json

This is not an implementation accident. It is the architecture. OpenClaw keeps durable state in files you can read, version, and reason about.

Sessions are boundaries, not just chat tabs

OpenClaw uses sessions to separate context, access, and behavior. That means sessions decide more than just “which conversation is open.”

They influence:

  • who is talking to the agent
  • whether that person has been paired or approved
  • whether memory should be shared or isolated
  • how compaction and recall behave for that surface

This is why a group conversation should not be expected to behave like a private dashboard session.

Memory is file-backed retrieval, not magical context

The memory docs make the current model much clearer than many community explainers do.

The important pieces are:

  • long-term memory is stored in workspace Markdown
  • MEMORY.md is curated and private-session oriented
  • memory/YYYY-MM-DD.md holds daily operational notes
  • recall happens through tools like memory_search and memory_get
  • a pre-compaction memory flush can remind the agent to save durable notes before context is compressed

That means “token pressure” and “memory quality” are related, but they are not the same problem.

Why token pressure happens

People often describe OpenClaw as if it simply “gets too much context.” The real picture is more specific:

  • sessions grow over time
  • tools and channels add more state and surface area
  • compaction has to preserve what matters while dropping what does not
  • memory works best when important facts are written to durable files instead of living only inside the active prompt

If you ignore that last step, token usage rises and recall quality still feels poor.

Nodes, channels, and browser control are separate layers

The Gateway also coordinates external surfaces that should not be collapsed into one concept:

  • channels deliver inbound and outbound messages
  • nodes execute device-local actions
  • browser control can run through a managed profile or browser relay
  • web surfaces expose dashboard and control interfaces

That separation is useful because the machine running the Gateway is not always the same machine holding the device or browser surface.

Loopback-first is a real design choice

OpenClaw’s networking story is conservative by design:

  • local bind first
  • auth by default
  • private-network exposure before public exposure
  • explicit remote access layers when needed

This is why the docs keep pushing people away from casually exposing the raw Gateway on the public internet.

What architecture means in practice

If you are operating OpenClaw, architecture is not trivia. It determines:

  • what machine you trust
  • where the durable state really lives
  • what can reach the Gateway
  • which sessions can see what memory
  • which channels or nodes can execute tools
  • how much debugging surface you are adding at once

Understanding that is the difference between “I installed it” and “I know what I am running.”

Where to go next