Lessons Learned from Production AI Agent Deployments

google_/_vertex_ai · Tech · 2024 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: production AI agents

Google's Vertex Applied AI Incubator observed that production agents fail when teams treat the model as the system and omit prompt optimization, layered safety, versioning, and stage-level evaluations.

Constraints:

Architecture

The talk recommends a production-agent architecture with meta-prompting for high-fidelity prompts, iterative prompt optimization using evaluation feedback, layered input/agent/output safety controls, semantic caching where repeated queries do not need the agent, golden-dataset evaluations across each pipeline stage, and Git-based versioning for prompts, functions, and tools.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  Meta_prompting_system["Meta-prompting system"] --> Target_agent_system["Target agent system"]
  Target_agent_system --> Safety_filters["Safety filters"]
  Target_agent_system --> Semantic_cache["Semantic cache"]
  Target_agent_system --> Evaluation_harness["Evaluation harness"]
  Evaluation_harness --> Meta_prompting_system
  Evaluation_harness --> Analytics_feedback["Analytics feedback"]
  Analytics_feedback --> Safety_filters
  Target_agent_system --> Version_controlled_artifacts["Version-controlled artifacts"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Meta-prompting system Generates and optimizes high-fidelity prompts for a target agent from seed prompts and evaluation feedback. Target agent system, Evaluation harness
Target agent system Production agent that uses prompts, grounding, tools, APIs, and generation controls to respond to users. Meta-prompting system, Safety filters, Semantic cache, Evaluation harness, Version-controlled artifacts
Safety filters Input, agent-side, and output controls for language/category checks, session limits, error handling, retries, and structured outputs. Target agent system, Analytics feedback
Semantic cache Bypasses the agent for repeated high-quality responses to reduce cost and latency. Target agent system
Evaluation harness Golden dataset and metric pipeline comparing runtime responses and per-stage outputs against expectations. Target agent system, Meta-prompting system, Analytics feedback
Analytics feedback Production signals that inform prompt updates, filters, and model or pipeline adjustments. Safety filters, Evaluation harness
Version-controlled artifacts Git repositories holding prompts, functions, tools, and agent definitions for diffs and rollback. Target agent system

Data flow

A developer seeds a meta-prompting system with task context, which generates or optimizes prompts for a target agent. The target agent handles user traffic through safety filters, APIs, grounding, and generation controls, while cached responses can bypass LLM calls for repeated queries. Runtime responses are compared with expectations in an evaluation harness, and stage-level metrics identify whether failures come from query rewriting, retrieval, reranking, summarization, or tool calling. Agent artifacts are stored in Git so changes can be diffed and rolled back.

3 supporting quotes
“and that meta prompting system is going to generate some uh prompts for a secondary system so we'll call that the target agent system”transcript, stated
“implementing these types of input filters is also super important”transcript, stated
“take those expectations and compare them against your agent responses like the things that are actually happening at runtime at inference time”transcript, stated

Why this architecture

The talk argues that models will commoditize, so production quality comes from the ecosystem around the model: prompt quality, safety layers, caching, evaluations, and software lifecycle discipline. Stage-level evaluation is needed because top-level response quality alone does not reveal which part of an agent or RAG pipeline regressed.

3 supporting quotes
“production agents are more than just the model in fact there's a lot that goes into it”transcript, stated
“what you're left with is that ecosystem that you're building around your model to make things like truly good”transcript, stated
“because you're only eving the outside of that pipeline so this is where it's also important to think about evals not only from an in toin perspective but also at every stage of the pipeline”transcript, stated

Models used: Gemini · OpenAI models · Claude · Vertex Prompt Optimizer · DSPy · AdalFlow · Dialogflow CX / Conversational Agents

Scale

Alternatives considered (roads not taken)

Focus mainly on model choice

Rejected because: The speaker says production agents are ecosystems with grounding, prompt engineering, orchestration, APIs, CI/CD, and analytics.

“there's been a lot of hyperfocus on you know what llm are you using”transcript, stated
“your production agents are more than just the model”transcript, stated

Rely on prompt engineering as the only defense

Rejected because: The talk warns that public agents face bad actors and need multi-layer defenses.

“rely solely on prompt engineering as their defense layer. This breaks down when agents face the public domain with bad actors attempting prompt injection and other attacks.”summary, stated
“start implementing multi-layer defenses against these types of of things”transcript, stated

Always send repeated queries through the agent

Rejected because: Caching can deliver the same high-quality outcome faster and cheaper for repeated queries.

“maybe that high quality outcome comes from caching responses and so you can completely bypass your agentic system”transcript, stated
“you save money from tokens and and you get a lot of speedback as well well”transcript, stated

Evaluate only the final output of a multi-stage RAG pipeline

Rejected because: End-to-end scores hide whether losses come from query rewrite, retrieval, reranking, or summarization.

“you don't really know why that's happening you know because you're using that model everywhere is it you know the fact that the query you write is suffering or is it the summarization that's suffering or is it the reranking that's suffering”transcript, stated

Patterns

prompt-versioning (lifecycle)

Prompts, tools, and functions are treated as code in Git so teams can diff prompt changes and roll back agent versions.

“pushing all of the you know all of the prompts all of the functions all the tools everything into git repost”transcript, stated
“you're looking at like what are the diffs between these prompts do we need to roll back to you know you know previous commits”transcript, stated

eval-driven-development (quality)

A golden dataset of expected interactions scores runtime responses and each pipeline stage against metrics such as semantic similarity, tool calling, coherence, and fluency.

“the the number one thing that you could do is just Implement evaluations if you don't do anything else Implement evaluations”transcript, stated
“when a user says this the agent should say this when a user responds with this the agent should call a tool with these inputs”transcript, stated

guardrails-io-filtering (safety)

The talk recommends language/category/session input filters, API security, output error handling, retries, controlled generation, and JSON-output validation.

“you can do things like language classification checks or category checks or session limit checks and things like that”transcript, stated
“error handling or retries uh does your llm API sometimes give you a 5 errror uh so being able to like do those types of things control generation Json outputs”transcript, stated

semantic-caching (serving)

Repeated user queries can reuse cached high-quality responses instead of invoking the full agentic system.

“knowing that you're going to have like the same query over and over and over again cash the response to that query and send it back to the user”transcript, stated
“you don't even have to you know involve your your llm at all or your agent system”transcript, stated

llm-as-judge (quality)

Optimization loops use evaluation metrics from agent responses to ask another LLM system to improve prompts for coherence or tool-calling losses.

“we can evaluate them against different types of metrics I think lots of other speakers today have talked about evals”transcript, stated
“can you optimize my prompt for better coherence can you optimize my prompt to reduce the losses in my tool calling”transcript, stated

Tradeoffs

Optimize prompts with another model

Chose Meta-prompting and prompt optimization over Only hand-written prompt engineering.

Rationale: The speaker argues LLMs can describe tasks in higher fidelity than many humans and can optimize prompts from evaluation feedback.

“humans aren't always necessarily great at explaining themselves and so what you're doing here is you're leveraging the lm's capability to kind of write”transcript, stated
“take this prompt and write it in higher Fidelity”transcript, stated

Use cache for repeated high-quality answers

Chose Cached responses over Invoking the latest agent/model every time.

Rationale: The talk prioritizes outcome quality, latency, and token cost over always using the most advanced model path.

“the only thing that matters when you're putting these systems into production is the outcome that they achieve”transcript, stated
“you save money from tokens and and you get a lot of speedback as well well”transcript, stated

Evaluate pipeline stages separately

Chose Stage-level evals for query rewrite, retrieval, reranking, and summarization over Only final-response scoring.

Rationale: Stage-level metrics localize regressions and allow targeted rollback or model replacement.

“performing evaluations on the query re write itself and also on the retrieval and also on the summarization”transcript, stated
“we could just swap that back with the previous model we'll have two models out in production and that will give us like the highest quality result”transcript, stated

Manage agent versions as code

Chose Git-based artifacts and CI/CD-style lifecycle over Manual prompt/version management in a UI.

Rationale: The speaker says prompts, functions, and tools should be diffed and rolled back like software development artifacts.

“you treat you treat everything as code right and so that even means like the prompts themselves”transcript, stated
“that's honestly the best way to manage uh versions of Agents is kind of treat them the same way that you would in a traditional like software de development life cycle”transcript, stated

Gotchas (what bit them)

Production quality is not determined by the model alone.

Root cause: Teams over-focus on which LLM they use and under-invest in the system around it.

Resolution: Treat production agents as system-design work involving grounding, orchestration, APIs, CI/CD, analytics, safety, and evals.

“there's been a lot of hyperfocus on you know what llm are you using”transcript, stated
“there's this entire kind of system design practice that goes into building out an agent including orchestration API Integrations you know cicd analytics”transcript, stated

Prompt injection can unfold over many turns.

Root cause: Bad actors exploit long-tail conversations rather than only a single malicious prompt.

Resolution: Apply input filters and session limits such as 30 or 50 turns as one layer of defense.

“there's a lot of prompt injection techniques that play out over the course of many turns”transcript, stated
“many of those are where the Bad actors are living”transcript, stated

Manual response inspection does not scale after a regression.

Root cause: Without a golden dataset and metrics, teams cannot quickly compare a baseline agent with a changed agent.

Resolution: Define expectations and score runtime responses against them on semantic similarity, tool calling, coherence, and fluency.

“you and your team are kind of sitting there going like what what's going on right like you you're starting to look at like kind of manual um you know basically inspecting manually every single response”transcript, stated
“what this really boils down to is essentially saying you need to Define what is the ideal scenario for what would happen”transcript, stated

End-to-end RAG evals can hide the failing stage.

Root cause: A new model or component may affect query rewrite, retrieval, reranking, or summarization, but the outer score only says the final response worsened.

Resolution: Evaluate each stage separately so the team can swap or fix only the stage with the largest loss.

“you're only eving the outside of that pipeline”transcript, stated
“this allows you to start to kind of sus out what is happening at each stage and identify like oh actually the largest losses that we're seeing are happening inside of the summarization stage”transcript, stated

Evaluation

The recommended evaluation model starts with a golden dataset of expected interactions, scores runtime agent behavior against metrics, feeds those metrics back into prompt optimization, and evaluates multi-stage RAG pipelines at each stage rather than only at the final output.

Metrics: semantic similarity · tool calling accuracy · coherence · fluency · query rewrite quality · retrieval quality · summarization quality

3 supporting quotes
“golden data set some people also call these expectations it's all really the same kind of stuff”transcript, stated
“you can score those against a various set of metrics again like semantic similarity tool calling coherence fluency things like that”transcript, stated
“without evaluations there's really no way for you to tell what's actually going on in your system how well it's working”transcript, stated

Outcomes

The speaker says the lessons come from hundreds of models delivered with developers, customers, and partners, but the talk is a lessons presentation rather than a measured case study.

3 supporting quotes
“these were the most common things that we found are the most impactful at building high quality agents in production”transcript, stated
“using some sort of meta prompting techniques or prompt optimization techniques implementing various stages of safety and guard rails and airor handling”transcript, stated
“absolutely every single engagement that we worked on had some form of evaluations in there”transcript, stated