Overview
Integration details
| Class | Package | PY support | Version |
|---|---|---|---|
| TavilyMap | @langchain/tavily | ✅ |
Setup
The integration lives in the@langchain/tavily package, which you can install as shown below:
Credentials
Set up an API key here and set it as an environment variable namedTAVILY_API_KEY.
Instantiation
You can import and instantiate an instance of theTavilyMap tool like this:
Invocation
Invoke directly with args
The Tavily map tool accepts the following arguments during invocation:-
url(required): A natural language search query -
The following arguments can also be set during invocation :
instructions,selectPaths,selectDomains,excludePaths,excludeDomains,allowExternal,categories.
Invoke with ToolCall
We can also invoke the tool with a model-generatedToolCall, in which case a @[ToolMessage] will be returned:
Chaining
We can use our tool in a chain by first binding it to a tool-calling model and then calling it:Agents
For guides on how to use LangChain tools in agents, see the LangGraph.js docs.API reference
For detailed documentation of all Tavily Map API features and configurations head to the API reference: docs.tavily.com/documentation/api-reference/endpoint/mapRelated
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.