> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Google BigQuery

> GoogleBigQueryTools enables agents to interact with Google BigQuery for large-scale data analysis and SQL queries.

**GoogleBigQueryTools** enable an Agent to run SQL queries and analyze large-scale datasets in Google BigQuery.

## Prerequisites

The following example requires the `google-cloud-bigquery` and `openai` libraries.

```shell theme={null}
uv pip install -U google-cloud-bigquery openai
```

Set your Google Cloud project and location. Both are required, either as parameters or environment variables.

```shell theme={null}
export GOOGLE_CLOUD_PROJECT=your-project-id
export GOOGLE_CLOUD_LOCATION=your-location
```

## Example

The following agent can query and analyze BigQuery datasets:

```python theme={null}
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",
        "Help with data exploration and table analysis",
    ],
    tools=[GoogleBigQueryTools(dataset="your_dataset_name")],
)

agent.print_response("List all tables in the dataset and describe the sales table", stream=True)
```

## Toolkit Params

| Parameter | Type | Default | Description |
| - | - | - | - |
| `dataset` | `str` | - | BigQuery dataset name (required). |
| `project` | `Optional[str]` | `None` | Google Cloud project ID. Falls back to GOOGLE\_CLOUD\_PROJECT. One of the two must be set. |
| `location` | `Optional[str]` | `None` | BigQuery location. Falls back to GOOGLE\_CLOUD\_LOCATION. One of the two must be set. |
| `credentials` | `Optional[Any]` | `None` | Google Cloud credentials object. |
| `list_tables` | `bool` | `True` | Enable table listing functionality. |
| `describe_table` | `bool` | `True` | Enable table description functionality. |
| `run_sql_query` | `bool` | `True` | Enable SQL query execution functionality. |
| `all` | `bool` | `False` | Enables all functionality when set to True. |

## Toolkit Functions

| Function | Description |
| - | - |
| `list_tables` | List all tables in the specified BigQuery dataset. |
| `describe_table` | Get detailed schema information about a specific table. |
| `run_sql_query` | Execute SQL queries on BigQuery datasets. |

## Developer Resources

* [Tools Source](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/google/bigquery.py)
* [BigQuery Documentation](https://cloud.google.com/bigquery/docs)
* [BigQuery SQL Reference](https://cloud.google.com/bigquery/docs/reference/standard-sql/)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.