Skip to content

2. Agents

What will you understand in this chapter?

This is where you run and understand the Ops Copilot, the completed reference agent carried through the whole course. You start from the runtime concepts, inspect the real composition root, then make model selection, instructions, persistent sessions, and the development loop explicit.

Work through the sections in order — the concepts come first, then the build:

  • 2.0. Concepts: The ADK 2.0 building blocks — Agent, Runner, Session, Events, Tools, and the graph Workflow.
  • 2.1. First Agent: Inspect and run the Ops Copilot end to end on local Qwen3.
  • 2.2. Models: Understand the default Ollama contract and the optional native Gemini branch.
  • 2.3. Instructions: The system instruction — persona, operating rules, grounding, and structured output.
  • 2.4. Sessions: Persistent ADK sessions, A2A tasks, lifecycle ownership, and resettable runtime state.
  • 2.5. Dev Loop: Offline gates, interactive modes, model-backed evaluations, and failure diagnosis.

By the end you can explain a typed agent with an explicit provider path, policy callbacks, a persistent A2A runtime, and a model-free verification gate. Chapter 3 deepens its tools, knowledge, workflows, and delegation; Chapter 8.7 asks you to adapt these boundaries to your own domain.