Building Production-Ready Customer Support AI Agents: Challenges and Solutions

gradient_labs · Tech · year n/a · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.5 (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: Enterprise customer-support AI agents

Gradient Labs needed to run AI customer-support agents in production for enterprises where the agent must handle live conversations, race conditions, knowledge quality, private tool calls, model/provider constraints, enterprise policies, and safe pre-deployment testing.

Constraints:

Architecture

Gradient Labs models its production support agent as a state machine. Conversation events from support platforms trigger state transitions; some states are deterministic and others invoke agentic behavior. The agentic layer keeps code at a behavioral level, returns events for observability, executes all LLM calls through Temporal for durable retries, abstracts model providers such as Bedrock, Azure, and direct providers, logs completions and costs, uses point-in-time knowledge references for debuggability, and tests PR versions through thousands of simulations on production-grade traffic in an isolated evaluation environment.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  customer[Customer] --> support-platform[Support platform]
  support-platform --> agent-state-machine[Agent state machine]
  agent-state-machine --> agentic-behavior-layer[Agentic behavior layer]
  agent-state-machine --> enterprise-policy-controls[Enterprise policy controls]
  enterprise-policy-controls --> human-support-agent[Human support agent]
  support-platform --> human-support-agent
  agentic-behavior-layer --> knowledge-layer[Knowledge layer]
  knowledge-layer --> point-in-time-knowledge-store[Point-in-time knowledge store]
  agentic-behavior-layer --> tool-invocation-layer[Tool invocation layer]
  tool-invocation-layer --> private-company-apis[Private company APIs]
  agentic-behavior-layer --> llm-execution-layer[LLM execution layer]
  llm-execution-layer --> temporal-durable-execution[Temporal durable execution]
  llm-execution-layer --> model-provider-abstraction[Model provider abstraction]
  agentic-behavior-layer --> event-log[Event log]
  llm-execution-layer --> event-log
  tool-invocation-layer --> simulation-environment[Simulation environment]
  event-log --> simulation-environment
  simulation-environment --> evaluation-reviewers[Evaluation reviewers]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Customer End user seeking help through a support conversation. Support platform
Support platform External conversation system that starts chats, receives customer replies, emits timers/signals, and accepts agent or human responses. Customer, Agent state machine, Human support agent
Agent state machine High-level orchestration model that controls conversation states using external inputs, timers, and signals. Support platform, Agentic behavior layer, Enterprise policy controls, Human support agent
Agentic behavior layer Middle-level code where engineers express agent behavior such as classifying conversation clarity and asking for clarification. Agent state machine, LLM execution layer, Knowledge layer, Tool invocation layer, Event log
LLM execution layer Layer that invokes model completions with prompt/model coupling, priority management, rate-limit handling, and completion-quality checks. Agentic behavior layer, Temporal durable execution, Model provider abstraction, Event log
Temporal durable execution Durable execution engine used for LLM calls so AI engineers do not handle low-level retry behavior directly. LLM execution layer
Model provider abstraction Abstraction letting engineers request a model without caring whether it comes from Bedrock, Azure, or another provider. LLM execution layer
Knowledge layer Curated and point-in-time knowledge source used by the agent, with attention to public/private content, missing information, and debuggability. Agentic behavior layer, Point-in-time knowledge store
Point-in-time knowledge store Knowledge reference mechanism that allows debugging what the agent knew when a past outcome happened. Knowledge layer
Tool invocation layer Enterprise tool-call interface for private APIs and changing customer data, with evaluation constraints when tools cannot be called for real. Agentic behavior layer, Private company APIs, Simulation environment
Private company APIs Sensitive enterprise systems such as fraud status APIs whose data may change between retrieval and use. Tool invocation layer
Event log Observable event stream emitted by every agent decision for tracking behavior, completions, and costs. Agentic behavior layer, LLM execution layer, Simulation environment
Simulation environment Isolated production-grade evaluation environment that runs PR versions of the agent on production traffic scenarios. Tool invocation layer, Event log, Evaluation reviewers
Evaluation reviewers Manual or automated evaluators that inspect simulation outcomes before deployment. Simulation environment
Enterprise policy controls Functional and behavioral constraints for languages, handoff, timers, channels, closure policies, and regulated intents. Agent state machine, Human support agent
Human support agent Escalation recipient for conversations the AI cannot or should not handle, constrained by language and policy capabilities. Support platform, Agent state machine, Enterprise policy controls

Data flow

A customer starts or updates a support conversation. The support platform emits events into the agent state machine, which decides whether to respond, stop prior work, wait, escalate, or move into an agentic behavior. The behavior layer retrieves point-in-time knowledge, invokes private tools when safe, makes LLM calls through Temporal and the provider abstraction, returns events for observability, and sends a response or handoff. Before deployment, a PR version runs thousands of simulations on production-grade traffic in an isolated evaluation environment.

4 supporting quotes
“when conversations get started the AI agent can pick it up and start replying and resolving customer issues so the first key difference here is that a more traditional uh even machine learning based system is effectively an interface that's going to sit”transcript, stated
“AI agent instead we need to not just be thinking about requests for it to do work but also getting it to stop doing work when things in the outside world change or getting it to do different work when certain things in the outside world don't happen so um an example of that is a customer”transcript, stated
“Agents from a high sort of medium and lowlevel perspective from the high level perspective we architect our AI agents as state machines so in one of our blog posts I made a very simplistic one of like imagine a state machine of you and I talking to each other”transcript, stated
“that's an entire other part of our platform where we can spin up a PR of a version of our agent run you know thousands of simulations and then go in and either manually or automatically evaluate those simulations the critical thing that that changes from the more traditional engineering is if”transcript, stated

Why this architecture

Gradient Labs uses state machines and durable execution because production support agents are slower and more stateful than traditional APIs, must stop or change work when external conversation state changes, and have many more failure modes than a traditional model-serving system. State machines expose high-level flow control; the agentic middle layer stays readable; Temporal and provider abstraction hide low-level retries and infrastructure details from AI engineers.

4 supporting quotes
“getting a a prototype into production is hard and um now getting an llm um prot product uh agent agented workflow into production is actually a new kind of Beast”transcript, stated
“to worry about uh which is does it work well is it generally making good decisions and also what are all the million ways that it can go wrong um so thinking about where we are today with AI agents it's still a relatively newish topic um but I'm going to make some”transcript, stated
“it allows us to control the flow between uh the different states using all the things that I mentioned earlier”transcript, stated
“all our llm calls um are being executed with a durable execution engine shout out temporal um so our AI Engineers don't need to be thinking about like very low-level behaviors like retrying things that have failed and so on we're trying to strike that”transcript, stated

Models used: LLMs · OpenAI · Anthropic · Google · Bedrock · Azure · Temporal

Scale

Alternatives considered (roads not taken)

Treat the support bot as simple RAG

Rejected because: For large enterprises, pure RAG covers only a small fraction of what human support agents handle.

“retrieval augmented generation but we have certainly found that that is barely the tip of the iceberg for some of the largest uh Enterprises that we are working with where just a rag based agent is going to probably only cut into 10% or less of the the the”transcript, stated
“the tip of the iceberg for some of the largest uh Enterprises that we are working with where just a rag based agent is going to probably only cut into 10% or less of the the the actual problems of what their humans are working on so when we're building we built AI Agents from a high”transcript, stated

Dump all documentation into a vector database

Rejected because: Internal docs are not written for agents, omit knowledge in people's heads, mix public/private content, and approximate retrieval is insufficient for high-quality support.

3 supporting quotes
“throwing it into a vector database is almost like a guaranteed way to reach a bad outcome and the the Insight behind that is that most documents that are written especially documents that are internal to a company are have not been written with an AI agent”transcript, stated
“most documents that are written especially documents that are internal to a company are have not been written with an AI agent in mind”transcript, stated
“most information inside of a company resides in people's heads and so never Finds Its way to documentation at all”transcript, stated

Adopt an LLM framework immediately

Rejected because: Gradient Labs wanted deep surgery and a developer experience at the behavioral layer before committing to a framework.

“an AI agent may need to to to do I think the key thing that I wanted to highlight here is we chose not to adopt any um AI llm framework just yet we felt it was a little bit too early especially given how much sort of like deep surgery we wanted to to do here but really”transcript, stated
“we felt it was a little bit too early especially given how much sort of like deep surgery we wanted to to do here”transcript, stated

Use traditional A/B rollouts or shadow deployments as the main agent test path

Rejected because: AI agent testing is multifaceted, so Gradient Labs runs isolated production-grade simulations before live deployment.

3 supporting quotes
“things like AB rollouts things like Shadow deployments were very very very feasible um with uh an AI agent testing it um is like a multifaceted thing you know again could use a whole talk on that but one of the things that we have been really focusing on is”transcript, stated
“and things like AB rollouts things like Shadow deployments were very very very feasible um with uh an AI agent testing it um is like a multifaceted thing you know again could use a whole talk on that but one of the things that we have been really focusing on is being able to”transcript, stated
“straight into production in an isolated evaluation environment as opposed to a live production environment yeah that's cool that's um it's interesting that you just put it right onto onto production data in a kind of like a safe in a safe way but then you”transcript, stated

Let the agent freely call private tools during evaluation

Rejected because: Enterprise APIs can be private or sensitive, so evaluation has to test tool-using behavior without unrestricted real calls.

“you can rarely if ever allow your AI agent to make calls to private or sensitive apis Ju Just when you're evaluating it”transcript, stated
“the challenge of how do you have a an agent that uh how do you evaluate an agent that is using tools when it can't actually use those tools uh during an evaluation and secondly um most of the tools uh demos that we see are retrieving data Maybe from the public internet or from another source and um”transcript, stated

Bind prompts cleanly away from specific models

Rejected because: The speaker argues prompt performance is strongly tied to the model invoked, so abstraction has limits.

“the performance of a prompt is strongly tied to the specific models that are being invoked so it's a little bit like in the previous generation of deep learning models where it's hard to separate the hardware from the model in this case it's hard to separate”transcript, stated
“deep learning models where it's hard to separate the hardware from the model in this case it's hard to separate out the llm call from The Prompt that's calling it now we're into the middle of the sandwich and I've put it into uh two sections so it's sort of very well known that the”transcript, stated

Patterns

durable-execution (orchestration)

Gradient Labs runs all LLM calls through Temporal so AI engineers can focus on behavior instead of retries and low-level execution failures.

“all our llm calls um are being executed with a durable execution engine shout out temporal”transcript, stated
“our AI Engineers don't need to be thinking about like very low-level behaviors like retrying things that have failed”transcript, stated

async-message-orchestration (orchestration)

The support agent is modeled as a state machine that reacts to conversation starts, new customer messages, missing signals, timers, and external state changes.

3 supporting quotes
“building we built AI Agents from a high sort of medium and lowlevel perspective from the high level perspective we architect our AI agents as state machines so in one of our blog posts I made a very simplistic one of like imagine a state machine of you and I talking to each other so you start”transcript, stated
“using all the things that I mentioned earlier that matter right so what input we're getting from the outside world timers signals that things have changed”transcript, stated
“customer and see if their problem has been resolved one way that we've been thinking about this is thinking about handling Fast and Slow Race conditions uh between the AI agent and whatever is on the other side um particularly because even a basic AI agentic workflow that's going to make two or”transcript, stated

observability-tracing (production-operations)

Every agent decision returns events, and completions and costs are logged so the team can observe production behavior and simulation outcomes.

“returning events every time that um every single decision is made”transcript, stated
“quietly log everything that they're doing so that we can track all those completions and costs”transcript, stated

model-routing (model-operations)

The system abstracts providers so engineers can choose models without caring whether they come from Bedrock, Azure, or another source.

“that have failed and so on we're trying to strike that balance between enabling the AI agent the AI agent to use different models uh spread across different providers and to have ai Engineers just say I want to use this model and not care about whether it's coming from Bedrock Azure or um from a”transcript, stated
“just say I want to use this model and not care about whether it's coming from Bedrock Azure or um from a another provider”transcript, stated

rag-retrieval (knowledge)

Gradient Labs uses knowledge retrieval but treats naive RAG as insufficient, emphasizing cleaned, correct, point-in-time knowledge for customer support.

3 supporting quotes
“retrieval augmented generation but we have certainly found that that is barely the tip of the iceberg”transcript, stated
“the quality that you'll achieve from an AI agent that needs to Source information from a knowledge base um is very much tied to the knowledge base itself”transcript, stated
“point in time references suddenly has become really really important”transcript, stated

eval-driven-development (quality)

Gradient Labs evaluates PR versions through thousands of production-grade simulations and manual or automatic review before live deployment.

“run simulations of what the AI agent would do in different scenarios on live uh like production grade traffic”transcript, stated
“run you know thousands of simulations and then go in and either manually or automatically evaluate those simulations”transcript, stated

human-in-the-loop-gate (workflow)

The support framework must know when to hand off to humans and constrain the AI to languages or intents that human agents can support.

“AI agent that is only going to take off uh 70 or 80% of your customer support then for that rest of the 20% uh it's going to need to hand it off to a human support agent and so that means that the AI agent can't talk in languages that it can't hand off the conversation to uh another human so if the”transcript, stated
“the AI agent can't talk in languages that it can't hand off the conversation to uh another human”transcript, stated

guardrails-io-filtering (policy)

Enterprise policy controls restrict languages, conversation closure, timing, channels, and sensitive intents such as fraud.

3 supporting quotes
“different companies uh have different policies with respect to um for example letting the AI agent close out conversations how long it should take them to do it”transcript, stated
“in a bank Maybe they don't want your AI agent to talk to you about fraud”transcript, stated
“at the functional level like set these timers for these values as well as the more like behavioral level like don't talk about these things but do talk about those yeah I'd imagine it gets even more complicated as you get into like really heavily regulated Industries and uh you know you're”transcript, stated

Tradeoffs

Model agent flow as a state machine

Chose State-machine orchestration with deterministic and agentic states over Ad hoc prompt/tool chains.

Rationale: State machines make external inputs, timers, signal changes, and conversation control explicit while keeping high-level flow separate from low-level implementation.

“our AI agent is a state machine that has many more States than this and some of them are deterministic some of them are more agentic”transcript, stated
“whoever is working on this level of the AI agent is not working on anything that happens uh below it”transcript, stated

Keep behavior code between states and raw LLM calls

Chose A readable behavioral layer over Coding directly at state-machine or LLM-call level.

Rationale: Engineers can express what the agent is doing without drowning in orchestration details or raw model-call plumbing.

“you're thinking at a behavioral level of what the AI agent is doing”transcript, stated
“you're not thinking about the state level you're not thinking about the llm call level”transcript, stated

Use durable execution for LLM calls

Chose Temporal-backed LLM execution over Manual retry and failure handling in agent code.

Rationale: Durable execution abstracts low-level retry/failure mechanics away from AI engineers.

“all our llm calls um are being executed with a durable execution engine shout out temporal”transcript, stated
“don't need to be thinking about like very low-level behaviors like retrying things that have failed”transcript, stated

Abstract providers but preserve model choice

Chose Model/provider abstraction across Bedrock, Azure, and other providers over Provider-specific implementation details in agent behavior code.

Rationale: The agent can use different models across providers while engineers request the model they want without caring about source plumbing.

“that have failed and so on we're trying to strike that balance between enabling the AI agent the AI agent to use different models uh spread across different providers and to have ai Engineers just say I want to use this model and not care about whether it's coming from Bedrock Azure or um from a”transcript, stated
“not care about whether it's coming from Bedrock Azure or um from a another provider”transcript, stated

Test directly against production-grade traffic in isolation

Chose PR agent versions in an isolated evaluation environment over Traditional local-dev to staging to live-production path.

Rationale: Production-grade traffic exposes the weird edge cases agents need, while isolation avoids affecting real customers.

“straight into production in an isolated evaluation environment as opposed to a live production environment”transcript, stated
“put it right onto onto production data in a kind of like a safe in a safe way”transcript, stated

Restrict agent behavior by enterprise policy

Chose Functional and behavioral controls for languages, timers, channels, and intents over A universally capable support agent.

Rationale: Enterprise handoff capacity and regulated-topic constraints require the agent to know what it may say and when to escalate.

“do it what different channels they want to support and so on right so it's such a growing thing where like uh companies want to have the dials um and when you enter the more high-risk companies it definitely even goes all the way down to the different intents that customers have so in a bank”transcript, stated
“control the AI agent both at the functional level like set these timers for these values as well as the more like behavioral level”transcript, stated

Gotchas (what bit them)

A new customer message can invalidate work already in progress.

Root cause: Agentic workflows are slower than ordinary API calls, so the outside conversation can change while the agent is still reasoning.

Resolution: Model the interface layer as stateful flow control that can stop work, restart work, or react to missing signals.

3 supporting quotes
“halfway through that the AI the the human customer writes in again”transcript, stated
“all the work that the AI agent has been doing under the hood is now no longer relevant because new information has come in”transcript, stated
“AI agents will invariably be slow that uh leads to a variety of different raise conditions”transcript, stated

An LLM call can fail successfully.

Root cause: The API call can return normally while the completion is low quality or unsuitable.

Resolution: Treat completion quality as a separate failure class from transport/API success.

“making an API call to an llm that successfully completes doesn't mean that it has uh successfully given you some good a good completion back”transcript, stated
“doesn't mean that it has uh successfully given you some good a good completion back so there's this concept of llm calls that fail successfully that you need to manage at the same time um with an AI agent like a customer support one there'll be requirements for it to think about”transcript, stated

Naive vector-database RAG produces poor support outcomes.

Root cause: Internal documents are incomplete, not agent-oriented, and may not distinguish public from private information.

Resolution: Treat knowledge engineering as a production layer with clean, correct, point-in-time references and approaches for missing tacit knowledge.

3 supporting quotes
“throwing it into a vector database is almost like a guaranteed way to reach a bad outcome”transcript, stated
“they don't differentiate between uh information that is public and disclosable to customers or private”transcript, stated
“uh information and in that category I could probably spend an entire talk on it but the short headline is that most information inside of a company resides in people's heads and so never Finds Its way to documentation at all and so there's an entire different approach that we've been adopting”transcript, stated

Approximate retrieval is not enough for high-quality enterprise support.

Root cause: Approximate nearest-neighbor retrieval can return insufficient results when quality matters most.

Resolution: Avoid treating ANN scale optimizations as a substitute for exact, high-quality knowledge access in critical support contexts.

“approximate uh results are almost a you know notoriously insufficient where high quality is of utmost concern”transcript, stated

Live-only knowledge prevents historical debugging.

Root cause: If the knowledge base changes after an interaction, teams cannot reconstruct what the agent knew days earlier.

Resolution: Use point-in-time knowledge references similar to feature-store time travel.

“just having a a knowledge base that stores live knowledge makes it impossible to debug an outcome that happened potentially a few days ago if your knowledge has changed”transcript, stated
“the importance of like point in time references suddenly has become really really important”transcript, stated

Enterprise tool data can change between retrieval and use.

Root cause: Private business systems are live state, not static public-web facts; a fraud status can change after a customer says something else.

Resolution: Reason about returned data validity and state changes when invoking tools inside a company.

“you need to start reasoning about the actual data that you get back”transcript, stated
“you retrieved a customer's uh fraud status and then everything looks fine but then the customer says something else that has triggered the fraud engine to change”transcript, stated

Evaluation

Gradient Labs evaluates agents by spinning up PR versions in isolated production-grade environments, running thousands of simulations over live traffic scenarios, and manually or automatically evaluating outcomes. The evaluation must account for race conditions, private-tool constraints, knowledge versions, model/prompt coupling, language handoff, regulated intents, completions, and cost.

Metrics: Simulation outcomes · Manual simulation review · Automated simulation review · Conversation resolution behavior · Customer reply race conditions · LLM completion quality · Provider rate limits · Tool-call validity · Knowledge point-in-time reproducibility · Completion cost · Language handoff compliance · Intent restriction compliance

3 supporting quotes
“run simulations of what the AI agent would do in different scenarios on live uh like production grade traffic”transcript, stated
“thousands of simulations and then go in and either manually or automatically evaluate those simulations”transcript, stated
“quietly log everything that they're doing so that we can track all those completions and costs”transcript, stated

Outcomes

The source reports a few live partners, hundreds of conversations per day, thousands of PR simulations, two or three LLM calls per basic workflow, 70-80% AI-handled support as an example, and a 10% or less estimate for pure-RAG coverage in large enterprises.

4 supporting quotes
“We've launched ours um a few months ago and we're now running it live with a few companies”transcript, stated
“we are live uh with a few Partners we've been running hundreds of of conversations per day”transcript, stated
“customers uh who find that experience so wonderful that they actually go ahead and thank our AI agent for its service”transcript, stated
“just a rag based agent is going to probably only cut into 10% or less”transcript, stated