Overview
Best for: building Valyu into your product / agents. Use Valyu as a tool spec inside LlamaIndex agents and RAG apps.
search(): Search operations with comprehensive parameter controlget_contents(): Extract clean content from specific URLs
Paste into your AI assistant to wire Valyu into a LlamaIndex agent.
Installation
Install the official LlamaIndex Valyu package:Free Credits
Get your API key with $10 free credits ($20 with a work email) from the Valyu Platform.
Basic Usage
Using ValyuToolSpec for search
Using ValyuToolSpec for Content Extraction
Using with LlamaIndex OpenAI Agents
The most powerful way to use Valyu is within LlamaIndex agents, where the AI can dynamically decide when and how to search: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 work email)

