Back to Article List

ZeroClaw multi-agent setup with sub-agents

ZeroClaw multi-agent setup with sub-agents

A single ZeroClaw agent can do a lot on its own, but some workflows benefit from splitting work across specialized agents. Instead of one agent that tries to handle everything from writing code to scheduling meetings to analyzing logs, you set up sub-agents that each focus on a specific domain and let the main agent delegate tasks to them.

ZeroClaw's delegate system handles this natively. The main agent evaluates incoming requests, decides if a sub-agent would handle it better and routes the task accordingly. The sub-agent works on the task and returns the result to the main agent, which presents it to the user.

This all happens within a single ZeroClaw instance; you don't need multiple VPS deployments.

When multi-agent setups make sense

Before configuring sub-agents, it's worth thinking about when this actually helps. A single agent with the right tools and a good system prompt handles most personal assistant tasks perfectly fine. Where multi-agent starts to pay off is when you have distinct domains that benefit from different system prompts, different tool sets or even different models.

A few patterns that work well: a coding agent that has access to shell tools and a detailed system prompt about your codebase, paired with a writing agent that has web search tools and a prompt tuned for drafting. Or a monitoring agent that runs on cron and checks system metrics, feeding summaries to a main agent that decides when to alert you. Or a research agent using a large cloud model for complex analysis, with a fast local model handling quick answers through the main agent.

If you've used OpenClaw's multi-agent system, the concepts are similar but ZeroClaw's implementation is lighter weight and runs everything in the same process rather than spawning separate services.

Sub-agent configuration

Sub-agents are defined in your config.toml under [agents] sections. Each agent gets its own name, system prompt, tool access and optionally a different AI provider or model:

[agents.coder]
system_prompt = "You are a coding assistant. Focus on writing clean, well-documented code. You have access to shell and file tools."
tools = ["shell", "file", "git"]
provider = "anthropic"
model = "claude-sonnet-4-20250514"

[agents.researcher]
system_prompt = "You are a research assistant. Search the web and summarize findings concisely."
tools = ["web_search", "http"]
provider = "openai"
model = "gpt-4o"

The main agent (the default one that receives messages from your channels) delegates to these sub-agents based on the task. ZeroClaw's agent runtime evaluates the request and routes it to the best-matching sub-agent automatically, or you can instruct the main agent to "ask the coder to..." for explicit delegation.

Configurable timeouts

One of the additions in ZeroClaw v0.5.1 is configurable sub-agent timeouts. Before this, a sub-agent that hung on a long API call or an unresponsive tool could block the entire pipeline. Now you can set per-agent timeouts:

[agents.coder]
timeout_seconds = 120

[agents.researcher]
timeout_seconds = 60

If a sub-agent doesn't complete within its timeout, the main agent receives a timeout error and can decide what to do: retry, try a different approach, or report the failure to the user. For agents that do heavier work (running tests, building projects), set longer timeouts. For quick-response agents, shorter timeouts prevent the user from waiting when something goes wrong.

Tool isolation between agents

Each sub-agent can have its own tool set. This is both a feature and a security measure. Your researcher agent doesn't need shell access, and your coder agent probably shouldn't be sending emails. By scoping tools per agent, you limit what each one can do.

The tools array in each agent config specifies which tools that agent can use. If a tool isn't listed, the agent can't invoke it. The main agent retains access to all tools by default (unless you restrict it too), which makes sense because it's the coordinator that decides how to route tasks.

If you're concerned about agent tool access from a security perspective, the secrets management guide has broader advice on controlling what your AI agents can access. The principles apply across both OpenClaw and ZeroClaw deployments.

Monitoring agent activity

When multiple agents are running, it helps to see what each one is doing. The zeroclaw status command shows active agents and their current state. If you've enabled the Prometheus metrics endpoint on the gateway, you can track per-agent request counts and latencies:

curl http://127.0.0.1:42617/metrics | grep zeroclaw_requests

The metrics include labels for agent name and status, so you can build Grafana dashboards that show each sub-agent's activity separately. The production guide covers Prometheus and log collection in more detail.

Multi-agent with local models

Here's where things get interesting on a budget. You can mix cloud and local providers across agents. Use a cheap local model via Ollama for the main agent (handling simple questions and routing), and route complex tasks to sub-agents using cloud providers. This way you only pay API costs for the tasks that genuinely need a larger model.

# Main agent uses local model (free)
default_provider = "ollama"
default_model = "llama3.1:8b"

# Sub-agent uses cloud model (pay per use)
[agents.analyst]
provider = "anthropic"
model = "claude-sonnet-4-20250514"
tools = ["web_search", "file"]

The main agent handles the 80% of requests that a local model can deal with, and escalates the 20% that need deeper reasoning to Claude. In practice, this can reduce API costs by 60-80% compared to running everything through a cloud provider.

Your idea deserves better hosting

24/7 support 30-day money-back guarantee Cancel anytime
Abonament

VPS.S1

$5.99 Save  17 %
$4.99 Lunar
  • 2 vCPU AMD EPYC
  • 2 GB RAMMEMORIE
  • 30 GB NVMeSTOCARE
  • Trafic nelimitat
  • IPv4 & IPv6Suportul IPv6 este momentan indisponibil în Franța, Finlanda sau Țările de Jos. incluse

VPS.S3

$14.99 Save  33 %
$9.99 Lunar
  • 4 vCPU AMD EPYC
  • 6 GB RAMMEMORIE
  • 70 GB NVMeSTOCARE
  • Trafic nelimitat
  • IPv4 & IPv6Suportul IPv6 este momentan indisponibil în Franța, Finlanda sau Țările de Jos. incluse

EPYC VPS.P1

$8.99 Save  22 %
$6.99 Lunar
  • 2 vCPU AMD EPYC
  • 4 GB RAMMEMORIE
  • 40 GB NVMeSTOCARE
  • Trafic nelimitat
  • IPv4 & IPv6Suportul IPv6 este momentan indisponibil în Franța, Finlanda sau Țările de Jos. incluse
  • Backup automat gratuitInclude un spațiu de backup pe care îl poți configura pentru rulare zilnică, săptămânală sau lunară.

EPYC VPS.P2

$16.99 Save  24 %
$12.99 Lunar
  • 2 vCPU AMD EPYC
  • 8 GB RAMMEMORIE
  • 80 GB NVMeSTOCARE
  • Trafic nelimitat
  • IPv4 & IPv6Suportul IPv6 este momentan indisponibil în Franța, Finlanda sau Țările de Jos. incluse
  • Backup automat gratuitInclude un spațiu de backup pe care îl poți configura pentru rulare zilnică, săptămânală sau lunară.

EPYC VPS.P4

$29.99 Save  23 %
$22.99 Lunar
  • 4 vCPU AMD EPYC
  • 16 GB RAMMEMORIE
  • 160 GB NVMeSTOCARE
  • Trafic nelimitat
  • IPv4 & IPv6Suportul IPv6 este momentan indisponibil în Franța, Finlanda sau Țările de Jos. incluse
  • Backup automat gratuitInclude un spațiu de backup pe care îl poți configura pentru rulare zilnică, săptămânală sau lunară.

EPYC VPS.P5

$39.99 Save  25 %
$29.99 Lunar
  • 8 vCPU AMD EPYC
  • 16 GB RAMMEMORIE
  • 180 GB NVMeSTOCARE
  • Trafic nelimitat
  • IPv4 & IPv6Suportul IPv6 este momentan indisponibil în Franța, Finlanda sau Țările de Jos. incluse
  • Backup automat gratuitInclude un spațiu de backup pe care îl poți configura pentru rulare zilnică, săptămânală sau lunară.

EPYC VPS.P6

$59.99 Save  25 %
$44.99 Lunar
  • 8 vCPU AMD EPYC
  • 32 GB RAMMEMORIE
  • 200 GB NVMeSTOCARE
  • Trafic nelimitat
  • IPv4 & IPv6Suportul IPv6 este momentan indisponibil în Franța, Finlanda sau Țările de Jos. incluse
  • Backup automat gratuitInclude un spațiu de backup pe care îl poți configura pentru rulare zilnică, săptămânală sau lunară.

EPYC VPS.P7

$69.99 Save  29 %
$49.99 Lunar
  • 16 vCPU AMD EPYC
  • 32 GB RAMMEMORIE
  • 240 GB NVMeSTOCARE
  • Trafic nelimitat
  • IPv4 & IPv6Suportul IPv6 este momentan indisponibil în Franța, Finlanda sau Țările de Jos. incluse
  • Backup automat gratuitInclude un spațiu de backup pe care îl poți configura pentru rulare zilnică, săptămânală sau lunară.

Genoa VPS.G2

$24.99 Save  20 %
$19.99 Lunar
  • 2 vCPUAMD EPYC Genoa generația a 4-a 9xx4 cu 3,25 GHz sau similar, pe arhitectura Zen 4. AMD EPYC G4
  • 4 GB DDR5MEMORIE
  • 50 GB NVMeSTOCARE
  • Trafic nelimitat
  • IPv4 & IPv6Suportul IPv6 este momentan indisponibil în Franța, Finlanda sau Țările de Jos. incluse
  • Backup automat gratuitInclude un spațiu de backup pe care îl poți configura pentru rulare zilnică, săptămânală sau lunară.

Genoa VPS.G4

$44.99 Save  22 %
$34.99 Lunar
  • 4 vCPUProcesor AMD EPYC cu nuclee vCPU dedicate, pe hardware de server pentru companii. AMD EPYC G4
  • 8 GB DDR5MEMORIE
  • 100 GB NVMeSTOCARE
  • Trafic nelimitat
  • IPv4 & IPv6Suportul IPv6 este momentan indisponibil în Franța, Finlanda sau Țările de Jos. incluse
  • Backup automat gratuitInclude un spațiu de backup pe care îl poți configura pentru rulare zilnică, săptămânală sau lunară.

Genoa VPS.G6

$89.99 Save  22 %
$69.99 Lunar
  • 8 vCPUProcesor AMD EPYC cu nuclee vCPU dedicate, pe hardware de server pentru companii. AMD EPYC G4
  • 16 GB DDR5MEMORIE
  • 200 GB NVMeSTOCARE
  • Trafic nelimitat
  • IPv4 & IPv6Suportul IPv6 este momentan indisponibil în Franța, Finlanda sau Țările de Jos. incluse
  • Backup automat gratuitInclude un spațiu de backup pe care îl poți configura pentru rulare zilnică, săptămânală sau lunară.

Genoa VPS.G7

$159.99 Save  22 %
$124.99 Lunar
  • 8 vCPUProcesor AMD EPYC cu nuclee vCPU dedicate, pe hardware de server pentru companii. AMD EPYC G4
  • 32 GB DDR5MEMORIE
  • 250 GB NVMeSTOCARE
  • Trafic nelimitat
  • IPv4 & IPv6Suportul IPv6 este momentan indisponibil în Franța, Finlanda sau Țările de Jos. incluse
  • Backup automat gratuitInclude un spațiu de backup pe care îl poți configura pentru rulare zilnică, săptămânală sau lunară.

AMD Ryzen VPS.R1

$16.99 Save  18 %
$13.99 Lunar
  • 1 CPU dedicat AMD Ryzen 9 7950X cu 4,5 GHz sau similar, pe arhitectura Zen 4. vCPU
  • 4 GB DDR5MEMORIE
  • 50 GB NVMeSTOCARE
  • Trafic nelimitat
  • IPv4 & IPv6 incluse Suportul IPv6 este momentan indisponibil în Franța, Finlanda sau Țările de Jos.
  • Backup automat inclus

AMD Ryzen VPS.R2

$29.99 Save  17 %
$24.99 Lunar
  • 2 CPU dedicate AMD Ryzen 9 7950X cu 4,5 GHz sau similar, pe arhitectura Zen 4. vCPU
  • 8 GB DDR5MEMORIE
  • 100 GB NVMeSTOCARE
  • Trafic nelimitat
  • IPv4 & IPv6 incluse Suportul IPv6 este momentan indisponibil în Franța, Finlanda sau Țările de Jos.
  • Backup automat inclus

AMD Ryzen VPS.R4

$109.99 Save  18 %
$89.99 Lunar
  • 8 CPU dedicate AMD Ryzen 9 7950X cu 4,5 GHz sau similar, pe arhitectura Zen 4. vCPU
  • 32 GB DDR5MEMORIE
  • 400 GB NVMeSTOCARE
  • Trafic nelimitat
  • IPv4 & IPv6 incluse Suportul IPv6 este momentan indisponibil în Franța, Finlanda sau Țările de Jos.
  • Backup automat inclus

FAQ

How many sub-agents can I run on one VPS?

There's no hard limit. Sub-agents are logical entities within a single ZeroClaw process, not separate services. The resource cost is the memory for each agent's context window, which is minimal. The real constraint is concurrent API calls to your providers, since each active sub-agent task means a separate API request.

Automate faster, for less

Bring your winning ideas to life with AMD power, NVMe speed and unmetered bandwidth. Deploy your VPS in seconds, with a pre-installed ZeroClaw template on Ubuntu 24.04.