Building Agents? Stop Treating messages[] Like a Database
Stop using messages as your agent's memory. Learn how structured state makes AI agents more reliable, efficient, and production-ready.

Retail operations today are defined by high-stakes, cross-system interactions. Order changes span commerce, OMS, and fulfillment. Returns touch policy, inventory, finance, and customer experience. Merchandising decisions must respond to signals from search, discovery, and conversion layers. In-store teams bridge digital and physical systems in real time, while delivery issues surface in telemetry before they ever reach support queues.
This is the steady-state reality of modern retail: work rarely stays in a single system long enough to be handled cleanly.
Most retail architectures weren’t designed for this kind of cross-domain decision-making at runtime. Coordination logic gets buried in workflows, duplicated across systems, or pushed onto humans. Attempts to simplify often lead to more automation embedded in systems of record, creating brittle logic optimized for the happy path. Surface area scales, but adaptability doesn’t.
The real challenge is orchestration: where coordination logic lives, how it evolves, and how it operates across independent domains in real time.
Agentic orchestration approaches this problem by treating coordination as its own concern. Instead of centralizing logic or forcing systems to know too much about each other, it introduces focused capabilities that collaborate toward an outcome while remaining loosely coupled.
In this article, developed in collaboration with AGNTCY, we explore five recurring retail patterns where this approach consistently fits. Across all five, the aim is the same: reduce coupling, preserve local autonomy, and improve coordination. We’re talking about real patterns, grounded in real retail needs, where humans are already acting as the glue between systems.
Across domains, agentic orchestration tends to emerge when work exhibits the following characteristics:
When a workflow exhibits this shape, adding more automation inside a single system rarely helps. Coordination needs to move up a level.
The five patterns that follow are concrete expressions of this same architectural approach, applied to different parts of the retail value chain. As you read them, the question isn’t “Could agents do this?” It’s “Is coordination already the hard part here?”
Each pattern represents a recurring coordination failure point in retail architectures, places where humans currently compensate for brittle or implicit orchestration.
Problem: Post-purchase inquiries such as order tracking (WISMO), cancellations, returns, and exceptions generate high volume and variability. Workflow-driven support flows struggle to adapt as policies change and edge cases accumulate, leading to inconsistent handling and frequent escalation.
Agentic Approach: A lightweight coordinating agent focuses solely on intent detection and agent discovery. Rather than embedding all logic into a single flow, it dynamically selects the most appropriate specialist agent, such as returns, order modification, or delivery exceptions. Specialists remain narrow in scope, owning a single responsibility, while the coordinating layer stays thin, handling routing, validation, and handoff.
Problem: Return flows are often optimized for operational simplicity rather than business outcomes. Refund-first approaches overlook opportunities to retain revenue or improve satisfaction through exchanges, substitutions, or incentives, largely because evaluating those options requires coordination across systems and policies.
Agentic Approach: A coordinating agent evaluates a return by consulting independent agents responsible for policy compliance, inventory availability, substitution logic, and incentive modeling. These agents operate concurrently, contributing recommendations without needing awareness of one another. A single decision-maker synthesizes the inputs and selects an outcome, keeping coordination separate from execution.
Problem: Product content must continuously adapt to new discovery surfaces, generative search, and shifting shopper behavior. Periodic enrichment pipelines are too slow and rigid to respond effectively.
Agentic Approach: Specialized enrichment agents operate independently, each improving product data for a specific surface or purpose. Changes to product data or performance signals trigger incremental updates, which are written back into shared systems of record. Enrichment becomes continuous, with coordination focused on data flow rather than conversation.
Problem: Marketplace onboarding is slow and difficult to scale due to inconsistent seller data, varying technical maturity, and strict compliance requirements. Manual intervention becomes unavoidable as volume grows.
Agentic Approach: An orchestration agent manages onboarding while enforcing identity, authorization, and policy boundaries across participating agents. Validation, enrichment, and compliance checks are performed only by authorized agents, with permissions enforced at communication and execution boundaries. Sellers and marketplaces each retain control over their responsibilities, only compliant data progresses through the onboarding flow, and coordination and governance become explicit rather than assumed.
Problem: Shipment delays are common, but responses are often slow and generic. Even when delay signals are detected early, deciding what to do requires coordination across carriers, sales channels, regional policies, and communication rules. In most organizations, that coordination happens manually or not at all, resulting in inconsistent customer experiences and unnecessary support load.
Agentic Approach: Each delay is treated as its own incident, with a temporary coordination space created for that shipment. An orchestration agent determines the carrier, channel, and destination, then invites only relevant agents to participate. Once a decision is reached and communication is prepared, the incident is resolved and the session is closed.
The reason they recur has very little to do with AI, and a lot to do with how retail work is structured.
In each case, the underlying challenge is the same. Decisions must be made in motion, across systems that were never designed to coordinate with one another in real time. Policy changes faster than code. Inventory and availability are probabilistic, not static. Exceptions are normal, not rare. And humans are routinely pulled in, not because judgment is required, but because the system has no clean way to coordinate itself.
What changes with agentic orchestration is not the intelligence of individual components, but where coordination lives.
Across the patterns, a consistent architectural shape emerges:
This is why these patterns can be introduced incrementally. They don’t require replacing core platforms or collapsing domains. They sit alongside existing systems, coordinating behavior without absorbing it. Anywhere your architecture relies on humans to bridge systems, interpret state, or recover from brittle flows, the same coordination model is likely already trying to emerge.
The question is no longer whether these systems can be built. It’s whether coordination remains implicit and fragile, or becomes an explicit, evolvable part of the architecture.
Choose a pattern that touches multiple systems but doesn’t require a full replatform to improve. Post-purchase triage, return alternatives, and delivery risk remediation are all good candidates— clear ROI, fast feedback loops, and low risk. These efforts typically sit best with platform or architecture teams, working in close partnership with domain owners, rather than being embedded inside a single product roadmap.
Start by defining:
Then build the lightest version that proves it works and let it grow from there.
In the next piece in the series, we look at post-purchase as a decision system, not a workflow—why coordination breaks down first, and how agentic orchestration changes how triage, returns, and delivery issues are handled behind the scenes.
Stop using messages as your agent's memory. Learn how structured state makes AI agents more reliable, efficient, and production-ready.
Traditional approaches to change management weren’t working before. AI just makes the gaps impossible to ignore.
How smart companies are evolving with agent-powered delivery models, and what it takes to lead in the new era of intelligent services.