Agno Integration
Agno is a framework for creating multi-modal agents with memory, tools, and reasoning capabilities, designed to collaborate in teams to solve problems. It features a user-friendly Agent UI for seamless interaction.
Install Agno, Spider and OpenAI Python Libraries
Make sure to install Agno first, see install instructions here. Then install the Spider Python client and OpenAI SDK.
Install the Python Spider client
pip install agno spider-client openai
Simple Scrape Example
The following agent will simply scrape a single URL passed on to the agent or whatever URL the agent comes across in its session. The agent will return the scraped data in markdown format.
Simple Scrape Example in Markdown
from agno.agent import Agent
from agno.tools.spider import SpiderTools
agent = Agent(tools=[SpiderTools(optional_params={"proxy_enabled": True})]) # Optionally pass in extra parameters
agent.print_response('Scrape https://www.cnn.com for the latest news"', markdown=True)
Example Usage for Search and Scrape
The following agent will run a search query to get the latest news in the USA and scrape the first search result. The agent will return the scraped data in markdown format.
Search and Scrape Results Example
from agno.agent import Agent
from agno.tools.spider import SpiderTools
agent = Agent(tools=[SpiderTools()])
agent.print_response('Scrape the first result from a search on "current news in the USA"', markdown=True)
Toolkit Parameters
Use the toolkit parameters to adjust the output
max_results
(int): The maximum number of search results to returnurl
(str): The URL to be scraped or crawled
Toolkit Functions
Use the toolkit functions to invoke custom methods for results.
search
: Searches the web for the given queryscrape
: Scrapes the given URLcrawl
: Crawls the given URL