Skip to main content
Best for: building Valyu into your product / agents. Use Valyu as a search and content tool inside LangChain agents. Every snippet below has a Python and a TypeScript tab, and picking one switches the whole page.
Valyu plugs into LangChain as a tool, giving your agents and RAG pipelines real-time web search plus proprietary data sources - papers, filings, market data, clinical trials, patents - as LLM-ready context. Two tools:
  • ValyuSearchTool - search, with full parameter control
  • ValyuContentsTool - clean content from specific URLs

Paste into your AI assistant to wire Valyu into a LangChain (Python) agent.

Open in Cursor

Installation

Set your API key in the environment. The agent examples also want an LLM provider key.

Free Credits

Get your API key with $10 free credits ($20 with a work email) from the Valyu Platform.

Content extraction

Clean, structured content from specific URLs, up to 10 per call.

In an agent

The most useful shape: a LangGraph agent that decides for itself when to search.

Search parameters

Both tools accept the same parameters as the Search API.
included_sources takes dataset ids, domains, URL prefixes or presets. ValyuContentsTool takes urls, plus summary, extract_effort and response_length as constructor options.
To steer the agent, bind a system message: use search_type="all" for breadth, "web" for current events only, raise relevance_threshold for precision, cite sources, and use natural-language queries rather than operators. See the Prompting Guide.

Additional Resources

LangChain Valyu Tool

Official LangChain 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)