Skip to main content

Tavily Integration with SmythOS

Need a search engine built for AI? Connect Tavily to SmythOS and empower your agents with a powerful, AI-optimized search API to get clean, relevant, and comprehensive data from the web.

TL;DR

Securely link your Tavily account to SmythOS using an API key. Then, use our suite of search components to perform basic, advanced, or news-specific searches, as well as extract content from URLs, all optimized for AI and RAG workflows.

List of Tavily Components

Quickly compare Tavily components by what they do and their key I/O. Click any component name to jump directly to its detailed guide.

ComponentActionWhat it DoesInputsKey OutputsUse Case
Basic General SearchSearchPerforms a quick, general topic search optimized for LLMs.required query
optional max_results
ResultsFast answers for general knowledge questions.
Advanced General SearchSearchPerforms a general search with advanced filtering like time range.required query
optional time_range
ResultsResearching topics within a specific recent timeframe.
Basic News SearchSearchPerforms a quick search focused specifically on news sources.required query
optional days
ResultsGetting the latest headlines on a topic.
Advanced News SearchSearchPerforms a news search with more detailed filtering options.required query
optional days
ResultsIn-depth media monitoring from specific domains.
ExtractScrapeScrapes and extracts the main content from a list of URLs.required urlsresultsGetting clean article text for summarization.
INFO
Why Integrate Tavily with Your Agent?

Tavily is a search API built from the ground up for AI applications, particularly Retrieval-Augmented Generation (RAG). It doesn't just return links; it provides clean, relevant, and comprehensive information.

  • AI-Optimized Results: Tavily processes and filters search results to provide concise, relevant information, which is perfect for feeding directly into Large Language Models without extra noise.
  • Enhanced Data Access: Go beyond a simple Google search. Tavily aggregates data from over 20 sources, giving your agents a broader and more comprehensive view of any topic.
  • Efficient RAG Workflows: Tavily is ideal for RAG. An agent can perform a search to retrieve factual, up-to-date context, and then use that context to generate a more accurate and informed response with an LLM.
  • Automated Research: Create agents that can perform deep research on any topic. They can use the search components to find relevant sources and the Extract component to get the full content for analysis.

Prerequisites

Before you begin, please ensure you have the following:

  • An active SmythOS account. (Sign up here).
  • A Tavily account.
  • Your Tavily API Key.

Getting Started With Tavily

The connection between SmythOS and Tavily is configured using a secure API key.

Step 1: Get Your Tavily API Key

  1. Log in to your Tavily account.
  2. Navigate to the API Key section of your dashboard.
  3. Copy your API key.

Step 2: Store Your API Key in SmythOS Vault

Your API Key is a sensitive credential. Use the SmythOS Vault to store it securely.

  1. In your SmythOS dashboard, navigate to the Vault.
  2. Create a new secret and paste your Tavily API Key as the value. Give it a memorable name, like tavily_api_key.
  3. For more details, see the Vault Documentation.

Step 3: Configure a Tavily Component

  1. In your SmythOS agent graph, drag and drop any Tavily component.
  2. Click the component to open its Settings panel.
  3. In the Tavily API Key field, select the secret you saved in the Vault (e.g., tavily_api_key).
  4. Your connection is now configured for that component.
Heads-up
You must add the API Key from the Vault to each Tavily component you use. This ensures all your API calls are properly authenticated.

Which Tavily Component Should I Use?

If you need to…TargetUse this ComponentWhy this one?
Quickly find general information on a topicA search queryBasic General SearchThe fastest and most direct way to get general-purpose search results.
Find information from the last week onlyA search query and a time frameAdvanced General SearchAdds time-based filtering to narrow down results to recent events.
Get the latest news headlines for a companyA search query focused on newsBasic News SearchSpecifically targets news sources for up-to-the-minute reporting.
Extract the text from a list of articlesAn array of URLsExtractMoves beyond search to scrape and clean the content from specific pages.

Component Details

This section provides detailed information for each Tavily component.

Performs a quick, general-purpose web search optimized for providing context to LLMs.

INFO
This component requires an API Key for authentication, as detailed in the Getting Started section.

Inputs

FieldTypeRequiredNotes
querystringYesThe search keyword or phrase.
max_resultsstringOptionalThe maximum number of search results to return.
include_domainsarrayOptionalA list of domains to prioritize in the search.
exclude_domainsarrayOptionalA list of domains to ignore in the search.

Outputs

FieldTypeDescription
ResultsarrayAn array of objects, each containing a search result with its URL, title, and content snippet.
ResponseobjectThe full, raw JSON response from the Tavily API.
HeadersobjectThe HTTP headers from the API response.
Use Case

An agent needs to answer a user's question, "What is Retrieval-Augmented Generation?". It uses this component with the query to get a concise, factual summary to form its answer.

{
"component": "tavily.basicGeneralSearch",
"query": "benefits of using a multi-agent system",
"max_results": "5"
}
LLM-Optimized

The content returned by this component is specifically processed by Tavily to be clean and relevant, making it ideal for use as context in an LLM prompt.

Performs a general web search with the addition of time-based filtering.

INFO
This component requires an API Key for authentication, as detailed in the Getting Started section.

Inputs

FieldTypeRequiredNotes
querystringYesThe search keyword or phrase.
time_rangestringOptionalTime range for results (e.g., d for day, w for week, m for month). Default: m.
max_resultsstringOptionalThe maximum number of search results to return.

Outputs

FieldTypeDescription
ResultsarrayAn array of time-filtered search result objects.
ResponseobjectThe full, raw JSON response from the Tavily API.
HeadersobjectThe HTTP headers from the API response.
Use Case

An agent is tasked with creating a weekly summary of news about "generative AI." It runs this component with the time_range set to "w" to ensure it only gets the latest information.

{
"component": "tavily.advancedGeneralSearch",
"query": "latest advancements in AI agents",
"time_range": "w"
}

News Search Components

Includes Basic News Search and Advanced News Search. These components are specifically tuned to search only news sources.

INFO
These components require an API Key for authentication, as detailed in the Getting Started section.

Inputs

FieldTypeRequiredNotes
querystringYesThe news topic or keyword to search for.
daysstringOptionalNumber of days back to search. Default: 3.
max_resultsstringOptionalMaximum number of news articles to return.

Outputs

FieldTypeDescription
ResultsarrayAn array of objects, each representing a news article.
ResponseobjectThe full, raw JSON response from the Tavily API.
HeadersobjectThe HTTP headers from the API response.
Use Case

A financial monitoring agent uses the Basic News Search component to search for a company's stock ticker every day, with days set to "1", to find any breaking news that might affect its price.

{
"component": "tavily.basicNewsSearch",
"query": "SmythOS",
"days": "7"
}
Focus on News

Unlike the general search components, these will only return results from recognized news outlets, making them ideal for media monitoring.

Extract

Scrapes and extracts the clean, primary content from a given list of URLs.

INFO
This component requires an API Key for authentication, as detailed in the Getting Started section.

Inputs

FieldTypeRequiredNotes
urlsarrayYesAn array of URL strings to extract content from.

Outputs

FieldTypeDescription
resultsarrayAn array of objects, each containing the extracted content and metadata for a successful URL.
failed_resultsarrayAn array of URLs that failed to be extracted.
ResponseobjectThe full, raw JSON response from the Tavily API.
HeadersobjectThe HTTP headers from the API response.
Use Case

An agent first uses a search component to get a list of relevant URLs. It then passes this list of URLs to the Extract component to get the full, clean text from each page, which it then feeds to an LLM for summarization.

{
"component": "tavily.extract",
"urls": [
"[https://example.com/article-1](https://example.com/article-1)",
"[https://anotherexample.com/blog-post-2](https://anotherexample.com/blog-post-2)"
]
}
Content Extraction

This component is designed to remove boilerplate like ads, navigation, and footers, providing only the core content of the page, which is perfect for AI analysis.

Best Practices & Advanced Tips

  • Secure Your API Key: Always store your Tavily API key in the SmythOS Vault.
  • Combine Search and Extract: For the most powerful research workflows, chain the components. Use a Search component to discover relevant sources, then pass the output URLs to the Extract component to get the full content for deeper analysis.
  • Use Domain Filters: The include_domains and exclude_domains parameters are powerful tools for refining your search. Use them to focus on authoritative sources or to filter out known low-quality sites.
  • Leverage for RAG: Tavily is purpose-built for Retrieval-Augmented Generation. Use the clean content from its search or extract results as the context (Retrieval) for your LLM prompts to get more accurate and factual Generated answers.

Troubleshooting Common Issues

  • Error: 401 Unauthorized

    • Cause: The API Key is incorrect, missing, or invalid.
    • Solution: Verify that the API Key in your SmythOS Vault is correct and matches the one in your Tavily dashboard.
  • Error: 402 Payment Required

    • Cause: You have exhausted your API credits for the month.
    • Solution: Check your usage and credit balance in your Tavily dashboard.
  • Empty Results Array

    • Cause: The search query genuinely returned no results, or the filters (e.g., include_domains, time_range) were too restrictive.
    • Solution: Broaden your query or remove filters to test the connection. Try a very common search term to ensure the component is working correctly.
  • URL in failed_results for Extract Component

    • Cause: The website may have strong anti-scraping measures that even Tavily could not bypass, or the URL might be invalid or lead to a page with no main content.
    • Solution: This is expected for some sites. Build logic in your agent to handle failed extractions gracefully, such as by logging the failed URL or trying an alternative source.

What's Next?

You are now ready to build powerful research and data extraction agents with the SmythOS Tavily Integration!

Consider these ideas:

  • Build an Agent That...

    • Acts as a "Daily Briefing" generator. It uses the Advanced News Search to find the top 5 articles about your industry from the last 24 hours, uses Extract to get their content, and then uses an LLM to write a summary of each for a morning email.
    • Performs automated competitor analysis. It takes a list of competitor domains, uses Basic General Search with include_domains to find recent mentions, and logs the results to a Google Sheet.
    • Powers a fact-checking chatbot. When a user asks a question, the agent uses Tavily to find several high-quality sources, extracts their content, and uses an LLM to synthesize an answer with citations.
  • Explore Other Integrations:

    • Combine Tavily with the OpenRouter or Perplexity AI integrations to create state-of-the-art RAG pipelines.
    • Send the results of your Tavily searches directly to a Google Sheet for logging and analysis.
    • Use the Extract component to get clean article text and then pass it to the PlayHT or Elevenlabs integrations to create an audio version.