DEV Community

Rosebella Wandere
Rosebella Wandere

Posted on

Building a Data Analyst Agent with Google ADK.

Lessons in Agentic Workflows

At the recent Build with Google AI event in Kisumu, the core focus centered around a fundamental shift: moving from single-prompt chat completion to Agentic Workflows.

Instead of asking one LLM to solve a complex problem in a single turn, agentic patterns split tasks across specialized, autonomous units coordinated by an orchestrator.

To explore this hands-on, I built a Data Analyst Agent using the Google Agent Development Kit (ADK). Here's a quick look at the build, the bugs I bumped into, and the concepts behind them.

What is Google ADK?

Google's Agent Development Kit (ADK) is an open-source, code-first Python framework for building and testing AI agents. It gives you:

  • Agents: Individual units with specific roles and instructions.
  • Tools: Custom functions (SQL execution, Python scripts, APIs) that agents invoke autonomously.
  • Orchestration: Dynamic routing loops to chain multiple agents together.
  • Development UI & Tracing: A local server (adk web) to monitor API calls, inspect payloads, and debug agent reasoning in real time.

Crucial Concept: Model Context Protocol (MCP)

A key concept when building agentic systems is the Model Context Protocol (MCP). MCP serves as a standardized bridge between AI models and external data sources or execution environments.

Rather than hardcoding custom integrations for every database or API, MCP gives agents a uniform interface to securely read context, access files, and call tools across different systems.

The Build & How I Fixed the Roadblocks

I instantiated the agent in agent.py using standard ADK imports:

from google.adk import Agent

data_agent = Agent(
    name="data_analyst",
    model="gemini-2.5-flash",
    instruction="You are an expert Data Analyst AI...",
)
Enter fullscreen mode Exit fullscreen mode

During local testing in the ADK web UI, I hit two quick configuration bumps:

Google ADK UI showing a 404 NOT_FOUND error

1. Requesting a Non-Existent Model (404 NOT_FOUND)

  • The Issue: The agent attempted to contact a model string that didn't map to a valid Vertex AI endpoint (gemini-1.5-flash), causing the platform to reject the request.
  • The Fix: I updated the model configuration to a valid target identifier: gemini-2.5-flash.

2. A Malformed Resource String (400 INVALID_ARGUMENT)

  • The Issue: A formatting slip left a space in the string ("gemini-2.5 flash" instead of a hyphen), breaking the API URL parser.
  • The Fix: I removed the stray space across .env and agent.py.

Finalizing the Credentials

After fixing the config files, I refreshed my local session using gcloud auth application-default login. Re-running adk web gave a clean 200 OK status, allowing the agent to successfully process data requests and generate summaries.
Successful 200 OK HTTP response with gemini-2.5-flash active

Key Takeaways

  1. Watch Configuration Syntax: Model names must exactly match active provider endpoints; minor typos break API routing.
  2. Standardize Tools with MCP: Leveraging protocols like MCP makes connecting agents to external databases and environments seamless.
  3. Use Local Tracing: Running local inspection interfaces (adk web) drastically speeds up finding API-level bugs.

Top comments (0)