Skip to content

How to Get Started with Deep Agents in 5 Minutes

Building AI agents usually means spending hours on infrastructure before you can focus on actual behavior. I’ve been there - wiring up tools, setting up state management, handling streaming, and dealing with boilerplate code. Deep Agents caught my attention because it promises to eliminate all that. Let me show you how to get started in under 5 minutes.

The Problem Deep Agents Solves

When I first tried building agents with LangGraph, I spent most of my time on setup:

  • Configuring the graph structure
  • Adding tool bindings
  • Setting up memory and checkpointering
  • Writing boilerplate for sub-agent spawning

Deep Agents wraps all of this into a single function call. You get a fully functional agent with planning, file operations, and sub-agent spawning out of the box.

Installation

You have two options:

terminal
pip install deepagents

Or if you’re using uv:

terminal
uv add deepagents

The package requires Python 3.11+, which is reasonable for modern AI development.

Your First Agent

The minimal example is incredibly simple:

agent.py
from deepagents import create_deep_agent
agent = create_deep_agent()
result = agent.invoke({"messages": [{"role": "user", "content": "Research LangGraph and write a summary"}]})

That’s it. Three lines of code and you have an agent that can:

  • Plan multi-step tasks
  • Perform file operations
  • Spawn sub-agents for complex work
  • Use tools

Behind the scenes, create_deep_agent() returns a CompiledStateGraph from LangGraph. This means you get all the LangGraph benefits - streaming, Studio integration, checkpointers, and more.

What You Get by Default

I was curious about what the default configuration includes. Looking at the source, here’s what’s baked in:

  • Default model: claude-sonnet-4-6 (a solid choice for most tasks)
  • Planning capabilities: The agent can break down complex tasks
  • File operations: Read, write, and manipulate files
  • Sub-agent spawning: Delegate work to specialized agents

The key dependencies include langchain-core, langgraph, langchain-anthropic, and langchain-google-genai. Everything you need for serious agent development.

Customizing Your Agent

Of course, defaults only get you so far. Here’s how to customize:

custom_agent.py
from langchain.chat_models import init_chat_model
from deepagents import create_deep_agent
# Define a custom tool
def my_custom_tool(query: str) -> str:
"""Search my internal knowledge base."""
# Your implementation here
return f"Results for: {query}"
# Create agent with custom settings
agent = create_deep_agent(
model=init_chat_model("openai:gpt-4o"),
tools=[my_custom_tool],
system_prompt="You are a research assistant specialized in technical documentation.",
)

The create_deep_agent() function accepts several optional parameters:

  • model: Any LangChain-compatible chat model
  • tools: List of custom tools
  • system_prompt: Override the default behavior
  • middleware: Add custom middleware
  • subagents: Configure specialized sub-agents
  • memory: Set up memory backends
  • checkpointer: Configure state persistence

MCP Support

One feature I was looking for was Model Context Protocol (MCP) support. Deep Agents handles this via langchain-mcp-adapters. If you’re building agents that need to connect to external tools and services through MCP, you’re covered.

LangGraph Native Integration

Since create_deep_agent() returns a compiled LangGraph graph, you can use any LangGraph feature:

streaming.py
from deepagents import create_deep_agent
agent = create_deep_agent()
# Stream the response
for chunk in agent.stream({"messages": [{"role": "user", "content": "Analyze this codebase"}]}):
print(chunk)
# Use with LangGraph Studio
# The graph is already compiled and ready

This native integration is powerful. You get:

  • Streaming: Real-time output as the agent works
  • Studio: Visual debugging with LangGraph Studio
  • Checkpointers: Persist state between sessions
  • Memory: Add conversational memory

When to Use Deep Agents

Deep Agents shines when you want to:

  • Quickly prototype agent applications
  • Evaluate agent frameworks without heavy investment
  • Build production agents with minimal boilerplate
  • Focus on behavior rather than infrastructure

It might not be the right choice if you need:

  • Complete control over every graph node
  • Highly customized agent architectures
  • Non-Python implementations

My Take After Using It

I built a small research agent in about 10 minutes. The agent searched documentation, summarized findings, and wrote a report. What impressed me was how much I didn’t have to do - no graph wiring, no tool binding code, no state management setup.

For developers new to AI agents, Deep Agents removes the intimidation factor. You can experiment and learn without drowning in configuration. For experienced developers, it provides a solid foundation to build on.

The fact that it returns a standard LangGraph graph means you’re not locked into a proprietary format. If you need to customize later, you have full access to the underlying structure.

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments