💡 摘要
Deep Agents 是一个可定制的代理工具,简化了 AI 代理的创建和管理。
🎯 适合人群
🤖 AI 吐槽: “看起来很能打,但别让配置把人劝退。”
风险:Medium。建议检查:是否执行 shell/命令行指令;是否发起外网请求(SSRF/数据外发);API Key/Token 的获取、存储与泄露风险;文件读写范围与路径穿越风险;依赖锁定与供应链风险。以最小权限运行,并在生产环境启用前审计代码与依赖。
What is Deep Agents?
Deep Agents is an agent harness. An opinionated, ready-to-run agent out of the box. Instead of wiring up prompts, tools, and context management yourself, you get a working agent immediately and customize what you need.
What's included:
- Planning —
write_todos/read_todosfor task breakdown and progress tracking - Filesystem —
read_file,write_file,edit_file,ls,glob,grepfor reading and writing context - Shell access —
executefor running commands (with sandboxing) - Sub-agents —
taskfor delegating work with isolated context windows - Smart defaults — Prompts that teach the model how to use these tools effectively
- Context management — Auto-summarization when conversations get long, large outputs saved to files
Quickstart
pip install deepagents # or uv add deepagents
from deepagents import create_deep_agent agent = create_deep_agent() result = agent.invoke({"messages": [{"role": "user", "content": "Research LangGraph and write a summary"}]})
The agent can plan, read/write files, and manage its own context. Add tools, customize prompts, or swap models as needed.
Customization
Add your own tools, swap models, customize prompts, configure sub-agents, and more. See the documentation for full details.
from langchain.chat_models import init_chat_model agent = create_deep_agent( model=init_chat_model("openai:gpt-4o"), tools=[my_custom_tool], system_prompt="You are a research assistant.", )
MCP is supported via langchain-mcp-adapters.
Deep Agents CLI
Try Deep Agents instantly from the terminal:
uv tool install deepagents-cli deepagents
The CLI adds conversation resume, web search, remote sandboxes (Modal, Runloop, Daytona), persistent memory, custom skills, and human-in-the-loop approval. See the CLI documentation for more. Using the Deep Agents requires setting an API Key before running (ex: ANTHROPIC_API_KEY).
LangGraph Native
create_deep_agent returns a compiled LangGraph graph. Use it with streaming, Studio, checkpointers, or any LangGraph feature.
FAQ
Why should I use this?
- 100% open source — MIT licensed, fully extensible
- Provider agnostic — Works with Claude, OpenAI, Google, or any LangChain-compatible model
- Built on LangGraph — Production-ready runtime with streaming, persistence, and checkpointing
- Batteries included — Planning, file access, sub-agents, and context management work out of the box
- Get started in seconds —
pip install deepagentsoruv add deepagentsand you have a working agent - Customize in minutes — Add tools, swap models, tune prompts when you need to
Resources
- Documentation — Full API reference and guides
- Examples — Working agents and patterns
- CLI — Interactive terminal interface
Security
Deep Agents follows a "trust the LLM" model. The agent can do anything its tools allow. Enforce boundaries at the tool/sandbox level, not by expecting the model to self-police.
优点
- 完全开源且可扩展
- 与各种模型兼容,不受提供者限制
- 开箱即用的基本功能
- 快速设置和简单定制
缺点
- 需要设置 API 密钥以获得完整功能
- 复杂任务可能需要额外配置
- 信任模型依赖于工具/沙箱边界
- 文档中的示例有限
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 langchain-ai.
