Part 02›
✎

06. How Agent System Designs Evolve#

Level: Practitioner · Reading time: 15 min · Exercise: 30 min Prerequisites: The Anatomy of an Agent (the five parts of an agent)

In one sentence: After this chapter you can place any LLM application on a short timeline of system designs, name the failure that pushed designers to the next step, and reuse the infrastructure lessons that keep repeating.

Why this matters#

You join a team. The product has a chatbot written in 2023, a search pipeline added in 2024, and an "agent" someone attached in 2025. Nobody can say why all three exist.

Each piece was a reasonable answer to a problem of its moment. If you do not know the sequence, you will either rebuild a step that was already tried or skip one that is still needed. This chapter gives you the sequence, then the infrastructure lessons that an AI engineer draws from watching three decades of system designs repeat.

The core idea#

A system design changes when the previous design hits a failure it cannot fix. Each generation answers one failure and exposes the next. The old designs do not disappear: a current system contains all of them at once. One model call for the answer, a retrieval step, a loop, a few fixed steps, a context manager and a sandbox.

Figure 1. One current system contains every older design: fixed steps, the loop, retrieval as a tool, all inside a managed context.

flowchart LR
    U["User request"] --> C["Context engineering: what enters the context"]
    C --> P["Fixed pipeline: steps written in advance"]
    P --> L["Agent loop: the model picks the next step"]
    L --> T["Tools in a sandbox; one of them may be retrieval"]
    T -->|"result"| L
    L --> A["Answer to the user"]

Moving down the timeline adds pieces; it does not remove the ones already there.

A short history#

Period Dominant design What you built The failure it exposed
Late 2022 to 2023 Wrapper A prompt and one model call behind an API Confident wrong answers, stale knowledge
2023 RAG stack Search for documents, put them in the prompt, answer Tasks that need several steps and real actions
2023 to 2024 Agent loop Model, tools and a loop, using provider tool calling Cost multiplied by steps, unreliable long runs
2024 Fixed pipeline Three or four hard-coded steps, each a model call Works only for tasks you understood in advance
2024 to 2025 Coding agent and harness A shell, an editor, a sandbox, tests as feedback Context growth in long sessions, safety, environment setup
2025 on Context engineering, sandboxes, protocols Manage what enters the context; isolate the agent; standard tool connections Cost and evaluation at scale, still open

Wrappers. The first useful products were thin: a system prompt, one call, the answer back. They failed on facts the model never learned and on events after its training data ended.

RAG stacks. Retrieval-augmented generation (RAG) fixes that by searching a document index for relevant passages and adding them to the prompt. Search became the part that decided quality, and researchers showed that models use long contexts unevenly, paying less attention to the middle. RAG also could not act: it answers, it does not file tickets.

Agent loops. Tool calling in provider APIs, first shipped by OpenAI in June 2023, and the ReAct pattern (see Chapter 03) turned the model into a component that acts. Autonomy had a price: a twenty-step run costs at least twenty times a single call, more as the history grows, and adds twenty chances to go wrong.

Fixed pipelines. In 2024 the Agentless paper showed that a hard-coded process with a few model calls scored well on real GitHub issues for a fraction of the cost of agent-style planning (Chapter 07 and Chapter 05 develop this). The lesson spread: buy autonomy only where the steps really vary.

Coding agents and harnesses. Giving the model a shell and an editor, running everything in a sandbox (an isolated environment that cannot touch the rest of the machine), and letting tests report success produced the first agents that did hours of useful work. The code around the model, its tools, context rules and stop conditions, became a design object of its own, sometimes called the harness.

Context engineering. Long sessions made the context window the scarce resource. Context engineering is deciding what enters it: compacting old steps, selecting relevant material, loading instructions only when needed. Prompt caching, which lets providers reuse an unchanged prefix at a lower price, made large stable contexts affordable. Sandboxes became hosted products, and the Model Context Protocol (MCP), announced by Anthropic in November 2024, standardized how models reach tools. As of November 2026 these are the working defaults for serious agent systems; evaluation of long runs is still the weak point (Part 03).

What the practitioners say#

Yangqing Jia co-created GoogLeNet at Google, wrote early deep-learning frameworks, and founded Lepton AI, an AI infrastructure company. In his Fall 2025 lecture he tells the history from the infrastructure side. His stated disclaimer: the opinions are his own.

Three of these translate directly to an agent loop, which is a small distributed system:

His infrastructure lesson In an agent
A step can lose a machine Make every step resumable: save the history after each turn so a crash does not restart the task
Interruptible and rerunnable Make side-effecting tools idempotent before you add retries
Token cost can exceed revenue Budget tokens per task from the first prototype, and log them per run

After all the differences he lists, his conclusion is that the old operational wisdom comes back once AI infrastructure turns into a product (46:00). For agents the same holds: the new part is the model. The loop around it is ordinary engineering.

Pitfalls#

  1. Defaulting to the newest design. An agent where two fixed calls would do. Fix: start at the top of the table and move down only when you meet that row's failure.
  2. Designing around today's model limits. Context sizes and prices change every few months. Fix: keep the model behind one interface and keep context logic in one module you can rewrite.
  3. Counting the cost of one call. A twenty-step agent with a growing context costs far more than twenty calls. Fix: log tokens per task from day one.
  4. Building infrastructure where you do not differ. Fix: buy the sandbox and the serving layer; build the tools, the data pipeline and the evaluation.
  5. Treating retrieval as obsolete. Agents made retrieval one tool among several, not unnecessary. Fix: keep the retrieval pipeline accurate; it is where wrong context enters.
  6. Forgetting that runs fail. Fix: checkpoint the run, make side effects idempotent, and give every run a budget (operations).

Try it#

Review one LLM feature, your own or a public one, in one page.

  1. List its components and place each on a row of the timeline.
  2. For each component, name the failure it answers and what breaks if you remove it.
  3. Estimate tokens per task: number of steps times the context size at each step.
  4. Propose one change, forward or backward on the table, and say what it buys.

You are done when: a teammate who has not seen the feature can read your page and say which generation each component belongs to, and what the most expensive step is and why.

Stretch goal: find one component that could move up the table (less autonomy) without hurting results, and measure the cost difference.

Key takeaways#

Self-check#

  1. Which failure of the wrapper design led to RAG, and which failure of RAG led to agent loops?
  2. What did the Agentless result teach designers about autonomy?
  3. Name two problems long coding sessions created that led to context engineering and sandboxes.
  4. According to Jia, why does the consumer application landscape stay fluid, and what should a builder conclude from it?
  5. Why does one failed GPU machine take down a whole training run, while one failed web server does not take down a web service?
  6. Give two practices from Jia's infrastructure lessons that apply to an agent loop.
Show answers 1. Wrappers answered with wrong or stale facts because the model had no access to outside documents. RAG could find documents but could not take actions or carry out multi-step tasks, which the loop provided. 2. A hard-coded process with a few model calls can match agent-style planning on known tasks at much lower cost, so autonomy should be added only where the steps cannot be fixed in advance. 3. Any two of: the history outgrew the context window; each step resent a larger context at higher cost; agents ran arbitrary code that could damage the machine; environments were hard to reproduce. 4. Because base models keep improving, an advantage that rests on the model call alone does not last. Put the effort into the environment, the data and the evaluation. 5. Web servers work independently, so a lost machine loses only its own requests. A distributed training run is one tightly coupled job in which every machine participates at every step, so one loss stops the whole job. 6. Any two of: make steps resumable by saving state; make side effects idempotent before retrying; budget tokens per task; use standard services where the product does not differ.

Sources#

Next#

→ 07. Coding Agents, because coding agents are where every design in this timeline is in use at once.