TavilySearchAPIRetriever
Tavily's Search API is a search engine built specifically for AI agents (LLMs), delivering real-time, accurate, and factual results at speed.
We can use this as a retriever. It will show functionality specific to this integration. After going through, it may be useful to explore relevant use-case pages to learn how to use this vectorstore as part of a larger chain.
Integration details
Retriever | Source | Package |
---|---|---|
TavilySearchAPIRetriever | Internet search | langchain_community |
Setup
If you want to get automated tracing from individual queries, you can also set your LangSmith API key by uncommenting below:
# os.environ["LANGSMITH_API_KEY"] = getpass.getpass("Enter your LangSmith API key: ")
# os.environ["LANGSMITH_TRACING"] = "true"
Installation
The integration lives in the langchain-community
package. We also need to install the tavily-python
package itself.
%pip install -qU langchain-community tavily-python
We also need to set our Tavily API key.
import getpass
import os
os.environ["TAVILY_API_KEY"] = getpass.getpass()