LibreChat

Tavily Search

Configure Tavily Search as an agent tool in LibreChat

Tavily Search is a built-in agent tool for current web research. It returns structured search results and can optionally include answers, images, raw page content, domain filters, and recency filters.

Setup

Get a Tavily API Key

Create a Tavily account and copy your API key from app.tavily.com.

Add the Environment Variable

Add the key to your .env file:

TAVILY_API_KEY=tvly-your-api-key

Restart LibreChat

DeploymentCommand
Dockerdocker compose down && docker compose up -d
LocalStop the server, then run npm run backend again

Add Tavily to an Agent

In LibreChat, select Agents, create or edit an agent, open the agent's Tools list, select Tavily Search, and save the agent.

Parameters

ParameterDescription
querySearch query. Required.
max_resultsNumber of results to return, from 1 to 10. Defaults to 5.
search_depthbasic for faster results or advanced for higher quality results. Advanced searches count as 2 requests.
include_answerInclude Tavily's generated answer in the response.
include_imagesInclude image results.
include_image_descriptionsInclude descriptions for returned images when images are enabled.
include_raw_contentInclude raw page content in the result.
include_domainsLimit results to specific domains.
exclude_domainsExclude specific domains.
topicgeneral, news, or finance.
time_rangeLimit results to a recent period such as day, week, month, or year.
daysNumber of days back to include for news searches.

Notes

  • Tavily Search is an agent tool. LibreChat can also use Tavily as a Web Search provider or scraper, which is configured separately.
  • Tavily requests use the global PROXY environment variable when it is configured.
  • If the tool does not appear in the Agent Builder, confirm TAVILY_API_KEY is set and check includedTools or filteredTools.

How is this guide?