-
Memory:跨 sessions 持久存在的
AGENTS.mdfiles 和 auto-saved memories。使用 memory 保存通用 coding style、preferences 和已学习的 conventions。 - Skills:可复用、按需启用的 capabilities,agent 只会在相关时发现并读取。使用 skills 保存 task-specific context,例如 workflows、best practices 和 reference docs。
/remember 显式提示 agent 基于当前 conversation 更新其 memory 和 skills。
Memory
Automatic memory
使用 agent 时,它会通过 memory-first protocol 自动将信息作为 markdown files 存储在~/.deepagents/<agent_name>/memories/ 中:
- Research:开始 tasks 前搜索 memory 中的相关 context
- Response:执行期间不确定时检查 memory
- Learning:自动保存新信息,供 future sessions 使用
AGENTS.md files
AGENTS.md files 提供持久 context,并始终在 session start 时加载:
- Global:
~/.deepagents/<agent_name>/AGENTS.md,每个 session 都会加载。 - Project:任意 git project root 中的
.deepagents/AGENTS.md,当 Deep Agents Code 从该 project 内运行时加载。
Memory 工作方式
当回答 project-specific questions,或你引用过去的 work 或 patterns 时,agent 也可能读取其 memory files。 当你提供有关 agent 应如何行为的信息、对其工作的反馈,或要求它记住某些内容时,agent 会更新AGENTS.md。
如果 agent 从你的 interactions 中识别出 patterns 或 preferences,也会更新其 memory。
若要在 additional memory files 中添加更结构化的 project knowledge,请将它们添加到 .deepagents/,并在 AGENTS.md file 中引用它们。
你必须在 AGENTS.md file 中引用 additional files,agent 才会知道它们。
这些 additional files 不会在 startup 时读取,但 agent 可在需要时引用和更新它们。
何时使用 global 或 project AGENTS.md
将 globalAGENTS.md(~/.deepagents/agent/AGENTS.md)用于:
- 你的 personality、style 和 universal coding preferences
- 通用 tone 和 communication style
- Universal coding preferences(formatting、type hints 等)
- 适用于各处的 tool usage patterns
- 不随 project 改变的 workflows 和 methodologies
AGENTS.md(project root 中的 .deepagents/AGENTS.md)用于:
- Project-specific context 和 conventions
- Project architecture 和 design patterns
- 此 codebase 专用 coding conventions
- Testing strategies 和 deployment processes
- Team guidelines 和 project structure
Skills
Skills 会将 domain expertise(例如 workflows、best practices、scripts 和 reference docs)打包进可复用 directories,agent 只会在相关时发现并读取。 Deep agent skills 遵循 Agent Skills specification。关于 skills 如何工作以及如何编写有效 skills,请参阅 Skills。 启动时,Deep Agents Code 会从每个SKILL.md file 的 frontmatter 读取 name 和 description。当 task 匹配 skill description 时,agent 会读取 skill file 并遵循其中 instructions。Discovery 会在 /reload 时再次运行。
添加 skill
添加可选 resources
可以选择向
test-skill folder 添加 additional scripts 或其他 resources。更多信息请参阅 What are skills。安装 community skills
你可以使用 Vercel 的 Skills CLI 等 tools,在你的 environment 中安装 community Agent Skills,并让 deep agents 可以使用它们:-g)会将 skills symlink 到 ~/.deepagents/agent/skills/,即 default agent 的 user-level skills directory。Project-level installs(省略 -g)会将 skills 放入相对于当前 directory 的 .deepagents/skills/,让在该 project 中运行的任何 agent 都能使用,无论 agent name 是什么。
Global installs 仅面向 default
agent directory。如果你使用 custom-named agent,请使用 project-level installs,或手动将 skill symlink 到 ~/.deepagents/{your-agent}/skills/。Skill discovery
启动时会从以下 directories 加载 skills:.deepagents/skills/ 或 .agents/skills/ 下),project root 通过包含 .git folder 来识别。
在 session 中调用 skill
在 interactive session 中,使用/skill:<name> slash command 直接运行 skill:
SKILL.md instructions 会与传入的任何 arguments 一起注入 prompt。
使用 skill 启动
--skill flag 会在启动时立即调用 skill,适用于 interactive(TUI)或 non-interactive(headless)mode:
--skill 与 --quiet 或 --no-stream 一起使用时,需要 -n(non-interactive mode)。列出 skills
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

