Skip to main content

Overview

Valyu integrates with Agno as a toolkit, providing your AI agents with access to web search and specialised data sources including life sciences, finance, SEC filings, patents, economics, and academic papers.
Also see the Agno documentation for Valyu for additional examples and usage patterns.
The integration provides 8 specialised search tools:
  • search - General search across all Valyu sources
  • web_search - Search the web for current information and news
  • life_sciences_search - Search biomedical data (PubMed, clinical trials, FDA, ChEMBL, DrugBank)
  • sec_search - Search SEC filings (10-K, 10-Q, 8-K, proxy statements)
  • patent_search - Search patent databases for inventions and IP
  • finance_search - Search financial data (stocks, earnings, balance sheets, crypto, forex)
  • economics_search - Search economic data (BLS, FRED, World Bank)
  • paper_search - Search academic papers (arXiv, PubMed, bioRxiv, medRxiv)

Installation

Install the Valyu library:
pip install valyu
Configure your API key:
export VALYU_API_KEY="your-api-key-here"

Free Credits

Get your API key with $10 credit from the Valyu Platform.

Quick Start

Add Valyu tools to your Agno agent:
from agno.agent import Agent
from agno.tools.valyu import ValyuTools

agent = Agent(
    tools=[ValyuTools()],
    markdown=True,
)

# General search across all sources
agent.print_response("What are the latest developments in AI safety research?")

Specialised Search Tools

Search the web for current information, news, and articles:
from agno.agent import Agent
from agno.tools.valyu import ValyuTools

agent = Agent(tools=[ValyuTools()], markdown=True)

# Search for recent news
agent.print_response("Search the web for recent news about OpenAI")
Best for: Real-time information, news, current events, general web content Search biomedical data including PubMed, clinical trials, FDA drug labels, ChEMBL, DrugBank, and Open Targets:
from agno.agent import Agent
from agno.tools.valyu import ValyuTools

agent = Agent(tools=[ValyuTools()], markdown=True)

# Search clinical trials
agent.print_response("Find clinical trials for GLP-1 agonists in obesity treatment")

# Search drug databases
agent.print_response("What are the mechanisms of action for pembrolizumab?")
Best for: Medical research, clinical trials, drug information, disease studies, FDA labels, drug targets Data sources: PubMed, bioRxiv, medRxiv, ClinicalTrials.gov, FDA Drug Labels, ChEMBL, PubChem, DrugBank, Open Targets, NPI Registry, WHO ICD Search SEC filings including 10-K, 10-Q, 8-K, and regulatory documents:
from agno.agent import Agent
from agno.tools.valyu import ValyuTools

agent = Agent(tools=[ValyuTools()], markdown=True)

# Search SEC filings
agent.print_response("What are the main risk factors in Tesla's latest 10-K filing?")
Best for: SEC filings, annual reports, quarterly reports, proxy statements, regulatory disclosures Search patent databases for inventions and intellectual property:
from agno.agent import Agent
from agno.tools.valyu import ValyuTools

agent = Agent(tools=[ValyuTools()], markdown=True)

# Search patents
agent.print_response("Search for patents related to solid-state battery technology")
Best for: Patent information, prior art, inventions, intellectual property Search financial data including stock prices, earnings, balance sheets, and market data:
from agno.agent import Agent
from agno.tools.valyu import ValyuTools

agent = Agent(tools=[ValyuTools()], markdown=True)

# Search financial data
agent.print_response("Get Apple's quarterly revenue data for 2024")

# Search market data
agent.print_response("What are the latest insider transactions for NVIDIA?")
Best for: Stock prices, earnings reports, financial statements, market data, insider transactions, dividends Data sources: Stock prices, SEC filings, Earnings reports, Balance sheets, Income statements, Cash flows, Dividends, Insider transactions, Market movers, Cryptocurrency, Forex Search economic data from BLS, FRED, World Bank, and government sources:
from agno.agent import Agent
from agno.tools.valyu import ValyuTools

agent = Agent(tools=[ValyuTools()], markdown=True)

# Search economic indicators
agent.print_response("Find the current US unemployment rate and CPI data")
Best for: Labor statistics (BLS), Federal Reserve economic data (FRED), World Bank indicators, unemployment rates, GDP, inflation, government spending Data sources: Bureau of Labor Statistics (BLS), Federal Reserve Economic Data (FRED), World Bank, US Government Spending Search academic papers from arXiv, PubMed, bioRxiv, medRxiv, and Wiley:
from agno.agent import Agent
from agno.tools.valyu import ValyuTools

agent = Agent(tools=[ValyuTools()], markdown=True)

# Search academic papers
agent.print_response("Search for papers on transformer attention mechanisms")
Best for: Academic research, scientific papers, scholarly articles, preprints Data sources: arXiv, PubMed, bioRxiv, medRxiv, Wiley Finance Papers

Configuration Options

Customise the toolkit with these parameters:
from agno.agent import Agent
from agno.tools.valyu import ValyuTools

agent = Agent(
    tools=[ValyuTools(
        # API key (defaults to VALYU_API_KEY env var)
        api_key="your-api-key",

        # Maximum number of results per search (default: 10)
        max_results=10,

        # Minimum relevance score for results (default: 0.5)
        relevance_threshold=0.5,

        # Maximum price for API calls (default: 30.0)
        max_price=30.0,

        # Maximum length of text content per result (default: 1000)
        text_length=1000,

        # Default search type: "web", "proprietary", "all" (default: "all")
        search_type="all",
    )],
    markdown=True,
)

Multi-Tool Research

Combine multiple specialised searches for comprehensive research:
from agno.agent import Agent
from agno.tools.valyu import ValyuTools

agent = Agent(
    tools=[ValyuTools()],
    markdown=True,
    instructions="""You are a research assistant with access to specialised search tools.

    - Use life_sciences_search for medical research, clinical trials, and drug data
    - Use finance_search for stock prices, earnings, and market data
    - Use sec_search for SEC filings and regulatory documents
    - Use patent_search for patents and intellectual property
    - Use economics_search for economic indicators and government data
    - Use paper_search for academic papers and research
    - Use web_search for current events and general information

    Always cite your sources with URLs when available.""",
)

# Research a complex topic across multiple domains
agent.print_response(
    "Research the commercialisation of CRISPR technology - "
    "find recent clinical trials, patent filings, and company financials"
)

Best Practices

System Instructions

Guide your agent to use the right search tools:
from agno.agent import Agent
from agno.tools.valyu import ValyuTools

agent = Agent(
    tools=[ValyuTools()],
    markdown=True,
    instructions="""You are a financial research assistant.

    SEARCH GUIDELINES:
    - Use finance_search for stock prices, earnings, and market data
    - Use sec_search for SEC filings and regulatory documents
    - Use economics_search for economic indicators
    - Use web_search for current news and events
    - Use paper_search for academic research on finance topics

    RESPONSE FORMAT:
    - Always cite sources with URLs
    - Include publication dates for time-sensitive data
    - Distinguish between real-time and historical data""",
)

agent.print_response("Analyse NVIDIA's financial performance and growth outlook")

Cost Control

Control costs with configuration options:
ValyuTools(
    max_price=10.0,           # Lower maximum cost per query
    max_results=5,            # Limit number of results
    relevance_threshold=0.7,  # Only high-quality results
)

Domain-Specific Agents

Create specialised agents for different use cases:
# Biomedical research agent
bio_agent = Agent(
    tools=[ValyuTools(max_results=10)],
    instructions="You are a biomedical research assistant. Use life_sciences_search for clinical trials, drug data, and medical research.",
)

# Financial analysis agent
finance_agent = Agent(
    tools=[ValyuTools(max_results=15)],
    instructions="You are a financial analyst. Use finance_search and sec_search for market data and regulatory filings.",
)

# Patent research agent
patent_agent = Agent(
    tools=[ValyuTools(max_results=10)],
    instructions="You are a patent researcher. Use patent_search for prior art and IP research.",
)

Toolkit Functions Reference

FunctionDescription
searchGeneral search across all Valyu sources. Supports included_sources and excluded_sources filters.
web_searchSearch the web for current information, news, and articles. Supports domain filtering.
life_sciences_searchSearch biomedical data: PubMed, clinical trials, FDA drug labels, ChEMBL, DrugBank, Open Targets.
sec_searchSearch SEC filings (10-K, 10-Q, 8-K, proxy statements).
patent_searchSearch patent databases for inventions and intellectual property.
finance_searchSearch financial data: stocks, earnings, balance sheets, dividends, crypto, forex.
economics_searchSearch economic data from BLS, FRED, and World Bank.
paper_searchSearch academic papers from arXiv, PubMed, bioRxiv, medRxiv, and Wiley.

Additional Resources