ValyuToolSpec. Use Search to find evidence and Contents to read known URLs, then pass the returned documents to your existing retrieval or agent pipeline.
The package includes two main functions:
search(): Search operations with comprehensive parameter controlget_contents(): Extract clean content from specific URLs
Installation
Install the official LlamaIndex Valyu package:Basic usage
Using ValyuToolSpec for search
Using ValyuToolSpec for Content Extraction
Using with LlamaIndex OpenAI Agents
The following example uses thellama-index-agent-openai integration. Install it with pip install llama-index-agent-openai and set OPENAI_API_KEY before running:
Advanced configuration
ValyuToolSpec parameters
ValyuToolSpec parameters
Set search defaults at initialization, override per call:
get_contents(urls=[...]) extracts clean content from URLs (max 10 per request).Steer the agent with a system prompt
Steer the agent with a system prompt
Pass a
system_prompt to your agent: use search_type="all" for broad coverage (web + proprietary), or "web" for current events only; raise relevance_threshold (0.6+) for precision; cite sources; use natural-language queries, not operators. See the Prompting Guide.Custom query engines and retrievers
Custom query engines and retrievers
Wrap
ValyuToolSpec.search() in a CustomQueryEngine or BaseRetriever to plug Valyu into existing LlamaIndex pipelines - call search() in custom_query/_retrieve and map each result doc (with doc.metadata['relevance_score']) into your response or NodeWithScore objects.Additional resources
LlamaIndex Valyu Tool
Official LlamaIndex tool documentation
API Reference
Complete Valyu API documentation
LlamaHub
Valyu tool on LlamaHub
Get API Key
Sign up for $10 free credits ($20 with a company email)