Deep Agents comes with a number of built-in components that help agents perform complex tasks.

System prompt

Deep Agents comes with a detailed system prompt heavily inspired by Claude Code’s architecture. This prompt provides instructions for using the planning tool, file system tools, and sub agents effectively.

Planning tool

A simple planning tool based on Claude Code’s TodoWrite functionality that helps agents create and track plans in their context, keeping them on track for complex tasks.

File system tools

Four built-in tools that mock a file system using LangGraph’s state:
  • ls - List files and directories
  • read_file - Read file contents
  • write_file - Write to files
  • edit_file - Edit existing files
Files can be passed in and retrieved via the files key:
# Pass files to the agent
result = agent.invoke({
    "messages": [...],
    "files": {"foo.txt": "file content", ...}
})

# Access files after execution
updated_files = result["files"]

Sub-agents

Built-in support for calling specialized sub-agents with the following:
  • Context quarantine: Prevents polluting the main agent’s context
  • Custom instructions: Tailored prompts for specific tasks
  • Tool access control: Subagents can have different tool sets
A general-purpose sub-agent with the same instructions and tools as the main agent is always available.

MCP

The deepagents library can be ran with MCP tools. This can be achieved by using the Langchain MCP Adapter library. For example:
# pip install langchain-mcp-adapters

import asyncio
from langchain_mcp_adapters.client import MultiServerMCPClient
from deepagents import create_deep_agent

async def main():
    # Collect MCP tools
    mcp_client = MultiServerMCPClient(...)
    mcp_tools = await mcp_client.get_tools()

    # Create agent
    agent = create_deep_agent(tools=mcp_tools, ....)

    # Stream the agent
    async for chunk in agent.astream(
        {"messages": [{"role": "user", "content": "what is langgraph?"}]},
        stream_mode="values"
    ):
        if "messages" in chunk:
            chunk["messages"][-1].pretty_print()

asyncio.run(main())