Database
CSV Tools
Examples
- Introduction
- Getting Started
- Agents
- Teams
- Workflows
- Applications
Agent Concepts
- Multimodal
- RAG
- Knowledge
- Memory
- Async
- Hybrid Search
- Storage
- Tools
- Search
- Social
- Web Scraping
- Database
- Local
- APIs & External Services
- Vector Databases
- Embedders
Models
- Anthropic
- AWS Bedrock
- AWS Bedrock Claude
- Azure AI Foundry
- Azure OpenAI
- Cohere
- DeepInfra
- DeepSeek
- Fireworks
- Gemini
- Groq
- Hugging Face
- Mistral
- NVIDIA
- Ollama
- OpenAI
- Perplexity
- Together
- xAI
- IBM
- LM Studio
- LiteLLM
- LiteLLM OpenAI
Database
CSV Tools
Code
cookbook/tools/csv_tools.py
from pathlib import Path
import httpx
from agno.agent import Agent
from agno.tools.csv_toolkit import CsvTools
url = "https://agno-public.s3.amazonaws.com/demo_data/IMDB-Movie-Data.csv"
response = httpx.get(url)
imdb_csv = Path(__file__).parent.joinpath("imdb.csv")
imdb_csv.parent.mkdir(parents=True, exist_ok=True)
imdb_csv.write_bytes(response.content)
agent = Agent(
tools=[CsvTools(csvs=[imdb_csv])],
markdown=True,
show_tool_calls=True,
instructions=[
"First always get the list of files",
"Then check the columns in the file",
"Then run the query to answer the question",
],
)
agent.cli_app(stream=False)
Usage
1
Create a virtual environment
Open the Terminal
and create a python virtual environment.
python3 -m venv .venv
source .venv/bin/activate
2
Set your API key
export OPENAI_API_KEY=xxx
3
Install libraries
pip install -U httpx openai agno
4
Run Agent
python cookbook/tools/csv_tools.py