MCPcopy
hub / github.com/langchain-ai/deepagents

github.com/langchain-ai/deepagents @main sqlite

repository ↗ · DeepWiki ↗
19,644 symbols 87,713 edges 695 files 14,159 documented · 72%
README

  <img alt="Deep Agents Logo" src="https://github.com/langchain-ai/deepagents/raw/main/github/images/logo-dark.svg" width="50%">

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:

  • Opinionated — defaults tuned for long-horizon, multi-step work
  • Extensible — override or replace any piece without forking
  • Model-agnostic — works with any LLM that supports tool calling: frontier, open-weight, or local
  • Production-ready — built on LangGraph (streaming, persistence, checkpointing) with first-class tracing, evaluation, and deployment via LangSmith

Features include:

  • Sub-agents — delegate tasks to agents with isolated context windows
  • Filesystem — read, write, edit, or search over pluggable local, sandboxed, or remote backends
  • Context management — summarize long threads and offload tool outputs to disk
  • Shell access — run commands in your sandbox of choice
  • Persistent memory — pluggable state and store backends for cross-session recall
  • Human-in-the-loop — approve, edit, or reject tool calls before they run
  • Skills — reusable behaviors the agent can load on demand
  • Tools — bring your own functions or any MCP server

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-5.5",
    tools=[my_custom_tool],
    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.

Core symbols most depended-on inside this repo

pause
called by 2774
libs/code/deepagents_code/widgets/loading.py
append
called by 950
libs/code/deepagents_code/widgets/message_store.py
get
called by 839
libs/code/deepagents_code/notifications.py
append
called by 621
libs/partners/quickjs/langchain_quickjs/_repl.py
create_deep_agent
called by 364
libs/deepagents/deepagents/graph.py
tool_call
called by 314
libs/evals/tests/evals/utils.py
_mount_message
called by 306
libs/code/deepagents_code/app.py
clear
called by 249
libs/code/deepagents_code/input.py

Shape

Method 11,798
Function 5,378
Class 2,266
Route 202

Languages

Python100%
TypeScript1%

Modules by API surface

libs/code/tests/unit_tests/test_app.py1,086 symbols
libs/code/tests/unit_tests/test_config.py469 symbols
libs/code/deepagents_code/app.py419 symbols
libs/code/tests/unit_tests/test_model_config.py417 symbols
libs/code/tests/unit_tests/test_update_check.py360 symbols
libs/code/tests/unit_tests/test_messages.py326 symbols
libs/code/tests/unit_tests/test_chat_input.py272 symbols
libs/code/tests/unit_tests/test_thread_selector.py267 symbols
libs/code/tests/unit_tests/test_textual_adapter.py230 symbols
libs/deepagents/tests/unit_tests/test_models.py223 symbols
libs/code/tests/unit_tests/test_agent.py208 symbols
libs/code/tests/unit_tests/test_theme.py197 symbols

Dependencies from manifests, versioned

qrcode-terminal0.12.0 · 1×
whatsapp-web.js1.26.0 · 1×
agent-client-protocol0.10.1 · 1×
daytona
deepagents0.7.0a3 · 1×
fastapi0.138.1 · 1×
google-genai2.10.0 · 1×
httpx0.28.1 · 1×
ipykernel7.3.0 · 1×
jupyter1.1.1 · 1×
langchain-anthropic1.4.7 · 1×
langchain-community0.4.2 · 1×

For agents

$ claude mcp add deepagents \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact