Integrate Tavily with Agno to enhance your AI agents with powerful web search capabilities. Agno provides a lightweight library for building agents with memory, knowledge, tools, and reasoning, making it easy to incorporate real-time web search and data extraction into your AI applications.
from agno.agent import Agentfrom agno.tools.tavily import TavilyToolsimport os# Initialize the agent with Tavily toolsagent = Agent( tools=[TavilyTools( search=True, # Enable search functionality max_tokens=8000, # Increase max tokens for more detailed results search_depth="advanced", # Use advanced search for comprehensive results format="markdown" # Format results as markdown )], show_tool_calls=True)
# Example 1: Basic search with default parametersagent.print_response("Latest developments in quantum computing", markdown=True)# Example 2: Market research with multiple parametersagent.print_response( "Analyze the competitive landscape of AI-powered customer service solutions in 2024, " "focusing on market leaders and emerging trends", markdown=True)# Example 3: Technical documentation searchagent.print_response( "Find the latest documentation and tutorials about Python async programming, " "focusing on asyncio and FastAPI", markdown=True)# Example 4: News aggregationagent.print_response( "Gather the latest news about artificial intelligence from tech news websites " "published in the last week", markdown=True)