Skip to main content

Tavily Research Tool

Tavily is a robust research API tailored specifically for LLM Agents. It seamlessly integrates with diverse data sources to ensure a superior, relevant research experience.

To begin, you need to obtain an API key on the Tavily's developer dashboard.

Why Choose Tavily Research API?

  1. Purpose-Built: Tailored just for LLM Agents, we ensure our features and results resonate with your unique needs. We take care of all the burden in searching, scraping, filtering and extracting information from online sources. All in a single API call!
  2. Versatility: Beyond just fetching results, Tavily Research API offers precision. With customizable search depths, domain management, and parsing html content controls, you're in the driver's seat.
  3. Performance: Committed to rapidity and efficiency, our API guarantees real-time outcomes without sidelining accuracy. Please note that we're just getting started, so performance may vary and improve over time.
  4. Integration-friendly: We appreciate the essence of adaptability. That's why integrating our API with your existing setup is a breeze. You can choose our Python library or a simple API call or any of our supported partners such as Langchain and LLamaIndex.
  5. Transparent & Informative: Our detailed documentation ensures you're never left in the dark. From setup basics to nuanced features, we've got you covered.

Usage

This tool has a more extensive example usage documented in a Jupyter notebook here

Here's an example usage of the TavilyToolSpec.

from llama_index.tools.tavily_research import TavilyToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

tavily_tool = TavilyToolSpec(
    api_key="your-key",
)
agent = FunctionAgent(
    tools=tavily_tool.to_tool_list(),
    llm=OpenAI(model="gpt-4o"),
)

await agent.run("What happened in the latest Burning Man festival?")

Available Functions

search: Search for relevant dynamic data based on a query. Returns a list of Document objects with urls and their relevant content.

extract: Extract raw content from specific URLs using Tavily Extract API. Returns a list of Document objects containing the extracted content and metadata.

Extract Function Example

from llama_index.tools.tavily_research import TavilyToolSpec

tavily_tool = TavilyToolSpec(api_key="your-key")

# Extract content from specific URLs
documents = tavily_tool.extract(
    urls=["https://example.com/article1", "https://example.com/article2"],
    include_images=True,
    include_favicon=True,
    extract_depth="advanced",  # "basic" or "advanced"
    format="markdown",  # "markdown" or "text"
)

for doc in documents:
    print(f"URL: {doc.extra_info['url']}")
    print(f"Content: {doc.text[:200]}...")

This loader is designed to be used as a way to load data as a Tool in an Agent.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_tools_tavily_research-0.6.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_tools_tavily_research-0.6.0.tar.gz.

File metadata

  • Download URL: llama_index_tools_tavily_research-0.6.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_tools_tavily_research-0.6.0.tar.gz
Algorithm Hash digest
SHA256 962806be90eb494be4a92d833f2507f1e22d4a6ef66a5dddc160137057344cf4
MD5 bc91f60fdc3fdc0480b246a04b3d7f19
BLAKE2b-256 1ab969403410300025a8ae89296e68924d59f8faa029bb35bdb9cf90488291cc

See more details on using hashes here.

File details

Details for the file llama_index_tools_tavily_research-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_tools_tavily_research-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_tools_tavily_research-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5bb140da5665387655473e9b22d149521cdde0cb77627f1d7ca599a2b6a3e5e
MD5 88b3b05d8806a8943463a76ffd4229e8
BLAKE2b-256 c0a2c284ae22d1f8bf8648cb651141863eda38bf6ec4c977f66bae76decae37a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page