Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

The AI Practitioner Podcast

The AI Practitioner Podcast artwork

PODCAST — Deploying Google ADK Agents: From Local Script to a Managed Cloud Runtime

Jul 10, 202616 minAudio
ShareXLinkedInFacebookWhatsAppEmail

Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. Multi-agent systems become valuable when they can reason and coordinate, but they become even more valuable when they are production-ready and can run reliably as a service. In this third episode of the Google ADK series, the focus moves beyond agent design and orchestration to deployment. Using the same multi-agent writing pipeline from the previous articles, this podcast explores how to turn an ADK agent into a cloud-native service with durable state, secure credentials, observability, authentication, and a clear path for client applications. You’ll learn: * How to choose between Agent Engine, Cloud Run, and GKE for hosting an ADK agent * How to externalize sessions, artifacts, memory, secrets, and model access for production * How to test the deployed service, stream responses, configure CORS, and connect a frontend 👉 Enjoyed this episode? Subscribe to The AI Practitioner to get future articles and podcasts delivered straight to your inbox: aipractitioner.substack.com Get full access to The AI Practitioner at aipractitioner.substack.com/subscribe

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Transcript

From the show. Tap a time to play from there.

[music]

SPEAKER_00welcome back to the ai practitioner i'm lina faik ml engineer consultant and lecturer in advanced machine learning at sorbonne university i help companies turn their data into real outcomes with ai and this is where i share what i learned from actual projects the deep technical write-ups live on Substack at aip practitioner.substack.com and these conversations are the audio companion today i'm joined by arthur who spent most of his career shipping back-end services and infrastructure he knows how

SPEAKER_00to run things in production cold but he hasn't deployed an agent specifically which is exactly the perspective i wanted because that gap is

SPEAKER_01the whole conversation happy to be here so what's on the table today

SPEAKER_00deployment specifically what happens when you take an ai agent that works beautifully on your laptop and try to make it a real service and i want to start with a scene a few months back i'm on a call we've got this multi-agent writing pipeline running it's great everyone's happy someone says fine ship it so i ship it i get a url back first message works second message has completely forgotten the first one ouch yeah and nothing erred the deploy was green the URL loaded it just quietly lost

SPEAKER_01the conversation hold on though this is a solved problem isn't it people have been deploying services for 20 years you wrap the thing in an endpoint you put it behind a load balancer done why is an agent different from any other back end that's the right pushback and it's

SPEAKER_00the trap the framing i use in the article is that composing agents tools memory workflows that's the baseline now every framework does it line graph crew ai auto gen adk the hard part isn't composing the agent anymore it's that in production the agent has to become a service but you just described

SPEAKER_01a service endpoint request responses

SPEAKER_00model endpoint sure but an agent carries more baggage than a model it needs a runtime durable sessions persistent artifacts secure credentials observability authentication and a safe way for a browser to actually reach it a model call is stateless an agent conversation is not that's the difference

SPEAKER_01that beat me on that call okay so walk me through the first decision if I've got a working agent what's the first thing I actually have to choose where it runs

SPEAKER_00in this series i'm using google adk and adk gives you three managed runtimes on google cloud same agent three very different operating models there's asian engine there's cloud run and there's gke which is kubernetes

SPEAKER_01and they trade off along what axis operational burden versus control

SPEAKER_00agent engine is the most managed it hides the most infrastructure you hand more of the serving layer to google great fit if you're already deep in the vertex ai ecosystem the cost is it's opinionated and less portable gke is the opposite end maximum control networking scaling sidecars gpus private networking all of it and maximum operational burden clusters manifests maintenance all now your problem

SPEAKER_01so one hides everything one exposes everything

SPEAKER_00exactly and cloud run sits right in the middle it runs your agent as a container behind a managed https endpoint more control than agent engine way less work than kubernetes for a first production deployment that middle ground is the sweet spot and it's what i use as the worked example why the middle though

SPEAKER_01that sounds like a compromise for the sake of it answer

SPEAKER_00it's not just splitting the difference there's a teaching reason and a real reason the teaching reason agent engine hides the exact boundaries i need to show you gke buries them under kubernetes concepts you don't need yet cloud run keeps everything visible without drowning you the agent is a container the endpoint is real the identity is explicit the state backends you have to wire up on purpose and the real reason flexibility because the container stays under your control you keep the model swap trick from the earlier articles

SPEAKER_00the pipeline can run gemini through vertex or it can run cloud through light llm and that's a config change not a rewrite agent engine can constrain that cloud run doesn't there's a full decision table in the article links in the caption but that's the shape of it

SPEAKER_01let me go back to your broken demo the conversation got forgotten why what actually changed between your laptop in

SPEAKER_00the cloud this is my favorite part because deployment doesn't add features it removes assumptions you didn't know you were making locally your agent is one long-lived process it sits there state lives in memory and memory just persists because nothing kills the process

SPEAKER_01and in the cloud the process isn't permanent right

SPEAKER_00an instance can be restarted replaced duplicated when traffic spikes so the moment your conversation lives in process memory it's gone the first time cloud run scales or recycles the container that's my second message it hit a fresh instance that had never seen

SPEAKER_01the first message that's kind of brutal because locally you'd never catch it

SPEAKER_00you'd never catch it and it's not just sessions credentials change too locally your model calls work because you're authenticated or you've got keys in a .iniini file in production the service runs as its own identity and permissions come through IAM and secrets come through a secret manager the file system changes locally you write a file and inspect it in a container you should never treat the file system as durable and client access changes the dev ui is a development surface a real front-end is a separate app often on another domain which drags in

SPEAKER_01a whole browser security conversation so deployment isn't a packaging step it's

SPEAKER_00a change in where everything lives that's the whole thing in one sentence where state lives how credentials are provided how clients reach you all three move

SPEAKER_01let's take state then you keep saying state like it's one thing is it

SPEAKER_00no and that's the mistake i want people to stop making in adk it's four separate concerns and they have genuinely different lifetimes and risk profiles sessions artifacts memory and credentials treating them as one generic storage problem is how you get subtle bugs

SPEAKER_01break them apart for me start with sessions sessions are the short-term state

SPEAKER_00of one conversation the previous messages intermediate decisions tool results everything the agent needs to continue the current chat two options in memory which is cheap and fast and dies on restart or persistent stored in an external backend so the serving process stays stateless while the conversation survives

SPEAKER_01and persistent is just always better not free though

SPEAKER_00in the demo repo it's a single flag persist sessions true or false flip it to true and the deploy script provisions a postgres instance on cloud sql and store sessions there but the database has a standing cost cloud run can scale to zero and cost you nothing when idle a small database is always on always billing

SPEAKER_01so it's a real trade not a default you mentioned the password thing earlier how does the database credential not end up somewhere embarrassing

SPEAKER_00this is the pattern i really want people to copy the database password is generated once the connection url goes into secret manager cloud run receives it at runtime the password is never committed to git and never baked into the image so the service is stateless the conversation is durable and the secret is nowhere it shouldn't be okay artifacts different from sessions how sessions preserve the conversation artifacts preserve what the agent produces drafts reports images exports generated files

SPEAKER_00and they're different because you often need to download them reuse them inspect them long after the session's over in production you point adk at an artifact backend cloud storage a gs bucket it's one uri flag interestingly the demo doesn't persist artifacts because it's focused on showing session persistence through the web ui but the moment you want to keep drafts around you add that one flag

SPEAKER_01and memory is a third thing which honestly sounds like sessions again it does and

SPEAKER_00the distinction matters sessions remember what's happening in this conversation memory is what carries across conversations user preferences tone constraints recurring instructions project context different lifetime entirely adk gives you a few backends behind one flag an in-memory one for local dev a vertex ai rag option when you want memory grounded in a corpus and a managed memory bank for long-term user memories across sessions i'll skip the exact uri strings on mike they're laid out in the article that's three you said four credentials and these aren't optional

SPEAKER_00the deployed agent needs secure access to model providers databases whatever cloud services it touches in the demo you pick your model provider with a variable gemini uses a google key cloud uses an anthropic key and the deploy script reads the right one from your local dot nene and pushes it into secret manager so

SPEAKER_01the dot nene still exists it exists to configure the deployment

SPEAKER_00it is not shipped with the service that boundary is everything and i boil it down to three rules keep keys out of git keep keys out of images because rebuilding or scanning an image shouldn't leak a secret and keep keys out of the browser ever a frontend should never see a model key or a database url

SPEAKER_01or service credentials i want to believe that's airtight but i've seen plenty of frontends calling apis with a key sitting right in the javascript what stops that here

SPEAKER_00nothing stops you from doing it wrong that's the honest answer the architecture stops you if you follow it the flow is one direction local dot any any read by the deploy script into secret manager injected into cloud run at runtime used by the agent to reach the model or the database the browser is never on that path if a key reaches the browser you built an extra path you weren't supposed

SPEAKER_01to build all right say i've deployed it's live how do i know it actually works and isn't quietly broken like your demo

SPEAKER_00the script prints a cloud run url at the end you open it and the adk web ui loads served from the cloud instead of your laptop you test the agent right there in the browser that's your first confirmation the service is reachable and the app loaded then you go into the google cloud console and honestly this is where the real verification lives a few places cloud run itself for request count latency instance count errors and revisions for agents latency and errors are the ones i watch a slow response could be the model a tool call a cold start or an overload

SPEAKER_00That's a lot of dashboards It is and I don't want it to sound like busy work each one answers a specific failure a missing secret shows up later as a runtime error in the logs so secret manager is both a verification step and a debugging step and one practical warning if you enabled the database just to test turn it off after cloud run scales to zero the database doesn't and it'll quietly bill you for a demo you finished last week okay

SPEAKER_01the web ui is fine for you testing it but a real product isn't going to send users to a dev ui how does an actual front end reach this thing and this is where

SPEAKER_00the browser bites you say your front-end is on app.initxtaple.com and your agent is on some run.app url different origins the browser has the security mechanism cores cross origin resource sharing that decides whether a page on one origin is even allowed to call a service on another so even though your cloud run service is reachable the browser can just block the request unless the agent explicitly allows that front-end origin so you open cores up

SPEAKER_01and move on

SPEAKER_00please don't you restrict it to your real frontend domains not wide open but honestly the cleaner architecture doesn't have the browser call the agent directly at all you put a backend or an api gateway or google's identity aware proxy in between browser talks to your backend your backend talks to the cloud run agent the agent talks to models and state that keeps every key and every database url away from the browser and gives the product one controlled front door

SPEAKER_01there's another thing about agents specifically they're slow a run is

SPEAKER_00an instant right and that's why streaming matters more here than for a normal api one agent request might involve planning tool calls model calls retries multi-agent handoffs if you make the user stare at a spinner for all of that, it feels broken. Streaming makes the process visible as it happens. The client flow is roughly create or reuse a session with stable user and session IDs, send a message from a trusted client or backend, stream the events as they arrive, and persist the result in the right backend. The dev UI is a testing surface.

SPEAKER_00The production client owns the real experience. Auth, rendering, all of it.

SPEAKER_01and if something in that chain is slow or fails how do i even find it a green http response doesn't mean the agent did the right thing

SPEAKER_00that's exactly the observability gap cloud run metrics give you the service level picture traffic latency errors instances necessary not sufficient because you still can't answer which model call failed which tool call took longest did a retry loop blow up latency and cost which step actually produced the final answer for that adk integrates with cloud trace so you can inspect the flow across the agent's execution you need both levels service observability and agent observability

SPEAKER_00a successful http response can still hide a slow expensive half-finished internal path let me push

SPEAKER_01on one last thing you've been selling adk this whole time where does it actually fall short

SPEAKER_00good because it does adk's real strength is one thing the google cloud native path it connects local agent development to cloud run agent engine gke cleanly if your target is google cloud that's genuinely strong but and this is the honest part adk does not hand you a finished production architecture authentication front-end access cost controls observability persistence strategy operational policy those are still your decisions deploying is the first checkpoint not the finish line

SPEAKER_01and versus the other frameworks different centers

SPEAKER_00of gravity line graph is built around graph execution checkpointing durable workflows state machine control reach for it when the core challenge is explicit workflow control and recovery crew ai is more about teams of agents flows guardrails enterprise style management of collaborative agents adk is strongest when the goal is agents that integrate naturally with google cloud so the choice is architectural not syntactic it's not which one has nicer syntax it's which one matches where you're going to run so

SPEAKER_01if i'm sitting at my desk monday morning with a working agent and i want to actually ship it without recreating your forgotten conversation moment where do i start

SPEAKER_00start by deciding two things before you touch a deploy command one which runtime and for a first production agent default to cloud run unless you have a specific reason not to two whether your sessions need to survive a restart because that single choice decides whether your you're paying for a database get those two right and you've dodged the failure i opened with everything else artifacts memory cores tracing you layer on once the service is actually stateful and reachable the full walkthrough the decision tables the deploy command and the code are all in the article

SPEAKER_00on Substack at app practitioner dot Substack dot com links in the caption and the thing i'd leave you with is this the moment your agent stops being a script and becomes a service works on my machine stops meaning anything production doesn't test your agent it tests every assumption you made about where its state was allowed to live

Open the transcript file

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. PODCAST — Beyond Static Prompts: Building Self-Improving LLM Agents with ACE

    Nov 19, 202611 minAudio

    Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if AI agents could learn from every interaction...

    Credit the people on this episode

  2. PODCAST — Inside GEPA: Evolving LLM Agent Prompts with Reflective Feedback

    Nov 11, 202611 minAudio

    Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if AI agents could continuously improve their...

    Credit the people on this episode

  3. PODCAST — TextGrad in Practice: Optimizing LLM Agent Prompts with Textual Gradients

    Nov 3, 202615 minAudio

    Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if AI agents could improve their own prompts...

    Credit the people on this episode

  4. PODCAST — Continuously Optimizing AI Agent Prompts in Production

    Oct 28, 202615 minAudio

    Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if the key to better AI agents isn’t writing...

    Credit the people on this episode

  5. PODCAST — From Prompt Engineering to Harness Engineering: Where the Real Leverage Moved

    Oct 16, 202613 minAudio

    Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if improving an AI agent’s performance had less...

    Credit the people on this episode