cd ~/series/demystifying-ai
Deep Agents Architecture - 3-layer stack with Planning, FileSystem, Sub-Agents, and Memory
EPISODE 01 Hot Topic Jul 6, 2026 5 min read

What are LangChain Deep Agents?

LangChain shipped something that makes CrewAI and AutoGen look like toys. Nobody noticed. Here's the 3-layer stack that changes everything.

Share:
// TL;DR

Deep Agents = LangGraph + planning + file system + sub-agents + memory. One create_deep_agent() call. Production-ready out of the box.

# Shallow vs Deep

Shallow Agent
Forgets after 5 steps
No planning capability
Context window fills up
Single-threaded execution
No cross-session memory
LLM + tools in a loop
Deep Agent
Coherent over 200+ steps
Built-in todo planning
Virtual file system offloads context
Parallel sub-agent delegation
Persistent memory across sessions
Same loop + 4 superpowers

Claude Code, Manus, and Deep Research all use this pattern. Deep Agents packages it into a library.

# The 3-Layer Stack

Not a replacement for LangGraph. A layer on top. All three compose.

L3

Deep Agents

Full harness. Planning + FS + sub-agents + memory. Start here.

L2

create_agent

Minimal ReAct loop. Model + tools = working agent.

L1

LangGraph

Raw graph runtime. Full control over everything.

# The 4 Superpowers

Auto-injected middleware. You get all four with zero config.

Planning

write_todos tool

Agent creates and checks off tasks. Stays focused across 50+ steps. Same pattern as Claude Code.

Virtual File System

read/write with permissions

Offloads large results. Stores artifacts. Context window never blows up.

Sub-Agents

isolated context workers

Delegate tasks to parallel workers. They run isolated, return results. Parent context stays clean.

Long-term Memory

LangGraph Store

Remembers preferences and decisions across sessions. Gets better with every use.

# .md Files Are the Brain

The real config layer isn't Python or YAML. It's plain markdown.

CLAUDE.md
AGENTS.md
rules/*.md
skills/*.md
📝
System Prompt Core instructions
Skills On-demand capabilities
📚
Rules Guardrails & constraints
🧠
Memory Learned preferences
📋
Plans Task strategies
🎯
Context Domain knowledge

Change the markdown, change the agent. No redeployment. No code changes. Just edit a file.

Key insight: If you can write a README, you can program a production agent. The .md files are the agent.

# 5 Lines to Start

Everything else is handled by the harness.

main.py
from deepagents import create_deep_agent
from langchain_openai import ChatOpenAI

agent = create_deep_agent(
    model=ChatOpenAI(model="gpt-4o"),
    tools=[web_search, code_executor],
    system_prompt="You are a research expert.",
)

# Planning, file system, sub-agents, memory - all built in.
result = await agent.ainvoke({
    "messages": [{"role": "user", "content": "Research quantum computing breakthroughs in 2026"}]
})

# Pick Your Layer

Start at the top. Drop down only when needed.

You need... Use this
Quick chatbot, single tool create_agent
Research, code gen, multi-step work Deep Agents
Custom control flow, complex branching LangGraph
Both: harness + custom sub-graph Compose them
// Bottom Line

Deep Agents is what happens when you package the Claude Code architecture into a library. Planning, file system, sub-agents, memory. One pip install. If you're building anything beyond a wrapper, this is your starting point in 2026.

NEXT EPISODE
Thursday
#02 Research Paper

Is Grep All You Need? Agent Harness Paper

A research team tested grep vs vector search inside AI agent loops. The harness matters more than retrieval.

Enjoyed this?

New episodes Mon, Thu, Sun.