How ADK is Changing the Way We Query Data in BigQuery (in just a few lines of code!)

As a data engineer, few things excite me more than finding tools that truly simplify our daily work without sacrificing flexibility or power. Today I want to tell you about something I discovered that, honestly, I believe is a game changer: the built-in tools of Google's ADK, particularly its integration with BigQuery.

With ADK (Agent Development Kit), we can now empower our AI agents to interact directly with BigQuery in a secure and optimized way, without needing to write complex pipelines or set up intermediate orchestration layers. All of this is achieved thanks to the ready-to-use built-in tools that Google offers.

Why does this matter?

  • Radical simplicity: With just a few lines of configuration, you can authenticate and allow your agent to read data in BigQuery.

  • Integrated security: It leverages the default Google Cloud credentials, ensuring controlled and auditable access.

  • Immediate scalability: Your agents can run complex queries on terabytes of data without worrying about the underlying infrastructure.

  • Conversational and natural: Imagine your agent being able to answer questions about your data using natural language, directly on BigQuery.

How does it look in practice?

Here’s how simple it is to get an agent that queries BigQuery with ADK up and running:

pythonCopyEditfrom google.adk.agents import Agent
from google.adk.tools.bigquery import BigQueryCredentialsConfig, BigQueryToolset
from google.adk.tools.bigquery.config import BigQueryToolConfig, WriteMode
import google.auth

tool_config = BigQueryToolConfig(write_mode=WriteMode.BLOCKED)
application_default_credentials, _ = google.auth.default()

credentials_config = BigQueryCredentialsConfig(
    credentials=application_default_credentials
)

bigquery_toolset = BigQueryToolset(
    credentials_config=credentials_config, bigquery_tool_config=tool_config
)

root_agent = Agent(
    name="bq_agent",
    model="gemini-2.0-flash",
    tools=[bigquery_toolset],
    instruction="""Tu función es consultar la información en BigQuery para responder preguntas del usuario.""",
)

With this short snippet of code, you already have an agent ready to query your BigQuery datasets conversationally. No more endless configurations or cumbersome pipelines.

What this means for us

For those of us who work with data in the cloud, ADK + BigQuery gives us a superpower: democratizing access to information in a controlled manner and with the ease of LLMs (Large Language Models). Now it's easier to put the power of analysis in the hands of business users, analysts, and teams who need real-time answers.

0
Subscribe to my newsletter

Read articles from Jesús Castellanos directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Jesús Castellanos
Jesús Castellanos