> ## Documentation Index
> Fetch the complete documentation index at: https://docs.valyu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agno

> Use Valyu tools in your Agno AI agents for web search and specialised data access.

## Overview

Valyu integrates with [Agno](https://github.com/agno-agi/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.

<Tip>
  Also see the <a href="https://docs.agno.com/integrations/toolkits/search/valyu">Agno documentation for Valyu</a> for additional examples and usage patterns.
</Tip>

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) and insider transactions (Form 4)
* **`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:

```bash theme={null}
pip install valyu
```

Configure your API key:

```bash theme={null}
export VALYU_API_KEY="your-api-key-here"
```

<Card title="Free Credits" icon="gift" href="https://platform.valyu.ai" horizontal>
  Get your API key with \$10 credit from the Valyu Platform.
</Card>

## Quick Start

Add Valyu tools to your Agno agent:

```python theme={null}
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

### Web Search

Search the web for current information, news, and articles:

```python theme={null}
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

### Life Sciences Search

Search biomedical data including PubMed, clinical trials, FDA drug labels, ChEMBL, DrugBank, and Open Targets:

```python theme={null}
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

### SEC Search

Search SEC filings including 10-K, 10-Q, 8-K, and regulatory documents:

```python theme={null}
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 (10-K, 10-Q, 8-K), insider transactions (Form 4), regulatory disclosures

### Patent Search

Search patent databases for inventions and intellectual property:

```python theme={null}
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

### Finance Search

Search financial data including stock prices, earnings, balance sheets, and market data:

```python theme={null}
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

### Economics Search

Search economic data from BLS, FRED, World Bank, and government sources:

```python theme={null}
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

### Paper Search

Search academic papers from arXiv, PubMed, bioRxiv, and medRxiv:

```python theme={null}
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

## Configuration Options

Customise the toolkit with these parameters:

```python theme={null}
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:

```python theme={null}
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:

```python theme={null}
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:

```python theme={null}
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:

```python theme={null}
# 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

| Function               | Description                                                                                          |
| ---------------------- | ---------------------------------------------------------------------------------------------------- |
| `search`               | General search across all Valyu sources. Supports `included_sources` and `excluded_sources` filters. |
| `web_search`           | Search the web for current information, news, and articles. Supports domain filtering.               |
| `life_sciences_search` | Search biomedical data: PubMed, clinical trials, FDA drug labels, ChEMBL, DrugBank, Open Targets.    |
| `sec_search`           | Search SEC filings (10-K, 10-Q, 8-K) and insider transactions (Form 4).                              |
| `patent_search`        | Search patent databases for inventions and intellectual property.                                    |
| `finance_search`       | Search financial data: stocks, earnings, balance sheets, dividends, crypto, forex.                   |
| `economics_search`     | Search economic data from BLS, FRED, and World Bank.                                                 |
| `paper_search`         | Search academic papers from arXiv, PubMed, bioRxiv, and medRxiv.                                     |

## Additional Resources

<CardGroup>
  <Card title="Agno Documentation" icon="book" href="https://docs.agno.com/integrations/toolkits/search/valyu">
    Official Agno Valyu toolkit documentation
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/endpoint/search">
    Complete Valyu API documentation
  </Card>

  <Card title="Agno GitHub" icon="github" href="https://github.com/agno-agi/agno">
    Agno framework source code
  </Card>

  <Card title="Get API Key" icon="key" href="https://platform.valyu.ai">
    Sign up for free \$10 credit
  </Card>
</CardGroup>
