Documentation Index
Fetch the complete documentation index at: https://spacesail.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
This example demonstrates how to create an asynchronous data analyst agent that can analyze movie data using DuckDB tools and provide insights about movie ratings.
Code
"""Run `pip install duckdb` to install dependencies."""
import asyncio
from textwrap import dedent
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.duckdb import DuckDbTools
duckdb_tools = DuckDbTools(
create_tables=False, export_tables=False, summarize_tables=False
)
duckdb_tools.create_table_from_path(
path="https://agno-public.s3.amazonaws.com/demo_data/IMDB-Movie-Data.csv",
table="movies",
)
agent = Agent(
model=OpenAIChat(id="gpt-5-mini"),
tools=[duckdb_tools],
markdown=True,
additional_context=dedent("""\
You have access to the following tables:
- movies: contains information about movies from IMDB.
"""),
)
asyncio.run(agent.aprint_response("What is the average rating of movies?"))
Usage
Create a virtual environment
Open the Terminal and create a python virtual environment.python3 -m venv .venv
source .venv/bin/activate
Install libraries
pip install -U agno openai duckdb
Export your OpenAI API key
export OPENAI_API_KEY="your_openai_api_key_here"
Create a Python file
Create a Python file and add the above code. Find All Cookbooks
Explore all the available cookbooks in the Agno repository. Click the link below to view the code on GitHub:Agno Cookbooks on GitHub