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

# BigQuery

> Connect a Google BigQuery project to Genloop with a service account key, scope access to a dataset, and query your warehouse in natural language.

Genloop connects to BigQuery over an encrypted (HTTPS) connection using a Google Cloud service account. You provide the service account key and the dataset you want Genloop to read.

## Before you connect

* A Google Cloud service account with read access to your data.
* The dataset you want Genloop to query.

## Connection fields

| Field                          | Description                                                                          |
| ------------------------------ | ------------------------------------------------------------------------------------ |
| **Connection name**            | A name to identify this connection in Genloop                                        |
| **Service account key (JSON)** | The JSON key file for your service account                                           |
| **Dataset**                    | The dataset Genloop reads. May be given as `project.dataset`                         |
| **Project**                    | Optional. Project where the dataset lives. Defaults to the service account's project |
| **Location**                   | Optional. Region where queries run                                                   |

## Set up a service account

<Steps>
  <Step title="Open Service Accounts">
    In the Google Cloud Console, go to **IAM & Admin → Service Accounts**.
  </Step>

  <Step title="Grant read roles">
    Create or select a service account and grant it **BigQuery Data Viewer** and **BigQuery Job User**.
  </Step>

  <Step title="Create a JSON key">
    Create a key for the service account, download the JSON file, and upload it in the Genloop connection form.
  </Step>
</Steps>

## Encryption and network

Genloop reaches BigQuery over the internet using an encrypted (HTTPS) connection. There is no SSL setting to configure, and an SSH tunnel is not used. Control access through the service account's roles rather than a network allowlist.

## Permissions

Genloop only reads your data. The service account you provide needs read access to the datasets you want to query.

If you want a dedicated service account for Genloop, ask your Google Cloud administrator to grant it the roles below.

<Accordion title="Required roles (for your Google Cloud administrator)">
  Grant the service account:

  * `bigquery.dataViewer` on the datasets you want Genloop to query.
  * `bigquery.jobUser` on the project to run queries.
</Accordion>

## Next steps

<CardGroup cols={2}>
  <Card title="Connect a database" icon="database" href="/using-genloop/connections/connect-a-database">
    Back to the full connection flow.
  </Card>

  <Card title="Context Hub" icon="brain" href="/using-genloop/context-hub">
    View and edit the memory built from your connection.
  </Card>
</CardGroup>
