When to Reach for Advanced Features

Start with the basics: a single agent with a few built-in tools handles the majority of automation tasks. Reach for advanced features when your use case demands more — when a task is too large for one context window, when you need the agent to remember facts across sessions, when latency demands parallel execution, or when you want to build a product on top of OpenClaw's extension APIs.

Advanced Feature Overview

FeatureUse CaseComplexityKey Module
Multi-AgentParallel subtasks, specialist delegation, long pipelinesMediumopenclaw.multi
Memory SystemsCross-session recall, personalization, knowledge accumulationMediumopenclaw.memory
Custom ToolsFirst-party API integration, proprietary data sourcesLow@tool decorator
Plugin DevDistributable extensions with lifecycle hooksMediumopenclaw.plugin
RAG IntegrationGrounding agents in private or large knowledge basesMediumopenclaw.rag
Event-DrivenTrigger agents from webhooks, cron, file changesLowopenclaw.events
Tool ChainingDeterministic sequential pipelines with branchingMediumopenclaw.chain
Fine-TuningDomain-specific accuracy, reduced prompt verbosityHighFine-tune API

Multi-Agent Quick Example

from openclaw.multi import Coordinator, Worker

researcher = Worker(role="researcher", tools=["web_search"])
writer = Worker(role="writer", tools=["read_file", "write_file"])

pipeline = Coordinator(
    workers=[researcher, writer],
    strategy="sequential"  # or "parallel"
)

result = pipeline.run("Research AI regulation trends and draft a summary")
print(result.output)

Sections

Memory Systems Quick Start

Add persistent memory to let agents remember facts, completed tasks, and user preferences across separate sessions. The memory config block is the entry point:

# openclaw.yaml
memory:
  backend: redis        # none | redis | sqlite | chroma | pinecone
  url: redis://localhost:6379/0
  ttl: 86400            # seconds to keep short-term memories (0 = forever)
  max_short_term: 20    # rolling window of recent messages
  semantic_search: true # enable similarity search over long-term memory

Then access memory programmatically:

agent = openclaw.Agent(provider="openai", model="gpt-4o-mini")

# Store a fact
agent.memory.store("user_name", "Alice")
agent.memory.store("project", "Project Phoenix")

# Later, in another session
name = agent.memory.recall("user_name")
print(f"Welcome back, {name}")  # Welcome back, Alice

# Semantic search across all stored memories
results = agent.memory.search("What projects is the user working on?", top_k=3)

RAG Integration Quick Start

Connect a private knowledge base (company docs, codebase, support tickets) to your agent using built-in RAG support. OpenClaw handles chunking, embedding, and retrieval automatically:

from openclaw.rag import RAGStore
import openclaw

# Step 1: Index your documents once
store = RAGStore(backend="chroma", collection="company-docs")
store.index_directory("/path/to/docs", file_types=[".pdf", ".md", ".txt"])

# Step 2: Attach the store to an agent
agent = openclaw.Agent(
    provider="openai",
    model="gpt-4o",
    rag_store=store,
    rag_top_k=5,        # inject top 5 relevant chunks into context
)

# Step 3: The agent automatically retrieves relevant context
result = agent.run("What is the refund policy for enterprise subscriptions?")
print(result.output)  # Grounded answer from your documents

Parallel Multi-Agent Execution

When a task can be broken into independent subtasks, use strategy="parallel" in the Coordinator to run multiple agents simultaneously and merge results:

from openclaw.multi import Coordinator, Worker

# These three workers run simultaneously
trend_researcher = Worker(role="trend_researcher", tools=["web_search"])
competitor_analyst = Worker(role="competitor_analyst", tools=["web_search", "fetch_url"])
data_aggregator = Worker(role="data_aggregator", tools=["sql_query"])

pipeline = Coordinator(
    workers=[trend_researcher, competitor_analyst, data_aggregator],
    strategy="parallel",
    merge_strategy="llm_synthesis",  # final agent synthesises all outputs
)

result = pipeline.run("Produce a competitive intelligence report for Q2 2026")
print(result.output)

Event-Driven Trigger Reference

OpenClaw agents can be triggered by external events without a persistent HTTP server:

Trigger TypeConfig KeyExample Use Case
Cron scheduletriggers.cronDaily report at 08:00 UTC
Webhook (HTTP POST)triggers.webhookRun agent when GitHub PR is opened
File watchertriggers.file_watchProcess new CSV dropped in S3 bucket
Queue messagetriggers.queueConsume tasks from RabbitMQ or SQS
Database polltriggers.db_pollProcess new rows inserted into a table