LangChain Deep Agents: The Open-Source Claude Code Alternative (MIT Licensed, Any Model)

By Prahlad Menon 5 min read

LangChain just released Deep Agents — an open-source agent harness that extracts and generalizes the architecture that makes Claude Code effective. It’s MIT licensed, costs $0, and works with any LLM that supports tool calling.

This is significant because Claude Code has emerged as one of the most capable coding agents available, but it’s locked to Claude models. Deep Agents takes what makes it work — planning, delegation, filesystem access, persistent memory — and makes it model-agnostic.

What Is Deep Agents?

Deep Agents is an opinionated agent framework built on LangGraph. It ships with four core capabilities that distinguish “deep” agents from simple tool-calling loops:

  1. Planning tool — A structured TODO list that forces the agent to think before acting
  2. Subagent delegation — Complex tasks split across isolated agents with their own context windows
  3. Filesystem access — Read, write, edit, and search files with absolute paths
  4. Persistent memory — Cross-session recall via pluggable backends

The architecture is explicitly inspired by Claude Code. LangChain’s goal was to identify what makes Claude Code general-purpose and push it further — with any model.

Why “Deep” Agents Matter

Most agent implementations are shallow. They run an LLM in a loop, calling tools, but struggle with multi-step tasks that require planning over longer time horizons.

Deep agents solve this by implementing patterns observed in Claude Code, Deep Research, and Manus:

  • Planning first: Before executing anything, the agent writes a structured plan. No random tool calls.
  • Context management: Long runs accumulate context. Deep Agents offload large results to files and summarize older messages to stay effective.
  • Isolated delegation: Complex tasks get split across subagents with fresh context windows. The main agent orchestrates; subagents execute.

Quick Start

Installation takes one command:

pip install deepagents

Create a basic agent:

from deepagents import create_deep_agent

def get_weather(city: str) -> str:
    """Get weather for a given city."""
    return f"It's sunny in {city}!"

agent = create_deep_agent(
    model="openai:gpt-5",
    tools=[get_weather],
    system_prompt="You are a helpful assistant",
)

result = agent.invoke(
    {"messages": [{"role": "user", "content": "what's the weather in SF?"}]}
)

That’s it. The agent can now plan, read/write files, and manage its own context.

Supported Models

Deep Agents works with any LLM that supports tool calling:

ProviderExample Model String
OpenAIopenai:gpt-5
Anthropicanthropic:claude-sonnet-4-6
Googlegoogle_genai:gemini-3.5-flash
OpenRouteropenrouter:anthropic/claude-sonnet-4-6
Fireworksfireworks:accounts/fireworks/models/qwen3p5-397b
Basetenbaseten:zai-org/GLM-5
Ollama (local)ollama:devstral-2

This model-agnostic design means you can prototype with cheaper models, run locally for privacy, or use frontier models for production — all with the same agent code.

Key Features Breakdown

Planning Tool (TODO List)

Claude Code uses a TODO list tool that’s essentially a no-op — it doesn’t execute anything. It’s pure context engineering to keep the agent on track.

Deep Agents includes the same write_todos tool. The agent breaks complex tasks into discrete steps, tracks progress, and adapts plans as new information emerges.

Subagent Delegation

For complex tasks, the main agent spawns subagents with isolated context windows. This enables:

  • Context management: Each subagent gets a fresh window, avoiding token overflow
  • Specialization: Custom subagents can focus on specific task types
  • Parallelization: Independent tasks run concurrently

Any LangGraph CompiledStateGraph can be passed as a subagent, so custom orchestration plugs in alongside the defaults.

Filesystem Access

The agent reads, writes, edits, and searches files using absolute paths. Large results get offloaded to files to avoid context window overflow.

Filesystem backends are pluggable:

  • In-memory state
  • Local disk
  • LangGraph store
  • Composite routing
  • Custom backends with permission rules

Human-in-the-Loop

Configure which tools require approval before running. The agent pauses, you decide, it continues. Essential for production deployments where certain actions need oversight.

Persistent Memory

Files under /memories/ persist across conversations via pluggable backends. User preferences, knowledge bases, research threads — all saved and retrievable in future sessions.

Deep Agents vs. Claude Code

FeatureClaude CodeDeep Agents
LicenseProprietaryMIT (free)
ModelsClaude onlyAny LLM
PlanningTODO listTODO list
SubagentsYesYes
FilesystemYesYes (pluggable)
MemoryYesYes (pluggable)
Human approvalYesYes
CostPer-token$0 (plus LLM costs)

The architecture is nearly identical. The difference is vendor lock-in vs. model freedom.

Production Readiness

Deep Agents is built on LangGraph, which provides:

  • Streaming: Real-time output as the agent works
  • Persistence: Checkpointing for long-running tasks
  • LangSmith integration: Tracing, evaluation, and monitoring
  • Deployment options: Self-hosted or LangSmith Cloud

For production deployments, LangChain also released Deep Agents Deploy — a hosted alternative to Anthropic’s Claude Managed Agents.

Benchmark Performance

According to early testing, Deep Agents achieves ~42.65% on TerminalBench 2.0 using Claude Sonnet 4.5 — on par with Claude Code at the same model tier. Performance scales with the underlying model.

Getting Started Resources

When to Use Deep Agents

Use Deep Agents when:

  • You want Claude Code’s architecture without vendor lock-in
  • You need to run agents with non-Claude models (GPT, Gemini, Llama, local)
  • You want pluggable filesystem and memory backends
  • You need production features (streaming, checkpointing, tracing)

Use Claude Code when:

  • You specifically want Claude’s reasoning capabilities
  • You prefer a polished terminal experience out of the box

Use vanilla LangGraph when:

  • You need a completely custom agent loop
  • The Deep Agents harness doesn’t fit your workflow

The Bigger Picture

Deep Agents represents a trend: the architecture patterns that make frontier agents effective are being extracted and democratized. Claude Code showed what’s possible. LangChain made it reproducible with any model.

For teams building production agents, this means fewer tradeoffs between capability and flexibility. You can use the architecture that works, with the model that fits your requirements.


Published June 2026. Deep Agents is actively developed — check the GitHub repository for the latest features.