Overview
Valyu integrates seamlessly with LangChain as a search tool, allowing you to enhance your AI agents and RAG applications with real-time web search and proprietary data sources. The integration provides LLM-ready context from multiple sources including web pages, academic journals, financial data, and more. The package includes two main tools:ValyuSearchTool
: Deep search operations with comprehensive parameter controlValyuContentsTool
: Extract clean content from specific URLs
Installation
Install the official LangChain Valyu package:Free Credits
Get your API key with $10 credit from the Valyu Platform.
Basic Usage
Using ValyuSearchTool for Deep Search
Using ValyuContentsTool for Content Extraction
Extract clean, structured content from specific URLs:Using with LangChain Agents
The most powerful way to use Valyu is within LangChain agents, where the AI can dynamically decide when and how to search:Advanced Configuration
Search Parameters
The ValyuSearchTool supports comprehensive search parameters for fine-tuned control:Source Filtering
Control which sources are included or excluded from your search:Multi-Agent Workflows
Use Valyu in complex multi-agent systems:Example Applications
Financial Research Assistant
Academic Research Agent
Best Practices
1. Cost Optimization
2. Search Type Selection
3. Error Handling and Fallbacks
4. Agent System Messages
API Reference
For complete parameter documentation, see the Valyu API Reference.ValyuSearchTool Parameters
query
(required): Natural language search querysearch_type
:"all"
,"web"
, or"proprietary"
(default: “all”)max_num_results
: 1-20 results (default: 5)relevance_threshold
: 0.0-1.0 relevance score (default: 0.5)max_price
: Maximum cost in dollars (default: 20.0)is_tool_call
: Optimize for LLM consumption (default: true)start_date
/end_date
: Time filtering in YYYY-MM-DD format (optional)included_sources
: List of URLs/domains to include (optional)excluded_sources
: List of URLs/domains to exclude (optional)response_length
: Content length - int, “short”, “medium”, “large”, “max” (optional)country_code
: 2-letter ISO country code for geo-bias (optional)fast_mode
: Enable for faster but shorter results (default: false)
ValyuContentsTool Parameters
urls
(required): List of URLs to extract content from (max 10 per request)