Agent Types in OpenClaw
OpenClaw supports a wide range of specialised agent types. Choosing the right agent type for your task drastically improves results — a specialised coding agent outperforms a generic agent on code tasks because its system prompt, tools, and guardrails are tuned for that specific domain.
Why Specialised Agents Outperform Generic Ones
A generic agent with access to all tools tends to make poor decisions about which tool to use and when. It also receives more tokens in context than it needs, increasing cost and often reducing focus. Specialised agents are more predictable, faster, and cheaper to run because they operate within a well-defined scope.
Agent Type Quick-Reference
| Agent Type | Best For | Key Tools | Typical Latency |
|---|---|---|---|
| Coding Agent | Code review, debug, refactor, test gen | code_reader, code_executor, linter | 10–60 s |
| Research Agent | Web research, summaries, reports | web_search, fetch_url, text_summarize | 30–120 s |
| File Agent | Organise, rename, convert, monitor | filesystem, pattern_rename, file_transform | 1–30 s |
| Web Agent | Scraping, form-filling, automation | fetch_url, playwright_browser | 5–60 s |
| Database Agent | NL-to-SQL, data queries, reporting | sql_tool, schema_reader | 5–30 s |
| DevOps Agent | CI/CD, Docker, K8s, incident response | shell, docker_api, k8s_api | 10–120 s |
| Document Agent | PDF/DOCX extraction, OCR, routing | pdf_reader, ocr_tool, docx_reader | 5–60 s |
| Support Agent | FAQ answers, ticket triage, escalation | knowledge_base_search, crm_api | 3–15 s |
| Data Analysis Agent | Stats, insights, charts, reports | csv_reader, sql_tool, python_executor | 15–90 s |
| Monitoring Agent | Health checks, log analysis, alerts | shell, http_check, log_reader, notify | 5–30 s |
| Security Agent | Vuln scanning, dep audit, config review | code_scanner, dep_audit, config_checker | 30–180 s |
Single-Purpose vs Multi-Purpose Agents
Start with single-purpose agents. Each one does one job well. When you need a complex workflow that spans multiple domains — for example, research a topic, then write code to process the findings, then email a summary — use an orchestrator agent that calls specialised sub-agents in sequence.
# orchestrator.yaml — calls sub-agents sequentially
name: pipeline-orchestrator
model: gpt-4o
tools:
- run_agent # OpenClaw built-in: spawn a sub-agent by name
system: |
You are a pipeline orchestrator. Complete tasks by delegating to
specialised agents: researcher, coder, mailer.
Always run researcher first, then coder, then mailer.Selection Guide
Answer three questions to pick the right agent type:
- What is the primary data source? Files → File Agent. Web → Web/Research Agent. Database → Database Agent. Code repository → Coding Agent.
- What is the expected output? Report/summary → Research or Data Analysis Agent. Transformed files → File or Document Agent. Actions (deploy, alert) → DevOps or Monitoring Agent. Reply to a user → Support Agent.
- How sensitive is the environment? Production systems → DevOps or Security Agent with strict guardrails. Customer data → Support Agent with PII handling. Public data → Research or Web Agent.
Quick Code Snippet per Agent Type
from openclaw import Agent
# Coding agent
coding = Agent.from_config("agents/coding.yaml")
review = coding.run("Review pull request #42 for security issues")
# Research agent
researcher = Agent.from_config("agents/researcher.yaml")
report = researcher.run("Research the top 5 vector databases in 2025")
# File agent
filer = Agent.from_config("agents/filer.yaml")
filer.run("Organise ~/Downloads: move docs to Documents/, images to Pictures/")
# Database agent
db_agent = Agent.from_config("agents/db.yaml")
result = db_agent.run("Show me monthly revenue by product for Q1 2025")Combining Agents into Pipelines
For end-to-end workflows, compose specialised agents using OpenClaw's multi-agent system. Each agent handles exactly the part it's good at, and the orchestrator stitches the results together.
from openclaw import Agent
import json
orchestrator = Agent.from_config("orchestrator.yaml")
researcher = Agent.from_config("agents/researcher.yaml")
coder = Agent.from_config("agents/coder.yaml")
# Step 1 – research
findings = researcher.run("Research Python async performance in 2025")
# Step 2 – generate benchmark code based on research
code = coder.run(f"Write a benchmark script based on these findings:\n{findings}")
# Step 3 – orchestrator summarises both
summary = orchestrator.run(
f"Findings:\n{findings}\n\nBenchmark code:\n{code}\n\nWrite an executive summary."
)