Valyu

ValyuTools provides academic and web search capabilities with advanced filtering and relevance scoring.

Prerequisites

The following example requires the valyu and openai libraries and an API key from Valyu.

uv pip install -U agno valyu openai
export VALYU_API_KEY=***

Example

The following agent can perform academic and web searches:

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()],
)

agent.print_response("Find recent research papers about machine learning in healthcare", stream=True)

Toolkit Params

ParameterTypeDefaultDescription
api_keyOptional[str]NoneValyu API key. Uses VALYU_API_KEY if not set.
enable_academic_searchboolTrueEnable academic sources search functionality.
enable_web_searchboolTrueEnable web search functionality.
enable_paper_searchboolTrueEnable search within paper functionality.
allboolFalseEnable all tools. Overrides individual flags when True.
text_lengthint1000Maximum length of text content per result.
max_resultsint10Maximum number of results to return.
relevance_thresholdfloat0.5Minimum relevance score for results.
content_categoryOptional[str]NoneContent category for filtering.
search_start_dateOptional[str]NoneStart date for search filtering (YYYY-MM-DD).
search_end_dateOptional[str]NoneEnd date for search filtering (YYYY-MM-DD).
search_domainsOptional[List[str]]NoneCurrently has no effect. The value is stored but never sent to the Valyu API.
sourcesOptional[List[str]]NoneFallback sources when the method supplies none. Academic search selects its own datasets; paper search supplies its paper URL filter.
max_pricefloat30.0Provider cost-per-thousand-results (CPM) filter, not a per-call budget; see Valyu pricing.
tool_call_modeboolFalsePass is_tool_call=True to the Valyu search API.

Toolkit Functions

FunctionDescription
search_academic_sourcesSearch academic sources for research papers and publications.
search_webSearch web sources for general information and content.
search_within_paperSearch within a specific ArXiv paper for detailed information.

Developer Resources