Skip to main content

Build Multimodal Live Agents Easily with Google's ADK and Gemini API

Google for DevelopersMay 16, 202520 min20,125 views
37 connections·40 entities in this video→

Building Live Agents with Gemini API

  • πŸ’‘ The initial approach involves building a multimodal live agent using the Gemini API, requiring a client, proxy, and the Gemini Live API itself.
  • πŸ› οΈ The proxy handles tool usage and authentication, routing user requests to the Gemini Live API, which acts as the application's brain.
  • 🧩 A key challenge is managing the tool handler, which matches function calls from the Live API with background tools like a cloud run function for weather.
  • ⚑ The Gemini Live API recognizes when a tool is needed, generates a function call with parameters, and the tool handler executes it, returning data to the API for a human-like response.

Simplifying with Agent Development Kit (ADK)

  • ✨ The Agent Development Kit (ADK) drastically simplifies live agent creation by removing the need for a custom proxy and handling core components.
  • πŸš€ ADK provides a wrapper around the Gemini Live Streaming API, managing websockets and message formatting automatically.
  • πŸ“₯ Developers only need to implement two main functions: handle_client_messages to queue data (audio, text, video) and handle_agent_responses to process events and return them to the frontend.
  • 🧩 ADK handles function calls, tool execution, and returns various events including audio, transcripts, and images, significantly reducing boilerplate code.

Instantiating and Running Live Agents with ADK

  • βš™οΈ To instantiate a live agent with ADK, you configure voice_config and run_config, specifying modalities like audio with transcripts enabled.
  • ▢️ A normal agent is transformed into a live agent by calling runner.run_live() instead of runner.run().
  • 🧠 The core agent construction (model type, name, description, instructions, tools) remains the same as for non-live agents.
  • πŸ“ˆ Demos show that ADK provides identical performance to the manual Gemini API approach but with significantly simplified development.

Benefits and Next Steps

  • βœ… ADK allows developers to focus on building agentic systems rather than infrastructure like UI and proxy servers.
  • πŸ“š The key for developers is understanding how to build normal agents, as ADK handles the live streaming complexities.
  • 🌐 Developers are encouraged to explore the ADK streaming documentation to start building their own live agents.
Knowledge graph40 entities Β· 37 connections

How they connect

An interactive map of every person, idea, and reference from this conversation. Hover to trace connections, click to explore.

Hover Β· drag to explore
40 entities
Chapters8 moments

Key Moments

Transcript77 segments

Full Transcript

Topics13 themes

What’s Discussed

Multimodal AgentsLive Streaming APIGemini APIAgent Development Kit (ADK)Function CallingTool UsageReal-time InteractionWebsocketsCloud RunGenerative AIAI AgentsGoogle CloudVertex AI
Smart Objects40 Β· 37 links
ProductsΒ· 22
CompaniesΒ· 3
ConceptsΒ· 13
PersonΒ· 1
LocationΒ· 1