Skip to main content
This doc demonstrates how to use the Tavily search API with LangChain and LangGraph to create an agent that can search for information on the web. The agent uses either OpenAI or Anthropic models to process the search results and generate responses.

Add the Required Packages

Create the LangGraph Agent

Define the Agent State & Tools

Model Selection Helper

Define the Function That Determines Whether to Continue or Not

Define the Function That Calls the Model

Define the Function to Execute Tools

Define the Config

Define a New Graph

Maxim Logger Integration

Start tracing entire LangGraph agent using 2 simple annotations.

Get the Response from the Agent

LangGraph integration without decorator (GitHub)