Back to Writing

Agents

AI Agent Architecture in Practice: AWS vs Azure

How to choose between single-agent, multi-agent and voice architectures, with AWS and Azure reference patterns, production trade-offs, evals and cost.

12 min read

Key takeaways

  • Choose single-agent for narrow low-latency tasks, multi-agent only when subtasks are genuinely independent, and voice architectures when latency budgets drop under a second.
  • Every multi-agent handoff re-serializes context, multiplying token spend, latency, and debugging surface on the same task.
  • AWS favors composable primitives you own and instrument; Azure's AI Foundry Agent Service bundles state and tools for a faster but more coupled path to production.
  • Track cost per successful task, trace coverage, eval pass rates on real traffic, retry cascades, and p95 latency to decide whether to patch or re-architect.
  • Regulated workflows need a constrained single-agent with deterministic tool boundaries, human approval gates, and end-to-end audit logging.

The right AI agent architecture in practice is decided by your workload, not by a diagram: single-agent for narrow, low-latency tasks; multi-agent when orchestration across distinct roles beats a bloated prompt; voice when latency budgets drop under a second. This framework maps each choice to AWS and Azure reference patterns, then weighs the production trade-offs that break demos: token cost, tracing, evals, and reliability under real traffic.

What does agent architecture in AI actually mean in production terms?

Agent architecture is the full production system around the model: orchestration of tools and steps, retrieval, tracing, evals, guardrails, and cost controls. The agent loop is one component. When founders say their product "works in demos," they usually mean the loop works. Everything else is missing or hand-rolled.

The demo-to-production gap, concretely

Demos break under real traffic in predictable places: retrieval returns stale or wrong chunks, a tool call times out mid-loop, token spend per session is untracked, and nobody can reconstruct why the agent did what it did. Evals that passed on 20 hand-picked cases say nothing about a weekend of real users. The failure is architectural, not a prompt bug.

The five components every production agent needs

AWS's own reference pattern for agents reflects this: orchestration, knowledge bases (retrieval), action groups (tools), memory, and guardrails, as documented in the Amazon Bedrock Agents documentation. Map your system against those five plus tracing and evals. Anything you cannot point to is where your demo will break first. I walk through this audit with teams on my about page.

When is a single-agent architecture better than an AI multi-agent architecture?

Start with the workload. If one model call chain can complete the task with tool calls and retrieval, a single agent wins: fewer hops, smaller token bill, one trace to debug. Multi-agent setups earn their cost only when the task genuinely decomposes into independent subtasks with different tools, contexts, or latency budgets, such as research plus drafting plus review.

Cost and latency math

Every agent handoff re-serializes context, so a three-agent pipeline can spend 2-4x the tokens of a single agent on the same task (illustrative, not measured). Latency compounds the same way: each hop adds queueing, a fresh inference call, and orchestration overhead. If your latency budget is under ~10 seconds end to end, that usually rules out deep chains.

FactorSingle agentMulti-agent
Token bill per taskBaselineMultiplied by handoffs
LatencyOne inference chainSerial hops, hard to parallelize
Debugging surfaceOne traceCross-agent traces, unclear ownership
Fits whenSequential tool useParallelizable, separable subtasks

Failure modes multi-agent adds

Multi-agent systems fail in ways single agents cannot: an upstream agent hands off malformed state, a subagent loops retrying a task the orchestrator already marked done, and evals stop telling you which agent regressed. Before adding an agent, ask whether a better prompt, a retrieval tweak, or one more tool call solves it. If you are weighing this against hiring help, the breakdown of fractional-CTO and AI-engineering options on my blog covers who fits which stage.

How do AWS and Azure reference architectures for AI agents differ?

AWS pattern in one paragraph

AWS pushes you toward composable primitives: Bedrock Agents handles the agent loop and tool invocation, while Step Functions orchestrates multi-step workflows that outlive a single LLM call. Identity runs through IAM roles per agent and per tool, which is clean if your team already thinks in IAM policies. Observability means wiring Bedrock invocation logs plus Step Functions execution history into CloudWatch, then building your own tracing and eval layers on top. The trade-off: more assembly, but each piece is swappable.

Azure pattern in one paragraph

Azure's managed path is the Azure AI Foundry Agent Service, which bundles agent state, tool calling, and thread management into one service, with Logic Apps and API Management handling enterprise integration and gateway concerns. Microsoft's own documentation on Azure AI Foundry Agent Service architecture describes agents as hosted, stateful threads that call tools and connectors directly, so you write less orchestration code than the AWS pattern demands. The cost is tighter coupling to the Azure surface: retrieval, threads, and identity lean on Microsoft-managed components rather than pieces you own.

Side-by-side selection criteria

The honest framing: neither pattern decides reliability for you. On AWS you own more of the orchestration graph, so tracing and evals are yours to build but also yours to instrument precisely. On Azure the managed agent service shortens time to production, but your token bill and evals sit inside a platform whose internals you see less of. Pick AWS when your team wants explicit control over every step and can staff the glue work; pick Azure when you are already on Entra ID and Microsoft 365 and want the shortest path to a working agent. In practice the deciding factor is staffing: AWS assumes an engineer who enjoys IAM policies and Step Functions state machines, while Azure assumes a team that would rather the platform hold the state. If neither fits cleanly, my work with founders starts from your workload characteristics, not a vendor default.

What does an enterprise AI agent architecture need beyond the agent loop?

The agent loop is maybe 20% of a production system. The rest is the plumbing that keeps it reliable when real users hit it: access control, audit trails, human-in-the-loop gates, and pipelines that tell you why a call failed. If your demo has none of these, you have a demo, not an architecture. This is the gap I work on at Federico Molina.

Tracing and evals as first-class components

Trace every LLM call, retrieval hit, and tool invocation with a run ID you can query later. Without traces, a regression report like "answers got worse after Tuesday" is undebuggable. Evals belong in CI: replay real traffic snapshots against prompt or model changes, and gate deploys on score deltas. Token cost per trace is also your unit economics dashboard, not a nice-to-have.

Governance and audit requirements

RBAC on tools and data sources, not just on the chat UI. An agent that can query production databases needs per-role permissions enforced at the tool layer. Log every action an agent takes, with inputs and outputs, in an append-only store. For high-risk steps, insert a human approval gate that blocks execution until someone signs off. Design these before your first enterprise buyer asks, because retrofitting audit trails onto a live agent is weeks of work.

How should you architect an AI voice agent differently from a text agent?

Voice agents invert the constraint: a text agent can take 8 seconds to answer, but callers hang up around 1 second of silence. That latency budget drives every architectural choice.

Latency budget breakdown

Split the second: streaming ASR (~200-300ms), LLM first token (~300-500ms), TTS start (~150-200ms). Nothing can be batch. You need partial transcripts, sentence-level turn-taking, and barge-in handling so callers can interrupt mid-response without the agent talking over them. Long-running, stateful voice turns need explicit state management rather than ad-hoc loops.

Pipeline vs speech-to-speech

The cascaded pipeline (ASR → LLM → TTS) gives you traceable transcripts, evals at each stage, and model swapping, at the cost of compounding latency. Speech-to-speech models cut round-trip latency and preserve tone, but you lose the intermediate text that makes tracing and evals possible. Telephony adds another trade-off: SIP/WebSocket integration buys audio quality and reliability but pulls you into carrier-side jitter and codec issues a text agent never faces. If your production gap is voice-specific, this is where fractional AI engineering support usually starts.

What is the best AI agent architecture for regulated or high-stakes workflows?

For regulated workflows, the best AI agent architecture is a constrained single-agent with deterministic tool boundaries, human approval gates on irreversible actions, and full audit logging. Multi-agent autonomy is hard to certify because each extra agent adds non-deterministic paths you cannot fully enumerate for an auditor or regulator.

Constraining autonomy

Keep the agent loop narrow: a fixed tool list, schema-validated inputs, and allowlists for what each tool may touch. Route state-changing actions through an approval gate where a human confirms before execution. Treat model output as a proposal, never a side effect.

Evidence for audit

Log every prompt, retrieval call, tool invocation, and approval decision with trace IDs so you can reconstruct any run end to end. Wire evals against the actions the agent took, not just its text, so reliability claims rest on recorded behavior. This is the same tracing discipline unregulated products need; regulation just makes it non-optional.

How do you evaluate whether your current agent architecture will scale?

Five metrics to check this week

Cost per successful task. Divide your monthly token bill by the number of tasks that actually completed correctly. A demo that costs $0.40 per run and succeeds 60% of the time costs more per success than a $1.20 run that succeeds 95%.

Trace coverage. If you can't reconstruct a failed run end to end (retrieval hits, tool calls, retries), you can't debug it. Instrument every span with OpenTelemetry before touching architecture.

Eval pass rates on real traffic. Offline test sets flatter your agent. Sample live runs weekly and score them against the same evals.

Retry and fallback behavior. Count how often a failure cascades: retry loops on flaky tools, fallbacks that mask broken retrieval.

Latency tail, not average. p95 latency is what real users feel.

Re-architect or patch?

Patch when the failure is localized: a bad prompt, one unreliable tool, a retrieval miss. Re-architect when cost per successful task climbs with traffic, or when adding a feature breaks two others. Treat this as a workload-level design decision, not a prompt fix. If two or more of the five metrics degrade as volume grows, the orchestration layer, not the prompts, is the problem.

Who can help you implement this without a senior AI hire?

Options compared on the same criteria

Apply the same test you used for cloud patterns: cost, reliability under real traffic, and how fast you can trace and eval failures. Marketplaces like Upwork, Toptal, A.Team, and Catalant supply individual contractors or teams, so you still hold the architectural decisions. A fractional CTO and my own practice sell ongoing judgment, not hours of implementation.

Where a fractional CTO fits — and where it doesn't

A fractional engagement fits when you need someone to own the architecture decisions, set up evals and tracing, and cut the token bill while your existing engineers build. It does not fit when you need full-time hands shipping features daily, or a large build-out better served by a hired team from a marketplace.

FAQ

How much does it cost to run an AI agent in production per user?

There is no fixed number; cost per user depends on token bill per task and success rate. Track cost per successful task instead of cost per run: a $0.40 run that succeeds 60% of the time costs more per success than a $1.20 run that succeeds 95%. Multi-agent handoffs multiply token spend because each hop re-serializes context.

Do I need a multi-agent system or is one agent with good tools enough?

One agent with good tools is enough for most workloads. Multi-agent earns its cost only when the task decomposes into independent subtasks with different tools, contexts, or latency budgets. Before adding an agent, ask whether a better prompt, a retrieval tweak, or one more tool call solves it. Every handoff adds tokens, latency, and debugging surface.

Can I switch my agent from AWS to Azure later without a rewrite?

Not without rework. The two patterns differ structurally: AWS composes Bedrock Agents, Step Functions, and IAM roles you own, while Azure's AI Foundry Agent Service bundles state, threads, and tool calling into a managed service. Your agent loop logic ports more easily than your orchestration, identity, and tracing layers, which are coupled to each platform.

What latency is acceptable for a voice AI agent?

Voice budgets are the tightest of any agent architecture. Conversational turn-taking breaks down once end-to-end latency pushes past roughly a second, which rules out deep multi-agent chains and serial hops. Prefer a single agent with a narrow tool list, and budget for queueing plus inference on every hop, not just model response time.

How do I add evals to an agent that is already live?

Start by sampling live runs weekly and scoring them against a fixed eval set, since offline tests flatter your agent. Instrument every LLM call, retrieval hit, and tool invocation with trace IDs so failures are reconstructable. Then move evals into CI: replay real traffic snapshots against prompt or model changes and gate deploys on score deltas.

Got an AI system that works in the demo but not in production?

Book a call