Valyu allows AI applications and agents to search the internet and proprietary data sources for relevant LLM ready information.This notebook goes over how to use Valyu context tool in LangChain. First, get an Valyu API key and add it as an environment variable. Get $10 free credit by signing up here.
Overview
Integration details
| Class | Package | Serializable | JS support | Version |
|---|---|---|---|---|
| Valyu Search | langchain-valyu | ✅ | ❌ |
Setup
The integration lives in thelangchain-valyu package.
VALYU_API_KEY environment variable to your Valyu API key.
Instantiation
Here we show how to instantiate an instance of the Valyu search tool. This tool allows you to complete search queries using Valyu’s Context API endpoint.Invocation
Invoke directly with args
The Valyu search tool accepts the following arguments during invocation:query(required): A natural language search querysearch_type(optional): Type of search, e.g., “all”max_num_results(optional): Maximum number of results to returnsimilarity_threshold(optional): Similarity threshold for resultsquery_rewrite(optional): Whether to rewrite the querymax_price(optional): Maximum price for the search
Use within an agent
We can use our tools directly with an agent executor by binding the tool to the agent. This gives the agent the ability to dynamically set the available arguments to the Valyu search tool.API reference
For detailed documentation of all Valyu Context API features and configurations head to the API reference: docs.valyu.network/overviewConnect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.