All Tools
DeepAgents logo

DeepAgents

Deeper agent loops with planning, sub-agents, and persistent memory for longer-running tasks.

What is DeepAgents?

Deep Agents is an open source agent harness built by LangChain for constructing AI agents that handle long-running, complex, multi-step tasks. Unlike a basic AI agent that loops through tool calls reactively, a deep agent plans its work upfront, manages context across extended sessions, and delegates subtasks to specialized subagents. It is the architecture behind production systems like Claude Code and Google’s Deep Research, and it is the most practical way for developers today to build agents that behave more like a project-based colleague than a question-answering machine.

How Deep Agents works

A standard AI agent runs a simple loop: receive input, pick a tool, call the tool, return the result. This works fine for short tasks. It fails when the task is long, context grows too large, or different parts of the problem need different types of expertise. Deep Agents solves each of these failure points through four core mechanisms.

  • Planning tool: Before executing any task, the agent calls a built-in write_todos tool to decompose the goal into discrete steps. This is a living to-do list the agent can update as it learns more. Planning before acting is the single biggest reason deep agents outperform shallow ones on complex work.
  • File system for context management: Large language models have a fixed context window, meaning they can only hold so much information at once. Deep Agents offloads intermediate results, notes, and long tool outputs to a virtual filesystem. The agent reads what it needs, when it needs it, rather than keeping everything in memory.
  • Subagents: The main orchestrator agent can spawn specialized child agents using a built-in task tool. Each subagent gets its own clean, isolated context so it can go deep on a specific subtask without polluting the parent’s context. Subagents can also run in parallel, cutting total runtime on complex jobs.
  • Auto-summarization middleware: As conversations grow long, Deep Agents automatically compresses older messages. This keeps the agent effective over extended sessions without hitting context limits or running up unnecessary token costs.

The whole system is built on LangGraph for durable execution, which means streaming, checkpointing, and human-in-the-loop approval all work out of the box. You can swap model providers, plug in custom tools, and swap filesystem backends depending on your environment.

What you can build with Deep Agents

Deep Agents is for builders who need agents to complete work that feels more like a project than a single question. Here are concrete systems you can ship with it.

  • Deep research agent: An agent that receives a research question, plans a search strategy, spawns subagents to gather sources in parallel, synthesizes findings into a structured report, and saves the result to a file. LangChain ships an example of this pattern in the deepagents repository.
  • Autonomous coding agent: An agent that reads a codebase, plans a set of changes, writes and edits files, runs tests via the execute tool in a sandboxed environment, and commits passing code. This is the same pattern Claude Code uses, and Deep Agents was directly inspired by it.
  • Job application assistant: An agent that searches for open roles matching a candidate profile, generates tailored cover letters for each role using subagents, and saves all output to a structured folder. DataCamp published a full tutorial on this exact use case.
  • Content production pipeline: An agent that receives a content brief, researches the topic, drafts and revises sections using specialized subagents for research and writing, and produces a finished document with all sources logged. Memory persists across sessions so the agent learns house style over time.
  • GTM automation agent: An agent that monitors a set of accounts, runs qualification logic, drafts outreach, and logs activity to a CRM via tool integrations. LangChain includes a deploy-gtm-agent example in the repository for exactly this workflow.
  • Document processing system: An agent that ingests contracts, extracts structured data, validates it against compliance rules, flags exceptions for human review using human-in-the-loop interrupts, and generates an audit trail.

Key Features

  • Open source under the MIT license, fully extensible
  • Provider agnostic: works with any LLM that supports tool calling, including Claude, GPT, Gemini, and open models via Groq
  • Built-in planning via the write_todos tool for task decomposition and progress tracking
  • Virtual filesystem with pluggable backends: in-memory, local disk, LangGraph store, and sandboxes (Modal, Daytona, Deno)
  • Subagent spawning with isolated context and support for async parallel execution
  • Auto-summarization middleware to compress context on long-running tasks
  • Human-in-the-loop support via LangGraph's interrupt mechanism for sensitive operations
  • Declarative file permission rules to control what agents can read or write
  • Available as both an SDK and a CLI terminal agent
  • Native tracing, evaluation, and deployment via LangSmith

FAQ

What is the difference between Deep Agents and LangGraph? +

 LangGraph is the underlying runtime that Deep Agents is built on. LangGraph gives you low-level control to define agent workflows as explicit state graphs. Deep Agents is an opinionated layer on top of it: you get a working agent out of the box with planning, file access, subagents, and context management already wired up. Use LangGraph when you need precise control over deterministic workflows; use Deep Agents when you want to build autonomous agents quickly without building the infrastructure yourself.

Do Deep Agents work with models other than Claude? +

 Yes. Deep Agents is model agnostic and supports any LLM that handles tool calling, including GPT-4o, Gemini, Llama, Qwen, and others via LangChain's init_chat_model interface. That said, more capable frontier models plan and execute better on complex tasks. For prototyping, fast inference providers like Groq work well. For production, models like Claude Sonnet or GPT-4o tend to produce more reliable multi-step behavior.

When should I use Deep Agents instead of a simpler agent? +

 Use Deep Agents when your task has three or more of these properties: it requires planning and decomposition rather than a single tool call; the context it generates is too large for one context window; different parts of the work need different types of expertise; and the result needs to persist across sessions. For simple Q&A or single-tool tasks, a basic LangChain agent is fine. Deep Agents carry real overhead, using 10 to 15 times more compute than a simple agent, so they are best reserved for work that genuinely warrants it.

Explore Similar AI Tools

Newsletter

The Twice-Monthly AI Briefing

Updates from the AI world — what shipped, what we’re using in production, and what’s worth your attention. Two emails a month, no spam.