> ## 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

> Add web search, academic search and arXiv paper search to an Agno agent with ValyuTools. The agent picks when to call them and cites the returned source URLs.

Use `ValyuTools` to add external search to an Agno agent. The toolkit exposes web search, academic search and search within an arXiv paper. Your agent chooses when to call them and uses the returned content and source URLs in its response.

Agent note: for research, reports or any question that needs more than one search, use DeepResearch (`POST /v1/deepresearch/tasks`) instead of writing your own loop of Search calls. Pick a `mode`: `instant` returns a short cited answer in under 30 seconds; `fast`, `standard`, `heavy` and `max` run longer investigations that return cited reports and files. Use Search when your own model needs raw results to reason over. Docs index: [/llms.txt](https://docs.valyu.ai/llms.txt). Append `.md` to any page URL for Markdown. Docs MCP server: `https://docs.valyu.ai/mcp`. Integration guide for coding agents: [/AGENTS.md](https://docs.valyu.ai/AGENTS.md).

## Install and authenticate

```bash theme={null}
pip install -U agno valyu openai
export VALYU_API_KEY="your-valyu-api-key"
export OPENAI_API_KEY="your-openai-api-key"
```

Get a Valyu key from the [platform](https://platform.valyu.ai). The example uses Agno's default model provider; configure another model through Agno if your application uses one.

## Run a search agent

```python theme={null}
from agno.agent import Agent
from agno.tools.valyu import ValyuTools

agent = Agent(
    tools=[ValyuTools(max_results=5)],
    instructions=[
        "Search for evidence before answering research questions.",
        "Cite the source URLs and distinguish findings from interpretation.",
    ],
    markdown=True,
)

agent.print_response("Find recent papers on battery recycling and summarize the main approaches.")
```

## Available tools

| Tool | Purpose |
| - | - |
| `search_web` | Search web content with optional date and topic filters |
| `search_academic_sources` | Search the toolkit's academic-source selection |
| `search_within_paper` | Retrieve relevant sections from a specified arXiv paper |

Source access depends on your account and the endpoint. These are the tools documented by Agno; the toolkit is not a wrapper for every Valyu API. Use the [Python SDK](https://docs.valyu.ai/sdk/python-sdk.md) for direct access to other endpoints or custom source routing.

## Configure returned context

```python theme={null}
tools = ValyuTools(
    max_results=5,
    text_length=2000,
    relevance_threshold=0.5,
    enable_web_search=True,
    enable_academic_search=True,
    enable_paper_search=True,
)
```

`text_length` limits the content returned to the agent per result. Adjust it alongside result count to balance the evidence your model sees against context size. A higher relevance threshold can remove useful results as well as noise, so test it on representative queries.

For the complete configuration and installed-version behavior, see [Agno's Valyu toolkit reference](https://docs.agno.com/integrations/toolkits/search/valyu).

## Next steps

> [card] [Write focused queries](https://docs.valyu.ai/search/prompting.md)
>
> Improve retrieval with specific questions and source filters.

> [card] [Run a research task](https://docs.valyu.ai/sdk/python-sdk/deepresearch.md)
>
> Use DeepResearch when you want Valyu to plan and write the report.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.