@valyu/ai-sdk package.
1
Installation
Installation
Install the Valyu AI SDK package:.env file:2
Quick Start
Quick Start
Get started with web search in seconds:3
Available Search Tools
Available Search Tools
The@valyu/ai-sdk package includes eight specialized tools for different search domains:webSearch
General web search for current information, news, and articles.financeSearch
Search financial data including stock prices, earnings reports, and market data.paperSearch
Search academic research papers and scholarly articles.bioSearch
Search biomedical literature, clinical trials, and FDA information.patentSearch
Search patent databases for inventions and intellectual property.secSearch
Search SEC filings including 10-K, 10-Q, and regulatory documents.economicsSearch
Search economic data including BLS, FRED, and World Bank indicators.companyResearch
Generate comprehensive company intelligence reports with business overview, financials, SEC filings, news, and more.companyResearch uses the Valyu Answer API which provides AI-synthesized responses with citations. Costs are controlled via the dataMaxPrice parameter (default: $1.00 per section).4
Multi-Tool Search
Combine Multiple Search Tools
Use multiple search tools together for comprehensive research across domains:5
Configuration Options
6
Streaming Results
7
Create Your Own Tool
Create Your Own Custom Search Tool
Want to build a custom search tool beyond the pre-built ones? Use the Valyu DeepSearch API directly with the Vercel AI SDKtool() function:8
Best Practices
Best Practices
System Prompting
Guide your LLM to use search tools effectively:Cost Control
Control costs with configuration options:API Key Security
- Always use environment variables for
VALYU_API_KEY - Never commit API keys to version control
- Use
.env.localfiles for local development
TypeScript Support
Full TypeScript types are included:Available Types
ValyuBaseConfig- Base configuration for all toolsValyuWebSearchConfig- Web search configurationValyuFinanceSearchConfig- Finance search configurationValyuPaperSearchConfig- Research paper search configurationValyuBioSearchConfig- Biomedical search configurationValyuPatentSearchConfig- Patent search configurationValyuSecSearchConfig- SEC filings search configurationValyuEconomicsSearchConfig- Economics search configurationValyuCompanyResearchConfig- Company research configurationValyuSearchResult- Individual search resultValyuApiResponse- API response structure
Next Steps
- Explore the Valyu API Documentation for advanced features
- Get your API key at Valyu Platform
- View the source code on GitHub
- Check out more examples in our documentation

