# Tavily Search (https://www.librechat.ai/docs/configuration/tools/tavily)

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

<Steps>
  <Step>

### Get a Tavily API Key

Create a Tavily account and copy your API key from [app.tavily.com](https://app.tavily.com/).

  </Step>
  <Step>

### Add the Environment Variable

Add the key to your `.env` file:

```bash filename=".env"
TAVILY_API_KEY=tvly-your-api-key
```

  </Step>
  <Step>

### Restart LibreChat

| Deployment | Command                                           |
| ---------- | ------------------------------------------------- |
| Docker     | `docker compose down && docker compose up -d`     |
| Local      | Stop the server, then run `npm run backend` again |

  </Step>
  <Step>

### 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.

  </Step>
</Steps>

## Parameters

| Parameter                    | Description                                                                                                 |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `query`                      | Search query. Required.                                                                                     |
| `max_results`                | Number of results to return, from 1 to 10. Defaults to 5.                                                   |
| `search_depth`               | `basic` for faster results or `advanced` for higher quality results. Advanced searches count as 2 requests. |
| `include_answer`             | Include Tavily's generated answer in the response.                                                          |
| `include_images`             | Include image results.                                                                                      |
| `include_image_descriptions` | Include descriptions for returned images when images are enabled.                                           |
| `include_raw_content`        | Include raw page content in the result.                                                                     |
| `include_domains`            | Limit results to specific domains.                                                                          |
| `exclude_domains`            | Exclude specific domains.                                                                                   |
| `topic`                      | `general`, `news`, or `finance`.                                                                            |
| `time_range`                 | Limit results to a recent period such as `day`, `week`, `month`, or `year`.                                 |
| `days`                       | Number of days back to include for news searches.                                                           |

## Notes

- Tavily Search is an agent tool. LibreChat can also use Tavily as a [Web Search](/docs/features/web_search) provider or scraper, which is configured separately.
- Tavily requests use the global `PROXY` environment variable when it is configured. When `PROXY` is unset, supported server-side clients honor `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY`/`no_proxy`.
- If the tool does not appear in the Agent Builder, confirm `TAVILY_API_KEY` is set and check [`includedTools`](/docs/configuration/librechat_yaml/object_structure/config#includedtools) or [`filteredTools`](/docs/configuration/librechat_yaml/object_structure/config#filteredtools).
