Agent 配置

OpenClaw 的 Agent 行为主要由工作空间文件驱动。

工作空间关键文件

默认目录:~/.openclaw/workspace/

文件作用
AGENTS.md行为规范
SOUL.md人格与表达风格
USER.md用户背景与偏好
TOOLS.md本地工具笔记
MEMORY.md长期记忆(仅主会话加载)

常用会话命令

/new          # 新建会话
/reset        # 重置当前会话
/model <alias> # 切换模型
/thinking off|low|high  # 调整思考深度
/status       # 查看当前状态

多 Agent 配置

可以配置多个 Agent,各自拥有独立的工作空间、模型和身份:

{
  agents: {
    list: [
      {
        id: "personal",
        default: true,
        workspace: "~/.openclaw/workspace-personal",
        model: "anthropic/claude-opus-4-6",
        identity: { name: "小助", emoji: "🤖" },
      },
      {
        id: "work",
        workspace: "~/.openclaw/workspace-work",
        model: "anthropic/claude-sonnet-4-5",
        identity: { name: "工作助手", emoji: "💼" },
      },
    ],
  },
}

Agent 选择

当配置了多个 Agent 时,可通过以下方式切换:

  • 在聊天中使用 /agent <id> 命令
  • 在不同渠道绑定不同 Agent
  • 设置 default: true 指定默认 Agent

多实例 vs 多 Agent 的策略选择、Workspace 共享方案、模型按角色分配等实战内容,参见 多 Agent 配置实战