--- title: "Workspace" type: concept tags: [OpenClaw, Agent架构] last_updated: 2026-04-15 --- ## 定义 OpenClaw 中 Agent 的工作台目录(默认路径 `~/.openclaw/workspace/`),包含决定 Agent 如何工作的所有配置文件。sub-agent 也适用相同结构。 ## 核心文件组成 | 文件 | 职责 | 类型 | |------|------|------| | [[AGENTS.md]] | 岗位职责说明书 | 功能性 | | [[SOUL.md]] | 性格档案 | 人格性 | | [[USER.md]] | 用户偏好固化 | 上下文 | | [[TOOLS.md]] | 工具权限规范 | 安全性 | | [[IDENTITY.md]] | 结构化身份元数据 | 元数据 | | [[BOOTSTRAP.md]] | 一次性初始化引导 | 引导 | | memory/ | 长期记忆目录 | 持久化 | ## 与 agentDir 的区别 - **Workspace**:决定 Agent 怎么工作(配置层) - **agentDir**:openclaw.json 中的配置字段,指向运行态目录(存储层) - **sessions**:工作日志,记录对话历史(历史层) 三者职责不同,不可混为一谈。 ## 核心价值 让 Agent 从"每次重新 onboarding"转变为"记得上下文、偏好和历史"的长期搭档。 ## Connections - [[Workspace]] ← 组成部分 ← [[AGENTS.md]] + [[SOUL.md]] + [[USER.md]] + [[TOOLS.md]] + [[IDENTITY.md]] + [[BOOTSTRAP.md]] + [[长期记忆]] - [[Workspace]] ← 属于 ← [[OpenClaw]] - [[长期记忆]] ← 承载 ← [[Workspace]]