Agentic AI architecture: an overview

What makes a system agentic, why it sits on top of microservices and cloud native practice, and a map of the themes that matter when you build one: failure, harnesses, context, memory, maturity and integration.

Agentic architecture in 60 seconds

  • What: a system where a model reasons about a goal, plans, and acts through tools, and where the path is chosen at run time rather than written in code.
  • Why it is new: services split up functions. Agents split up decisions. That adds a layer on top of microservices and cloud native practice instead of replacing them.
  • What changes: control flow is open, state becomes a growing context, and failure becomes a fall in decision quality that error counters do not show.
  • What stays: clear boundaries, observability, reliability engineering and platform thinking.
  • Rule of thumb: use the simplest design that works, and add autonomy only as fast as you can measure and govern it.

What makes a system agentic

A system is agentic when a model does three things in a loop. It reasons about a goal, it plans the next step, and it acts by calling tools or other services. After each action it looks at what came back and chooses again. The important word is chooses. The route through the system is not drawn in advance. It is decided at run time, from the goal, the context and the results so far.

That is different from a pipeline with a model inside it. A pipeline that always runs retrieve, then summarise, then reply is a normal workflow, even if every step uses a model. It becomes agentic when the model can skip retrieval, retrieve twice, ask the user a question, or stop early. Most real systems sit on a spectrum between the two, and the orchestration hub shows where common patterns land.

The problem it solves

Some work cannot be written as a fixed flow. Think of an Acme Bank dispute desk. One complaint needs a card statement and a merchant lookup. The next needs a branch visit record and a call with the customer. A hard-coded flow either covers a handful of cases and fails on the rest, or grows into a tangle of branches nobody can read.

A model that can read the situation and pick the next step handles the long tail of cases more gracefully. The price is that you give up some predictability. The rest of this section is about getting the benefit while keeping that price under control.

A new layer on top of services

Agentic systems do not replace services. Agents call services as tools, read from data stores, and publish to queues. Everything you already know about message queues, API gateways and circuit breakers still applies, often with more force, because a model will happily call a failing endpoint ten times.

The themes in this section, grouped around the idea of a decision-making layer above ordinary services.

Read the map from the centre outwards. The first theme asks what changes when decisions become the unit of design. The next asks how such systems fail. The harness and context themes cover how you build the loop and what you put in front of the model. The last two cover how an organisation adopts all this safely and wires it into what it already runs.

The big themes

From services to decisions

Microservices gave teams independent units of functionality. Agents add independent units of judgement. Control flow is no longer fixed, state becomes a context that grows during a run, and failure shows up as worse answers rather than error codes. Principles such as clear boundaries and good observability carry over. The page on microservices to agents develops this.

Failure modes

A weak early choice can spread downstream, retries driven by quality judgements can multiply cost, and dashboards can stay green while answers decay. Because of this, an agentic system needs decision-level tracing, bounded autonomy and fallbacks that do not depend on a model. See failure modes.

Harness evolution

The harness is the structure around the model that runs the loop, validates output and handles errors. Teams have moved from linear chains to explicit graphs, and some now use generated code that runs in a sandbox, where a pass or fail result gives a firm signal. See harness evolution.

Context engineering and its lifecycle

The hardest question is what the model should know right now, for how long, and what it should forget. Context engineering treats that as a design problem: select, inject, compress and expire. Memory tiers sit behind it. See context engineering and context lifecycle.

Enterprise maturity and integration

Organisations do better when they build governance first and widen autonomy in tiers, from controlled tools to structured workflows to experimental autonomy. Integration then comes down to familiar choices: an agent behind an API, an agent as a tool or peer, or an agent on a queue, with security and observability planned from the start. See the enterprise framework and enterprise integration.

How to read this section

If you are short on time, read this page, then the microservices page, then the failure modes page. Those three give you the vocabulary and the main risks.

A worked example

Acme Travel wants an assistant that handles change requests such as "move my Lisbon flight to Friday and keep the same hotel nights". Here is how the same request looks in a fixed flow and in an agentic design.

  • Fixed flow: parse the date, search flights, show options, confirm. It works for the simple case. It fails when the hotel booking has a no-change rule, because no step knows to look.
  • Agentic flow, step 1: the agent reads the request and the booking record, and notes that a hotel is attached.
  • Step 2: it calls the fare service for Friday flights and the hotel service for the cancellation terms, in whichever order it prefers.
  • Step 3: the hotel terms show a penalty after Thursday. The agent drops the cheapest flight and picks one that lands on Thursday, then explains why.
  • Step 4: it asks the customer to confirm, because the fare change costs money, and only then calls the booking service.
  • Result: a change that respects a rule the designers never wrote a branch for, with the reasoning recorded in the trace.

The same freedom could have gone wrong. The agent might have searched fares six times, or booked without asking. Limits on steps and a rule that payments need confirmation are what make the design safe to run.

Building it

A minimal agent loop with step, token and time limits (illustrative) (python)
import time

MAX_STEPS = 8            # hard stop on reasoning steps
MAX_TOKENS = 40_000      # budget for the whole run
MAX_SECONDS = 90         # wall-clock limit

TOOLS = {
    "search_fares": search_fares,       # placeholder service calls
    "hotel_terms": hotel_terms,
    "book_change": book_change,
}
NEEDS_CONFIRMATION = {"book_change"}   # actions with money or side effects

def run_agent(goal: str, confirm) -> str:
    context, tokens, started = [], 0, time.monotonic()
    for step in range(MAX_STEPS):
        if tokens > MAX_TOKENS or time.monotonic() - started > MAX_SECONDS:
            break
        # Placeholder: the model returns either a tool call or a final answer.
        decision = llm.decide(goal=goal, context=context, tools=list(TOOLS))
        tokens += decision["tokens"]

        if decision["type"] == "answer":
            return decision["text"]

        tool = TOOLS.get(decision["tool"])
        if tool is None:
            context.append({"error": "unknown tool"})   # feed back, do not crash
            continue
        if decision["tool"] in NEEDS_CONFIRMATION and not confirm(decision):
            context.append({"note": "user declined"})
            continue

        result = tool(**decision["args"])
        context.append({"tool": decision["tool"], "result": str(result)[:1000]})

    # Limits reached: stop with a safe, honest message.
    return "I could not finish this request. A person will follow up."

llm, the tool functions and the confirmation hook are placeholders. The point is the shape: the model chooses, your code enforces. Limits, tool checks and confirmations all live outside the prompt.

Design decisions

  • Where autonomy starts: decide which choices a model may make and which stay in code. Money movement, deletion and external messages are usually code-gated.
  • Boundaries: keep agents inside the same service boundaries your teams already own. An agent that reaches across many domains widens coupling and blast radius.
  • Harness style: pick a chain, graph or code-based harness by the guarantees you need, not by fashion.
  • Context ownership: decide what the model sees, who curates it, and how long it lives. Treat it as a designed interface.
  • Limits as policy: step counts, budgets and timeouts belong in configuration that platform teams own, not in each prompt.
  • Fallbacks: for every critical path, keep a deterministic route that works when the model is slow, wrong or unavailable.

Measuring it

  • Task success rate: the share of goals completed correctly on a fixed test set, scored by a rubric or a human.
  • Decision quality: on sampled traces, how often the chosen tool or step was the right one.
  • Steps per goal: mean and 95th percentile. A growing tail often means looping.
  • Cost and latency per goal: tokens and elapsed time across all model and tool calls.
  • Fallback and retry rates: a shift in either is an early sign that quality is moving.
  • Baseline gap: compare against a fixed workflow on the same goals, so the extra freedom has to earn its cost.

When to use it, and when not to

SituationGo agentic?Why
Requests vary a lot and the steps depend on findingsYesA model can choose the next step where a fixed flow would need endless branches.
The steps are known and the same every timeNoA plain pipeline is cheaper, faster and easier to test.
A single lookup or classificationNoOne model call, or a router, is enough.
Actions are costly or hard to undoWith careAdd a human checkpoint and tight permissions.
A regulated domain with audit needsWith careStart in the lower maturity tiers and log every decision with its evidence.

Trade-offs

DimensionEffectWhat to do about it
FlexibilityHandles cases nobody planned for.Keep a measured list of supported goals and review misses regularly.
PredictabilityThe same input can take different paths.Use limits, structured output and deterministic fallbacks.
CostSeveral model calls per goal, and the number varies.Budget per goal and watch the 95th percentile.
LatencySteps run in sequence, each adding a model call.Cap steps, run independent calls together and cache what repeats.
Operational loadNew prompts, traces and evaluation sets to maintain.Invest in shared platform tooling rather than per-team solutions.

Compared with the service-only approach

A service-only design is easier to reason about. Each call is cheap, each failure is loud, and each path can be tested. An agentic design is more flexible and harder to predict. Most organisations will run both for a long time, in the same way that older integration styles lived beside microservices for years. Not every feature needs a model in the loop, and the best answer to "should this be an agent" is often "not yet".

What this means for your role

Common mistakes

  • Adding a model to a flow that was already fine, and paying for freedom nobody needed.
  • Judging health by error rates and latency alone, so quality decline goes unseen.
  • Leaving limits to the prompt instead of enforcing them in code.
  • Giving one agent wide access to many services because it is convenient.
  • Treating context as a dumping ground, which raises cost and lowers accuracy.
  • Starting with full autonomy before governance, logging and fallbacks exist.

Further reading

Agentic architecture adds a layer of judgement to systems that already work. Keep the boundaries clear, the limits firm and the quality visible, and add autonomy one measured step at a time.

Search topics

↑↓ to move · Enter to open · Esc to close