Skip to main content
It’s Tuesday morning and Claire’s email is short and to the point: “Don’t over-engineer it.” She wants a quick proof-of-concept that the idea works on two dummy customers — one healthy, one at risk — and she explicitly asked not to hook this up to any real data yet. She wants to see it by Thursday. That request is a great example of delivering just enough to validate an idea. In this lesson we skip building a full data pipeline and focus on task one: build an agent that can reason about two fake accounts and explain why one is at risk.
A presentation slide titled "Task One — Build the Agent" showing an email-style note from "Claire · Customer Success" asking not to hook the system to real data and to test on two dummy customer accounts. To the right are icons for a blocked "Data Pipeline" and two dashed boxes labeled "Two Fake Accounts."
Overview
  • Create a tiny in-memory dataset (two accounts) to simulate a warehouse.
  • Expose a simple lookup function as a tool the agent can call.
  • Instantiate an LlmAgent with that tool and an instruction telling it how to reason about churn.
  • Drive the agent with a Runner and inspect the agent’s answer and the tool call it made.
Why this works
  • Tools in ADK are plain Python functions. The model inspects their names, signatures, and docstrings to decide when to call them.
  • Keep docstrings clear: they are the tool’s advertisement to the model.
Customer test dataset For the PoC we create two customers in a Python dictionary:
  • C001 (Acme Corp): healthy, 22 logins in 30 days and 1 support ticket.
  • C002 (Blipco): low activity, 1 login and 6 support tickets — likely churn risk.
Tool: a simple lookup function Tools are just Python functions. ADK uses the function name, type hints, and its docstring as the tool description the model can see. Make docstrings explicit so the model knows when to use a tool.
A clear docstring and correct type hints are critical. The model uses them to decide whether a tool is relevant and when to call it.
Example tool:
Assembling the LLM agent An LlmAgent needs a name, a model wrapper, an instruction, and a list of tools. The model wrapper is the only line tied to a specific model implementation — swap it to change the underlying model.
Quick reference: LlmAgent key arguments Run the agent and ask Claire’s question Use a Runner to drive a single-shot conversation:
Expected concise agent output (example):
What happened under the hood You never explicitly called get_customer in your code. The model inspected available tools (their names, type hints, and docstrings), determined that get_customer was relevant, and issued the call itself to retrieve evidence. Internal tool call the agent performed:
Step-by-step scaffold (install and complete example) Follow these steps locally in a safe (non-production) environment. Install:
Full minimal example:
Best practices and next steps
  • Start small: use fake data to validate reasoning before requesting access to production systems.
  • Make tool docstrings explicit and include types — the model relies on them.
  • Iterate on the agent’s instruction to refine output format (for example, require JSON output for programmatic parsing).
  • Add more tools (e.g., activity history, billing, NPS) to improve evidence quality.
Do not point this prototype at production data. Use isolated test data and credentials while validating behavior. Only request real data access after you’ve shown the team the PoC results.
Links and references Now you have a minimal but complete proof-of-concept: an agent that identifies Blipco as high risk, cites supporting evidence it fetched via a tool call, and recommends an action — all against two hand-written dummy accounts.

Watch Video

Practice Lab