Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integrations/toolkits/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ The following **Toolkits** are available to use
iconType="duotone"
href="/integrations/toolkits/search/valyu"
>
Tools to search academic papers and web content using Valyu.
Search API for web search and specialised data sources (life sciences, finance, SEC, patents, economics).
</Card>
<Card
title="Wikipedia"
Expand Down
129 changes: 97 additions & 32 deletions integrations/toolkits/search/valyu.mdx
Original file line number Diff line number Diff line change
@@ -1,57 +1,122 @@
---
title: Valyu
description: ValyuTools provides academic and web search capabilities with advanced filtering and relevance scoring.
description: "Valyu is a search API providing web search and access to specialised/proprietary data sources for AI agents."
---

**ValyuTools** enable an Agent to search the web and access specialised data sources including life sciences, SEC filings, patents, finance, economics, and academic papers.

## Prerequisites

The following examples require the `valyu` library and an API key which can be obtained from [Valyu](https://platform.valyu.network).

```shell
pip install valyu
```

```shell
export VALYU_API_KEY=***
```

## Example

The following agent can perform academic and web searches:
The following agent can search across web and specialised data sources:

```python
from agno.agent import Agent
from agno.tools.valyu import ValyuTools

agent = Agent(
instructions=[
"You are a research assistant that helps find academic papers and web content",
"Use Valyu to search for high-quality, relevant information",
"Provide detailed analysis of search results with relevance scores",
"Focus on credible sources and academic publications",
],
tools=[ValyuTools()],
markdown=True,
)

agent.print_response("Find recent research papers about machine learning in healthcare", stream=True)
# General search across all sources
agent.print_response("What are the latest developments in AI safety research?")

# Web search
agent.print_response("Search the web for recent news about OpenAI")

# Life sciences search (PubMed, clinical trials, drug databases)
agent.print_response("Find clinical trials for GLP-1 agonists in obesity treatment")

# SEC filings search
agent.print_response("What are the main risk factors in Tesla's latest 10-K filing?")

# Patent search
agent.print_response("Search for patents related to solid-state battery technology")

# Finance search (stocks, earnings, balance sheets)
agent.print_response("Get Apple's quarterly revenue data for 2024")

# Economics search (BLS, FRED, World Bank)
agent.print_response("Find the current US unemployment rate and CPI data")

# Academic paper search
agent.print_response("Search for papers on transformer attention mechanisms")
```

## Toolkit Params

| Parameter | Type | Default | Description |
| ------------------------ | ------------------- | ------- | -------------------------------------------------------------- |
| `api_key` | `Optional[str]` | `None` | Valyu API key. Uses VALYU_API_KEY if not set. |
| `enable_academic_search` | `bool` | `True` | Enable academic sources search functionality. |
| `enable_web_search` | `bool` | `True` | Enable web search functionality. |
| `enable_paper_search` | `bool` | `True` | Enable search within paper functionality. |
| `text_length` | `int` | `1000` | Maximum length of text content per result. |
| `max_results` | `int` | `10` | Maximum number of results to return. |
| `relevance_threshold` | `float` | `0.5` | Minimum relevance score for results. |
| `content_category` | `Optional[str]` | `None` | Content category for filtering. |
| `search_start_date` | `Optional[str]` | `None` | Start date for search filtering (YYYY-MM-DD). |
| `search_end_date` | `Optional[str]` | `None` | End date for search filtering (YYYY-MM-DD). |
| `search_domains` | `Optional[List[str]]` | `None` | List of domains to search within. |
| `sources` | `Optional[List[str]]` | `None` | List of specific sources to search. |
| `max_price` | `float` | `30.0` | Maximum price for API calls. |
| Parameter | Type | Default | Description |
| --------------------- | --------------- | ------- | -------------------------------------------------------- |
| `api_key` | `Optional[str]` | `None` | Valyu API key. Uses VALYU_API_KEY env var if not set. |
| `max_results` | `int` | `10` | Maximum number of results to return per search. |
| `relevance_threshold` | `float` | `0.5` | Minimum relevance score for results. |
| `max_price` | `float` | `30.0` | Maximum price for API calls. |
| `text_length` | `int` | `1000` | Maximum length of text content per result. |
| `search_type` | `str` | `"all"` | Default search type ('web', 'proprietary', 'all'). |

## Toolkit Functions

| Function | Description |
| ------------------ | ---------------------------------------------------------------- |
| `academic_search` | Search academic sources for research papers and publications. |
| `web_search` | Search web sources for general information and content. |
| `paper_search` | Search within specific papers for detailed information. |
| 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, proxy statements). |
| `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, medRxiv, and Wiley. |

## Data Sources

### Life Sciences
- PubMed
- bioRxiv / medRxiv
- Clinical Trials (ClinicalTrials.gov)
- FDA Drug Labels
- ChEMBL
- PubChem
- DrugBank
- Open Targets
- NPI Registry
- WHO ICD

### Finance
- Stock prices
- SEC filings
- Earnings reports
- Balance sheets / Income statements / Cash flows
- Dividends
- Insider transactions
- Market movers
- Cryptocurrency
- Forex

### Economics
- Bureau of Labor Statistics (BLS)
- Federal Reserve Economic Data (FRED)
- World Bank
- US Government Spending

### Academic Papers
- arXiv
- PubMed
- bioRxiv / medRxiv
- Wiley Finance Papers

## Developer Resources

- View [Tools Source](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/valyu.py)
- [Valyu API Documentation](https://valyu.ai/docs)
- [Academic Search Best Practices](https://valyu.ai/academic-search)
- View [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/valyu.py)
- [Valyu Platform](https://platform.valyu.network)