> ## Documentation Index
> Fetch the complete documentation index at: https://docs.guild.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# BigQuery

> Give agents access to Google BigQuery datasets and tables.

The `@guildai-services/guildai~bigquery` package gives your agents access to Google BigQuery datasets and tables through Guild's BigQuery integration.

## Authentication

* **Type:** OAuth 2.0 or service account
* **Token management:** Refreshed automatically

### Setup

<Steps>
  <Step title="Open Credentials">Go to **Credentials** in Guild.</Step>
  <Step title="Connect BigQuery">Click **BigQuery** and authorize with a Google account that has BigQuery Data Viewer and Job User roles.</Step>
</Steps>

## Usage

```typescript theme={null}
import { bigqueryTools } from "@guildai-services/guildai~bigquery"
import { llmAgent } from "@guildai/agents-sdk"

export default llmAgent({
  description: "An agent that queries BigQuery datasets",
  tools: { ...bigqueryTools },
})
```

### Selecting specific tools

Tools are named with the `bigquery_` prefix. Use `pick()` to include only what your agent needs.

```typescript theme={null}
import { bigqueryTools } from "@guildai-services/guildai~bigquery"
import { llmAgent, pick } from "@guildai/agents-sdk"

export default llmAgent({
  description: "An agent that runs analytical queries",
  tools: {
    ...pick(bigqueryTools, [
      "bigquery_jobs_query",
      "bigquery_jobs_get_query_results",
      "bigquery_datasets_list",
      "bigquery_tables_list",
    ]),
  },
})
```
