Skip to main content

What Are Agents?

An agent in OpenClaw is an autonomous AI-powered entity that can perceive its environment, make decisions, and take actions to accomplish goals. Unlike simple chatbots that merely respond to prompts, agents maintain state, use tools, and execute multi-step workflows.

Agents vs. Chatbots

FeatureChatbotOpenClaw Agent
MemoryNone or session-onlyPersistent short-term and long-term memory
ToolsNo external tool access5,700+ skills and built-in tools
ChannelsSingle interface50+ channel integrations simultaneously
PlanningSingle responseMulti-step reasoning and task decomposition
AutonomyReactive onlyProactive scheduling and event-driven actions

Agent Architecture

Every OpenClaw agent is composed of four layers:

  1. Model Layer -- The underlying LLM (cloud or local) that powers reasoning.
  2. Memory Layer -- Short-term conversation context and long-term persistent storage.
  3. Tool Layer -- Built-in tools and installed skills the agent can invoke.
  4. Channel Layer -- The interfaces through which users interact with the agent (Slack, Discord, web, API, etc.).

Agent Lifecycle

An agent moves through several states during its lifetime:

  1. Created -- The agent configuration is defined but the agent is not yet running.
  2. Initializing -- OpenClaw loads the model, connects memory backends, and registers tools.
  3. Running -- The agent is live and responding to messages on connected channels.
  4. Paused -- The agent is temporarily suspended but retains its state.
  5. Stopped -- The agent is shut down. Memory persists for the next start.

You can inspect an agent's current state at any time:

openclaw status my-agent

Creating Your First Agent

Agents are defined in a YAML configuration file. Here is a minimal example:

# config.yaml
agents:
my-first-agent:
model: openai/gpt-4o
system_prompt: "You are a helpful assistant."
channels:
- terminal
memory:
backend: sqlite
tools:
- web_search
- calculator

Start the agent with:

openclaw start my-first-agent

Agent Configuration Options

The agent block in config.yaml supports many options. Here are the most common:

FieldTypeDefaultDescription
modelstringrequiredThe model identifier (e.g., openai/gpt-4o, ollama/llama3).
system_promptstring""Instructions that define the agent's personality and behavior.
channelslist[terminal]Which channels the agent listens on.
memory.backendstringsqliteMemory storage backend (sqlite, redis).
toolslist[]Built-in tools to enable for this agent.
skillslist[]Installed skills to attach to this agent.
max_turnsinteger50Maximum conversation turns before auto-reset.
temperaturefloat0.7Model sampling temperature.

For the full configuration reference, see Configuration Reference.

Multi-Agent Setups

OpenClaw supports running multiple agents simultaneously. Each agent can use a different model, connect to different channels, and have its own memory store:

agents:
support-bot:
model: anthropic/claude-sonnet-4.6
channels: [slack, email]
skills: [ticket-creation, knowledge-base]

code-reviewer:
model: openai/gpt-4o
channels: [github]
skills: [code-review, linting]

Start all agents at once:

openclaw start --all

Next Steps