Overview
This guide demonstrates how to build a multi-step web research agent from scratch using Deep Agents. The agent decomposes research questions into focused tasks, delegates them to specialized sub-agents, and synthesizes findings into a comprehensive report. The agent you build will:- Plan research using a todo list
- Delegate focused research tasks to sub-agents with isolated context
- Assess search results and plan next steps as you gather information
- Synthesize findings with proper citations into a final report
Key concepts
This tutorial covers:- Subagents for parallel, context-isolated research
- Custom tools for web search
- Multi-step planning with the built-in planning tool
Prerequisites
API keys for:- Anthropic (Claude) or Google (Gemini)
- Tavily for web search (free tier)
- LangSmith for tracing (optional)
Setup
Build the agent
Createagent.py in your project directory:
Add tools
Add the custom search tool. The
tavily_search tool uses Tavily for URL discovery, then fetches full webpage content (converted to markdown) so the agent can analyze complete sources instead of summaries.Run the agent
You can run the agent synchronously, meaning it will wait for the full result and then print it, or you can stream updates as they come in. Add the code from the respective tab at the bottom ofagent.py:
- Run synchronously
- Stream updates
LANGSMITH_API_KEY environment variable before running, you can view the agent’s traces in LangSmith to debug and monitor multi-step behavior.
Full code
View the complete Deep Research example on GitHub.Next steps
Now that you’ve built the agent, customize it by changing the prompt constants inagent.py to adjust the workflow, delegation strategy, or researcher behavior.
You can also tune the delegation limits to allow for more parallel sub-agents or delegation rounds.
For more information on the concepts in this tutorial, check out the following resources:
- Subagents: Learn how to configure subagents with different tools and prompts
- Customization: Customize models, tools, system prompts, and planning behavior
- LangSmith: Trace research runs and debug multi-step behavior
- Deep Research Course: Full course on deep research with LangGraph
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

