Overview
Best for: building Valyu into your product / agents. Use Valyu as a search and content tool inside LangChain (TypeScript) agents.
ValyuSearchTool: Search operations with comprehensive parameter controlValyuContentsTool: Extract clean content from specific URLs
Paste into your AI assistant to wire Valyu into a LangChain (TypeScript) agent.
Integration details
| Component | Source | Package |
|---|---|---|
ValyuSearchTool | Proprietary + public web content (search) | @valyu/langchain |
ValyuContentsTool | Web pages (content extraction) | @valyu/langchain |
Installation
Install the official LangChain Valyu package and the Valyu SDK:Free Credits
Get your API key with $10 free credits ($20 with a work email) from the Valyu Platform.
Basic Usage
Using ValyuSearchTool for 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:npm
Advanced configuration
All search parameters
All search parameters
tool.invoke() accepts:query(required) - natural-language query stringsearch_type-"all","web", or"proprietary"(use"all"when passingincluded_sourcesURLs)max_num_results- 1-20 (up to 100 with a special API key)relevance_threshold- 0.0-1.0max_price- max cost per 1k retrievals (CPM)start_date/end_date- YYYY-MM-DDincluded_sources/excluded_sources- arrays of URLs, domains, or dataset idsresponse_length-"short","medium","large","max", or a character countcountry_code- 2-letter ISO code (e.g."US","GB")fast_mode- faster but shorter results
JSON.parse().ValyuContentsTool options
ValyuContentsTool options
Invoke with a required
urls array (max 10 per request). Constructor options: summary (boolean/string/object), extract_effort ("normal", "high", "auto"), response_length ("short", "medium", "large", "max", or a number).Steer the agent with a system message
Steer the agent with a system message
Bind a
SystemMessage: 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.Additional Resources
LangChain Valyu Tool
Official LangChain Python integration documentation
API Reference
Complete Valyu API documentation
LangGraph Agents
Build advanced agent workflows
Get API Key
Sign up for $10 free credits ($20 with a work email)

