Skip to main content
This guide walks you through creating your first deep agent with planning, file system tools, and subagent capabilities. You’ll build a research agent that can conduct research and write reports.

Prerequisites

Before you begin, make sure you have an API key from a model provider (e.g., Anthropic, OpenAI).
Deep agents require a model that supports tool calling. See customization for how to configure your model.

Step 1: Install dependencies

This guide uses Tavily as an example search provider, but you can substitute any search API (e.g., DuckDuckGo, SerpAPI, Brave Search).

Step 2: Set up your API keys

Step 3: Create a search tool

Step 4: Create a deep agent

Step 5: Run the agent

What happened?

Your deep agent automatically:
  1. Planned its approach: Used the built-in write_todos tool to break down the research task
  2. Conducted research: Called the internet_search tool to gather information
  3. Managed context: Used file system tools (write_file, read_file) to offload large search results
  4. Spawned subagents (if needed): Delegated complex subtasks to specialized subagents
  5. Synthesized a report: Compiled findings into a coherent response

Next steps

Now that you’ve built your first deep agent:
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.