deepagents README

The project's README from github.com/langchain-ai/deepagents. As one markdown file: README.md.

Deep Agents Logo

The batteries-included agent harness.

PyPI - License PyPI - Downloads Version Twitter / X

Deep Agents is an open source agent harness — an opinionated agent that runs out of the box. Extend, override, or replace any piece.

Principles:

Features include:

Deep Agents is available as a JavaScript/TypeScript library — see deepagents.js.

[!NOTE] Deep Agents Code — a pre-built coding agent in your terminal, similar to Claude Code or Cursor, powered by any LLM. Install with curl -LsSf https://langch.in/dcode | bash. See the documentation for the full feature set.

Quickstart

uv add deepagents
from deepagents import create_deep_agent

agent = create_deep_agent(
    model="openai:gpt-6-astra",
    system_prompt="You are a research assistant.",
)
result = agent.invoke({"messages": "Research LangGraph and write a summary"})

The agent can plan, read/write files, and manage its own context. Add your own tools, swap models, customize prompts, configure sub-agents, and more. See the documentation for full details.

[!TIP] For developing, debugging, and deploying AI agents and LLM applications, see LangSmith.

FAQ

How is this different from LangGraph or LangChain?

LangGraph is the graph runtime. LangChain's create_agent is a minimal agent harness on top of it. Deep Agents is a more opinionated harness on top of create_agent — same building blocks, but with filesystem, sub-agents, context management, and skills bundled in. For how the three relate, see the LangChain ecosystem overview.

Does this work with open-weight or local models?

Yes. Any model that supports tool calling works — frontier APIs (OpenAI, Anthropic, Google), open-weight models hosted on providers like Baseten or Fireworks, and self-hosted models via Ollama, vLLM, or llama.cpp. Use any LangChain chat model.

Can I use this in production?

Yes! Deep Agents is built on LangGraph, designed for production agent deployments. Pair it with LangSmith for tracing, evaluation, and monitoring. See Going to production for the full guide.

When should I use Deep Agents vs. LangChain or LangGraph directly?

All three are layers in the same stack — see the LangChain ecosystem overview for how they relate. Use Deep Agents when you want the full harness — planning, context management, delegation — out of the box. Use LangChain's create_agent when you want a lighter harness without the bundled middleware. Drop to LangGraph when the agent loop itself isn't the right shape and you need a custom graph.

The layers compose: any LangGraph CompiledStateGraph can be passed in as a sub-agent to a Deep Agent, so custom orchestration plugs in alongside the harness's defaults.


Resources


Acknowledgements

Inspired by Claude Code: an attempt to identify what makes it general-purpose, and push that further.

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. See the security policy for more information.

deepagents (langchain-ai/deepagents)

Searching Database…

这是做什么的?Deep Agents 是 LangChain 出品的一个开箱即用的开源智能体框架:一个带有明确设计理念的智能体,内置了子智能体、文件系统、上下文管理和技能,装好就能直接用——而且每个部分都可以扩展、覆盖或替换,不需要 fork。
它是一个要集成到我自己代码里的库,还是一个做好的应用?是一个库:这里是 Python 版本,JavaScript/TypeScript 版本是 deepagents.js。底层运行在 LangGraph 运行时上,因此自带流式输出、持久化和检查点功能,可以直接用于生产环境部署。
我怎么把第一个智能体跑起来?按照 README 的快速入门来:刚创建的 Deep Agent 就已经能制定计划、读写文件、管理自己的上下文。之后你可以按照文档添加工具、更换模型、自定义提示词、配置子智能体。
我必须有 OpenAI 或 Anthropic 的密钥吗,还是随便什么模型都行?任何支持工具调用的模型都可以——OpenAI、Anthropic、Google 这类前沿 API,Baseten、Fireworks 等平台上的托管开源权重模型,或者通过 Ollama、vLLM、llama.cpp 自行部署的模型都行。用任意 LangChain 聊天模型即可。
它能执行 shell 命令、修改文件——那怎么防止它搞出破坏?默认没有任何限制:Deep Agents 遵循“信任 LLM”的模式,工具允许做什么,智能体就能做什么。你需要在工具或沙箱层面设置边界,也可以使用内置的人工确认模式(human-in-the-loop),在工具调用执行前先进行审批。
那我用它还得会写代码吗?要的——它面向的是用 Python 或 TypeScript、搭配自己的工具和模型来组装智能体的开发者。如果你是新手,仓库里有能直接跑的示例,LangChain 团队还提供免费的 LangChain Academy 课程。
开箱自带哪些东西?拥有独立上下文窗口的子智能体、可插拔的文件系统(支持本地、沙箱或远程后端)、能把长对话做摘要并把工具输出转存到磁盘的上下文管理、shell 访问、跨会话的持久记忆、人工审批、可加载的技能,以及任何 MCP 服务器都能当作工具使用。
它和 LangChain、LangGraph 有什么区别?它们是同一套技术栈的不同层次:LangGraph 是图运行时,LangChain 的 create_agent 是一个最简框架,Deep Agents 则是搭建在上面的、带有明确设计理念的完整框架,内置规划、上下文管理和任务委派。各层可以组合使用——任何 LangGraph 图都可以作为子智能体传入一个 Deep Agent。
Deep Agents Code 是什么?一个做好的终端编程智能体,类似 Claude Code 或 Cursor,但可以用你指定的任意 LLM 来驱动。安装命令:curl -LsSf | bash。
已经有 Claude Code 了,为什么还要做这个?这正是官方说明的灵感来源:Deep Agents 想弄清楚 Claude Code 为什么能成为通用工具,并把它更进一步——做成一个开源框架,支持任意 LLM,而且任何部分都可以替换。
Size
348.2 MB
Stars
30.4K
Age
1y
Commits · 90 Days