Files
nexus/wiki/concepts/Workspace.md
2026-04-22 16:03:25 +08:00

58 lines
2.2 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, Configuration]
sources: [万字讲透openclaw-workspace深度解析-2026-03-21]
last_updated: 2026-03-21
---
## Definition
**Workspace** 是 OpenClaw 中 Agent 的**工作台目录**(默认 `~/.openclaw/workspace/`),包含一系列 Markdown 配置文件,决定 Agent 怎么工作、什么性格、记住什么。
## 目录结构
```
~/.openclaw/
├── workspace/ # 默认情况下主 Agent 的工作区
│ ├── AGENTS.md # Agent 的行为规则与多 Agent 协调
│ ├── SOUL.md # Agent 的叙事性格设定
│ ├── USER.md # 用户画像与偏好
│ ├── IDENTITY.md # Agent 身份元数据(名字/emoji/头像)
│ ├── TOOLS.md # 工具权限声明与使用规范
│ ├── HEARTBEAT.md # 会话节奏/状态提示
│ ├── BOOTSTRAP.md # 首次启动引导(完成后应删除)
│ ├── MEMORY.md # 长期知识总表
│ ├── memory/ # 按日期滚动的记忆笔记
│ └── skills/ # 技能包目录
├── agents/<agentId>/ # 各 Agent 的运行态目录
└── openclaw.json # 总控配置
```
## 核心洞察
OpenClaw 使用者存在一条隐形分界线:
- 不会用 workspace 的人每次都要重新交代背景Agent 每次都像陌生人
- 会用 workspace 的人Agent 知道用户是谁、该怎么说话、记得上次积累的东西
**这条分界线,就是 workspace。**
## 与 agentDir / sessions 的区别
| 概念 | 职责 |
|------|------|
| **workspace** | Agent 的工作台,决定"怎么工作" |
| **agentDir** | openclaw.json 里的配置字段,指向运行状态目录 |
| **sessions** | 对话历史日志 |
## Related Concepts
- [[AGENTS.md]] — workspace 核心文件之一
- [[SOUL.md]] — workspace 核心文件之一
- [[USER.md]] — workspace 核心文件之一
- [[IDENTITY.md]] — workspace 核心文件之一
- [[TOOLS.md]] — workspace 核心文件之一
- [[Agent-Memory]] — workspace 中的长期记忆机制
- [[OpenClaw]] — Workspace 所属的框架