from agno.agent import Agent
from agno.tools.google_bigquery import GoogleBigQueryTools
agent = Agent(
instructions=[
"You are a data analyst assistant that helps with BigQuery operations",
"Execute SQL queries to analyze large datasets",
"Provide insights and summaries of query results",
],
tools=[GoogleBigQueryTools(dataset="your_dataset_name")],
markdown=True,
)
agent.print_response("List all tables in the dataset and describe the sales table")
Create a virtual environment
Terminal
and create a python virtual environment.python3 -m venv .venv
source .venv/bin/activate
Set your credentials
export GOOGLE_CLOUD_PROJECT=your-project-id
export GOOGLE_CLOUD_LOCATION=US
export GOOGLE_APPLICATION_CREDENTIALS=path/to/credentials.json
export OPENAI_API_KEY=xxx
Install libraries
pip install -U google-cloud-bigquery openai agno
Run Agent
python cookbook/tools/google_bigquery_tools.py