Agent
Understanding OpenClaw agents.
What is an Agent?
An agent is an AI entity that:
- Receives and processes messages
- Uses AI models to generate responses
- Has access to tools and skills
- Maintains conversation context
- Stores long-term memories
Agent Configuration
json5
{
agent: {
name: "Assistant",
model: "claude-3-5-sonnet",
systemPrompt: "You are a helpful assistant...",
temperature: 0.7,
tools: ["web-search", "code-execution"],
memory: {
enabled: true,
maxItems: 100
}
}
}Configuration Options
| Option | Description | Default |
|---|---|---|
name | Display name | "Assistant" |
model | AI model to use | Required |
systemPrompt | Custom instructions | Default prompt |
temperature | Creativity (0-1) | 0.7 |
tools | Enabled tools | [] |
memory | Memory settings | enabled |
System Prompt
The system prompt defines the agent's behavior:
json5
{
systemPrompt: `You are a helpful AI assistant.
- Be concise and clear
- Ask for clarification when needed
- Use tools when appropriate`
}Tools & Capabilities
Agents can use various tools:
- Web Search: Search the internet
- Code Execution: Run code
- Browser: Web automation
- File Operations: Read/write files
Multiple Agents
Create specialized agents for different tasks:
bash
openclaw agents create coding --model claude-3-5-sonnet
openclaw agents create writer --model gpt-4