GuidesBigQuery
An AI agent for BigQuery with a cap on what each query may scan.
BigQuery bills by the bytes a query scans, which makes an agent that wanders through tables an expensive one. DeepORG reads one dataset, has BigQuery compute every total, and lets you cap the bytes any single query may bill. Support is experimental and read-only.
The short version
What you get on BigQuery.
- Read-only by construction. Schema discovery and queries. There are no writes, subscriptions or transactions on a BigQuery source.
- A byte cap per query. Set
max_bytes_billedand BigQuery refuses any query that would bill more, before it runs. - BigQuery computes. Sums, counts and grouping compile into the statement; nested results are built with
JSON_OBJECTandARRAY_AGG. - Rules from the caller. Row filters and column lists from the person’s role are part of every statement.
Connect
Project, dataset, credentials.
curl -fsSL https://deeporg.io/install.sh | bash# config/dev.yml
sources:
- name: analytics
kind: database
type: bigquery
default: true
connection_string: bigquery://my-project/my_dataset?location=EU&max_bytes_billed=10000000000There is no host or password. Credentials come from Application Default Credentials: GOOGLE_APPLICATION_CREDENTIALS, the attached service account on Google Cloud, or gcloud auth application-default login on a workstation. Add credentials_file= to the connection string to use a service-account key instead.
The account needs to run query jobs in the project and read the dataset, for example the BigQuery Job User and BigQuery Data Viewer roles.
deeporg serveYour AI client
Add it to Claude Code or Codex.
claude mcp add deeporg -- deeporg mcp --path /absolute/path/to/config
codex mcp add deeporg -- deeporg mcp --path /absolute/path/to/configYour client’s model plans the queries; BigQuery runs them; DeepORG checks each one against your rules first.
Limits
Experimental, and here is what that means.
- One dataset per source. Discovery covers the dataset in the connection string. Add a source for each dataset the agent should see.
- Profiling scans columns. The catalog’s sample values and value ranges come from queries that scan the columns they profile. Set
max_bytes_billedon a large dataset. - Row counts may be missing. They come from
INFORMATION_SCHEMA.TABLE_STORAGE; where the account cannot read that view, they are left out. - A write preview fails. Rehearsing a change depends on rolling back a transaction, which BigQuery does not have, so it fails instead of running.
Go deeper
Related pages.
- Snowflake AI agent: the same idea, with writes and key-pair sign-in.
- Multiple databases: join BigQuery results to an operational database.
- Database config: every connection option.
- Database support: every dialect side by side.