Gradient Labs shares their experience building and deploying AI agents for customer support automation in production. While prototyping with LLMs is relatively straightforward, deploying agents to production introduces complex challenges around state management, knowledge integration, tool usage, and handling race conditions. The company developed a state machine-based architecture with durable execution engines to manage these challenges, successfully handling hundreds of conversations per day with high customer satisfaction.
This case study examines Gradient Labs' journey in building and deploying production-grade AI agents for customer support automation. The presentation, given by Neil Laia, CTO and co-founder of Gradient Labs, provides deep insights into the challenges and solutions of running AI agents in production environments.
# Company Background and Use Case
Gradient Labs is a London-based startup that has developed an AI agent focused on automating complex customer support work for enterprises. Their solution particularly targets companies that require high-precision, quality outcomes in their customer interactions. The company has successfully deployed their agent with multiple partners, handling hundreds of conversations daily.
# Key Technical Challenges
The presentation outlines several layers of complexity that emerge when moving from LLM prototypes to production AI agents:
## Interface and Integration Challenges
* Unlike traditional ML systems that operate on simple request-response patterns, AI agents must handle complex race conditions and state management
* The system needs to manage both "fast" and "slow" race conditions between the AI agent and external interfaces
* Agents must be able to handle interrupted workflows and abandoned conversations appropriately
## LLM Integration Complexities
* Managing "successfully failed" LLM calls where the API succeeds but the completion is unsuitable
* Balancing fast, time-bound customer interactions with slower, background tasks like knowledge validation
* Working within rate limits and managing multiple LLM providers
* Dealing with the tight coupling between prompts and specific models
## Knowledge Management
The case study reveals several critical insights about knowledge management:
* Simply importing documentation into a vector database is insufficient for production systems
* Company documentation often contains implicit assumptions and doesn't differentiate between public and private information
* Missing information is a major challenge, as much crucial knowledge exists only in employees' heads
* Point-in-time reference capability is essential for debugging past interactions
* Approximate nearest neighbor searches may be insufficient for high-quality requirements
## Tool Integration Challenges
* Evaluation becomes complex when agents need access to private or sensitive APIs
* Need to handle dynamic data updates during agent operation
* Must maintain security and access controls while allowing necessary tool usage
# Technical Solution
Gradient Labs developed a sophisticated architecture to address these challenges:
## Architecture Overview
* AI agents are implemented as state machines
* Multiple states handle both deterministic and agentic behaviors
* Clear separation between high-level flow control and lower-level implementation details
## Implementation Details
* Custom implementation rather than adopting existing LLM frameworks due to need for deep customization
* Event-based architecture where all decisions generate trackable events
* Durable execution engine (using Temporal) handles low-level concerns like retries
* Abstraction layer for managing multiple LLM providers (Bedrock, Azure, etc.)
* Comprehensive logging and monitoring of all operations
## Testing and Evaluation
* Simulation-based testing using production-grade traffic
* Ability to run thousands of simulations on PR versions of the agent
* Direct testing in production environment but in isolated evaluation mode
* Both manual and automated evaluation of simulation results
## Non-Functional Requirements
* Language support constraints based on human agent availability
* Configurable conversation handling policies
* Industry-specific constraints (e.g., topic restrictions for regulated industries)
* Customizable timing and channel support
# Results and Impact
The system has demonstrated significant success in production:
* Successfully handling hundreds of conversations daily
* Positive customer feedback, with users actively thanking the AI agent
* Ability to handle complex support scenarios beyond simple RAG-based interactions
* Successful deployment with multiple enterprise partners
# Lessons Learned
* Traditional MLOps approaches need significant adaptation for AI agents
* State management and race conditions are more complex than in traditional systems
* Knowledge management requires sophisticated approaches beyond simple RAG
* Industry-specific requirements significantly impact agent design and implementation
* Testing and evaluation require new approaches compared to traditional ML systems
The case study demonstrates that while LLM-based AI agents offer powerful capabilities for customer support automation, successful production deployment requires careful attention to architecture, state management, knowledge integration, and evaluation approaches. Gradient Labs' experience shows that a thoughtful, multi-layered approach to these challenges can result in successful production deployments with high customer satisfaction.
Start your new ML Project today with ZenML Pro
Join 1,000s of members already deploying models with ZenML.