Core Features โšก Intermediate

OpenClaw Agent Complete Guide: Build Your AI Double

The Agent is the soul role of OpenClaw โ€” it understands your intent, auto-selects Skills, and even decides what to do next on its own.

๐Ÿ“ ๅปบ็ซ‹๏ผš2026ๅนด2ๆœˆ24ๆ—ฅ โœ… ๆœ€ๅพŒ้ฉ—่ญ‰๏ผš2026ๅนด2ๆœˆ24ๆ—ฅ
้ดจ็ทจ ๅกไฝๅพˆๆญฃๅธธโ€”โ€”้ปžๆฎต่ฝๆ—็š„ ๐Ÿ˜ต ๅก้—œ ่ฎ“ๆˆ‘ๅ€‘็Ÿฅ้“๏ผŒๆˆ–็›ดๆŽฅๅพ€ไธ‹ๆปพๅˆฐๅ•็ญ”ๅ€็™ผๅ•ใ€‚ ไนŸๅฏไปฅ็”จ ๐Ÿ‘ ็œ‹ๆ‡‚ / ๐Ÿ˜ข ็œ‹ไธๆ‡‚ ๅ‘Š่จดๆˆ‘ๅ€‘ๅ“ช่ฃกๅฏซๅพ—ๅฅฝใ€ๅ“ช่ฃก่ฆๆ”นใ€‚

What Is an Agent? How Is It Different from a Chatbot?

Letโ€™s cut to the chase:

Chatbot = You ask a question, it answers Agent = You give a goal, it figures out how to accomplish it

An Example

Chatbot mode (like ChatGPT):

You: Help me look up the latest AI news
Bot: Here are some recent AI news stories... (lists results)
You: Organize these into a table
Bot: Sure, here's the table format... (outputs table)
You: Save it to my Google Drive
Bot: Sorry, I can't access your Google Drive

Every step requires you to manually give instructions, and the Chatbot canโ€™t access external tools.

Agent mode (OpenClaw):

You: Organize the latest AI news into a table and save to the "Weekly Reports" folder on Google Drive
Agent: Got it, I'll handle this.
  โ†’ Step 1: Search latest AI news โœ…
  โ†’ Step 2: Organize into table format โœ…
  โ†’ Step 3: Save to Google Drive "Weekly Reports" folder โœ…
Agent: Done! File saved to Google Drive as "AI_News_Weekly_2026-02-24"

One sentence, done. The Agent plans the steps, selects the tools, and executes to completion on its own.


How Agents Work

OpenClawโ€™s Agent is based on the ReAct (Reasoning + Acting) framework:

                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚ Your Command  โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚  Think        โ”‚ โ† Understand intent, plan steps
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚  Act          โ”‚ โ† Select Skill or tool
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚  Observe      โ”‚ โ† Check results
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚  Done/Continue?โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ†™         โ†˜
                  Done          Continue โ†’ Back to "Think"

Key Concept: The Agent Loop

An Agent doesnโ€™t just execute once and stop. It keeps looping until the task is complete:

  1. Think: โ€œWhat does the user want? How should I do this?โ€
  2. Act: โ€œIโ€™ll use web_search to look up the newsโ€
  3. Observe: โ€œFound 10 results, quality looks goodโ€
  4. Decide: โ€œThatโ€™s enough, moving to next stepโ€ or โ€œResults arenโ€™t good enough, trying different keywordsโ€

This is why Agents are smarter than Chatbots โ€” they adjust their behavior based on results.


Build Your First Agent

Agent Configuration File

# ๐Ÿ“„ my-agent.yaml
name: "Work Assistant"
description: "An all-around work assistant skilled in data organization, Email handling, and report writing"

# LLM the Agent uses
model:
  provider: openai
  name: gpt-4
  temperature: 0.7

# Skills the Agent can use
skills:
  - email-morning-summary
  - weekly-news-digest
  - meeting-notes-organizer
  - competitor-monitor

# Tools the Agent can use
tools:
  - web_search
  - google_drive
  - gmail
  - notion

# Agent behavior settings
behavior:
  # Maximum number of steps (prevents infinite loops)
  max_steps: 20
  # When encountering uncertainty...
  on_uncertainty: ask_user  # ask_user | best_guess | stop
  # Whether to show the thinking process
  verbose: true

Configuration Breakdown

model: Choose the LLM

model:
  provider: openai    # openai / anthropic / google / local
  name: gpt-4        # Specific model name
  temperature: 0.7    # 0 = precise, 1 = creative
ModelStrengthsBest For
GPT-4Strongest reasoningComplex task planning
GPT-4oFast, lower costMost daily tasks
Claude 3.5Excellent at long textDocument analysis, long reports
Gemini ProGoogle ecosystem integrationGoogle tool connections
Local models (Ollama)Completely free, privateSensitive data handling

skills: The Agentโ€™s Skill Library

The Agent automatically selects the appropriate Skill based on your command. You donโ€™t need to specify โ€œwhich Skill to useโ€ โ€” the Agent figures it out.

You: "Summarize today's important Emails for me"
Agent thinks: This is related to Email processing...
         โ†’ Selects "email-morning-summary" Skill
         โ†’ Execute!

behavior: The Agentโ€™s โ€œPersonality Settingsโ€

on_uncertainty: ask_user

This determines what the Agent does when itโ€™s unsure:

  • ask_user: โ€œIโ€™m not sure which folder you want to save to, can you specify?โ€
  • best_guess: Agent decides on its own, might be wrong but more efficient
  • stop: Stops and waits for your decision

Multi-Agent Collaboration

OpenClaw supports multiple Agents working simultaneously, each responsible for a different domain:

# ๐Ÿ“„ agent-team.yaml
agents:
  - name: "Researcher"
    speciality: "Data collection and analysis"
    skills: [web_search, document_analysis]
    
  - name: "Editor"
    speciality: "Content writing and polishing"
    skills: [content_writing, translation]
    
  - name: "Secretary"
    speciality: "Communication and schedule management"
    skills: [email_management, calendar]

# Collaboration mode
collaboration:
  mode: sequential  # sequential | parallel | hierarchical
  coordinator: "Secretary"  # Secretary coordinates

Three Collaboration Modes

ModeDescriptionBest For
sequentialOne finishes, then the next startsTasks with a specific order
parallelRun simultaneouslyIndependent, non-dependent tasks
hierarchicalManager Agent assigns workComplex, large-scale tasks

Real-World Example: Weekly Industry Report

You: "Create this week's AI industry report for me"

Secretary (coordinator): Got it, assigning work
  โ†’ Researcher: Search this week's AI-related news and papers
  โ†’ Editor: After Researcher finishes, organize into report format
  โ†’ Secretary: Once report is done, send to team members

The Agentโ€™s Memory System

Agents donโ€™t just โ€œexecute commandsโ€ โ€” they have memory:

Short-term Memory (Conversation Memory)

You: I'm working on a marketing project
Agent: Got it, what can I help with?

You: Help me search for relevant case studies
Agent: Sure, searching for "marketing project case studies" (remembers you're working on a marketing project)

Long-term Memory (Persistent Memory)

Last week's conversation:
You: Our company's target audience is office workers aged 25-35

This week's conversation:
You: Help me write an ad copy
Agent: Based on the target audience you mentioned before (office workers aged 25-35),
       I've drafted a targeted copy for you...

Duck Editor Want to dive deeper into the memory system? See Soul: Give Your Agent Memory and Personality


Agent Debugging Tips

1. Enable Verbose Mode

behavior:
  verbose: true

When enabled, the Agent shows its thinking process at every step, making it easier to find problems.

2. Check Execution Logs

# View logs from the most recent execution
openclaw logs --last

# View logs for a specific Agent
openclaw logs --agent "Work Assistant" --limit 5

3. Common Issue Troubleshooting

IssuePossible CauseSolution
Agent keeps looping on the same stepmax_steps too high or condition logic errorSet a reasonable max_steps
Agent picks the wrong SkillSkillโ€™s description isnโ€™t clear enoughImprove the Skill description
Agent responds too slowlyModel too large or too many stepsSwitch to a faster model
Agent doesnโ€™t understand the commandInstructions too vagueDescribe what you want more clearly

Best Practices

1. Start Simple

Build a single-function Agent first, confirm it works, then gradually add more Skills.

2. Write Clear Skill Descriptions

The Agent chooses Skills based on their description. The clearer the description, the less likely the Agent is to pick the wrong one.

# โŒ Bad description
description: "Handle Email"

# โœ… Good description
description: "Read unread Emails, classify by importance, organize into a daily summary"

3. Set Up Safety Guardrails

behavior:
  max_steps: 20          # Limit step count
  on_uncertainty: ask_user  # Ask when unsure
  confirm_before:          # Confirm before these actions
    - gmail_send
    - google_drive_delete

Next Steps

้€™็ฏ‡ๆ–‡็ซ ๅฐไฝ ๆœ‰ๅนซๅŠฉๅ—Ž๏ผŸ

๐Ÿ’ฌ ๅ•็ญ”ๅ€

ๅก้—œไบ†๏ผŸ็›ดๆŽฅๅœจ้€™่ฃกๅ•๏ผŒๅ…ถไป–่ฎ€่€…ๅ’Œไฝœ่€…้ƒฝ่ƒฝๅนซๅฟ™่งฃ็ญ”ใ€‚

่ผ‰ๅ…ฅไธญ...

Found this useful? Share it with a friend whoโ€™s also getting their hands dirty

Share on LINE