Files
nexus/wiki/concepts/Workspace.md
2026-04-17 09:34:39 +08:00

55 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Workspace"
type: concept
tags: [OpenClaw, Agent]
---
## 定义
Workspace 是 OpenClaw 中 Agent 的工作台目录,包含决定 Agent 如何工作的配置文件体系。默认路径为 `~/.openclaw/workspace/`(主 Agent 和 sub-agent 都适用)。
## 目录结构
```
~/.openclaw/
├── openclaw.json # 总控配置,整个系统的"宪法"
├── workspace/ # 默认情况下主 Agent 的工作区
│ ├── AGENTS.md # Agent 的行为规则与多Agent协调
│ ├── SOUL.md # Agent 的叙事性格设定
│ ├── USER.md # 用户画像与偏好
│ ├── IDENTITY.md # Agent 身份元数据
│ ├── TOOLS.md # 工具权限声明与使用规范
│ ├── HEARTBEAT.md # 会话节奏/状态提示
│ ├── BOOTSTRAP.md # 首次启动引导(完成后删除)
│ ├── BOOT.md # 启动检查清单
│ ├── MEMORY.md # 长期知识总表
│ ├── memory/ # 按日期滚动的记忆笔记
│ ├── skills/ # 技能包目录
│ └── canvas/ # 画布/可视化上下文
└── agents/ # 各 Agent 的运行态目录
```
## 核心文件职责
| 文件 | 职责 |
|------|------|
| AGENTS.md | 岗位说明书——做什么、不该做什么 |
| SOUL.md | 性格档案——是谁、什么风格 |
| USER.md | 用户偏好——用户是什么样、喜欢什么 |
| IDENTITY.md | 身份元数据——名字、emoji、头像 |
| TOOLS.md | 工具规范——工具权限和使用原则 |
| BOOTSTRAP.md | 初始化引导——一次性使用后删除 |
| memory/ | 长期记忆——跨会话积累 |
## 关键区分
- **workspace**:管"这个 Agent 平时怎么干活"
- **openclaw.json**:管"这个系统怎么把它跑起来"
- **agentDir**openclaw.json 里的一个配置字段,指向存放运行状态的目录
- **sessions**:工作日志,记对话历史
## 价值
workspace 这套文件体系,解决的核心问题是:**怎么让 Agent 从"能工作"变成"好用"**。配合好了Agent 不再是每次都要重新 onboarding 的陌生人,而是一个真正懂你、记得你、靠谱的长期搭档。
## 来源
- [[万字讲透OpenClaw🦞从"能用"到"真好用"的分水岭Workspace 深度解析]]
## 相关
- [[OpenClaw]]:包含 workspace 的 AI Agent 管理工具
- [[AGENTS.md]]、[[SOUL.md]]、[[USER.md]]、[[IDENTITY.md]]、[[TOOLS.md]]、[[BOOTSTRAP.md]]、[[Memory 目录]]