A narrow task with real consequences

Repeated “Where is my order?” chats take time from customer-care teams. Automating that lookup still requires checking identity, returning accurate fulfillment details, and recognizing when a person needs to take over. A cancellation, refund, invoice, or sales enquiry should reach the appropriate team with useful context.

I designed and implemented the backend and AI integration for a production agent embedded in Amazon Connect chat. Its remit is verified order-status self-service and structured escalation. My work covered agent tools, event processing, regional configuration, observability, and delivery.

Let the application control access to the facts

An Agno specialist agent uses Claude on Amazon Bedrock to interpret requests and phrase replies. Order ID validation and locale-specific postal checks live in application code. The order tool shapes API responses into customer-safe fields such as fulfillment state, shipping method, and tracking links, excluding personal information from the returned payload.

Order facts come from the live API. The application uses typed Pydantic models and constrained tools; it does not retrieve order answers from a vector database. Prompt-injection checks and custom defensive hooks add protection, but verification and data shaping remain responsibilities of the code. These controls reduce risk without making a blanket claim that model errors are impossible.

A handoff is part of the product

Bare requests for a human take a deterministic route. The model handles more nuanced language, with tools that route out-of-scope requests to Care or Sales. Transfers carry the queue, escalation type, and a reason from a taxonomy of roughly 40 reasons, giving the receiving team and reporting systems an explicit explanation.

Availability comes from the contact center’s Hours of Operation API, with a fallback and a closing-time buffer. Transfer eligibility is captured at chat start. That is a concrete policy boundary: a long conversation can cross a closing time, so the initial availability decision must be understood when evaluating the experience.

Design for a conversation that keeps moving

A lightweight Lambda starts the bot participant, enables SNS chat streaming, stores session information in DynamoDB, and sends a localized greeting. A second, containerized Lambda receives streamed messages, runs the agent and tools, and sends replies or escalation metadata back through the contact-center integration.

Customers can send several messages before a model finishes answering. Message claiming and supersede logic let the worker identify the latest customer turn and suppress stale responses. Concurrency handling belongs alongside the agent logic because even a correct answer can be confusing if it responds to the wrong turn.

Four markets, one implementation

The shipped locales cover the United States, Canada, the United Kingdom, and Ireland. JSON configuration supplies copy, postal rules, business hours, and shipping labels, while shared utilities handle regional verification and wrong-store detection.

These are four English locales, not a claim of multilingual support. Keeping regional differences in configuration lets the shared agent behavior evolve without maintaining four separate implementations.

Make prompt changes inspectable

OpenTelemetry instrumentation sends traces to Langfuse. Routing evaluations use a mocked order API, while corpus extraction, analysis, and replay tools support investigation of production behavior. Logging also flags suspected dead ends, such as a reply that offers human help without an actual transfer or an explanation of availability.

The delivery path combines infrastructure as code, CodeBuild, ECR, and Lambda. A locked Python dependency set makes the heavier AI worker reproducible as a container, while the startup function stays separately packaged. Secrets Manager and scoped IAM keep credentials and permissions outside the conversation.

What shipped, and what the evidence supports

The production system provides verified order lookup and structured handoffs across four markets from one codebase. It demonstrates Python backend engineering, event-driven AWS architecture, AI tool boundaries, concurrency control, API integration, and operational evaluation.

Self-service is intended to reduce repetitive work for human agents. Measured deflection, resolution rates, latency, and cost savings are not available in the project evidence, so I do not attach numerical improvement claims to them.

Explore the related customer-intelligence case study →