Skip to main content
Tavily is a search engine built specifically for AI agents (LLMs), delivering real-time, accurate, and factual results at speed. Tavily offers a Research endpoint that generates comprehensive research reports tailored for LLMs and RAG.

Overview

Integration details

Tool features

Setup

The integration lives in the @langchain/tavily package:

Credentials

Set up an API key on the Tavily dashboard and set it as an environment variable named TAVILY_API_KEY.
It is also helpful (but not needed) to set up LangSmith for observability:

Instantiation

You can import and instantiate TavilyResearch like this:
  • model (optional): Research agent model. "mini", "pro", or "auto" (default).
  • citationFormat (optional): Citation format for sources. "numbered", "mla", "apa", or "chicago" (default "numbered").
  • outputSchema (optional): JSON Schema that shapes the research output.
  • stream (optional): Whether to stream research results. Default is false.

Invocation

Invoke directly with args

The Tavily research tool accepts the following arguments during invocation:
  • input (required): The research task or question to investigate
  • Optional overrides: model, outputSchema, stream, citationFormat

Invoke with ToolCall

You can also invoke the tool with a model-generated ToolCall, in which case a ToolMessage is returned:

Use within an agent

Pass the research tool to createAgent so the agent can call it with a research task:

API reference

For detailed documentation of all Tavily Research API features and configurations, see the API reference: docs.tavily.com/documentation/api-reference/endpoint/research