/ladder/l1/

L1 · Single Agent

One mind, looping over a task.

How a single agent reasons internally — thought, action, observation, reflection. The unit you'll keep returning to, even inside the bigger systems.

Anatomy

What an L1 agent is made of.

Five parts compose a single agent: input, model, system prompt, tools, and output. The diagram wires them into the Reason → Act → Observe loop; the cards below decompose each part.

SYSTEM PROMPTRole, rules, personaINPUTPerceptionUser query, signalsLLM · THE BRAINReasoncognitive core · maintains world modeldecides: call a tool, or answerOUTPUTFinal answerLoop closesanswerTOOLS · THE HANDSTyped actions — fetch, query, run codeactobserve
  • Input · Perception

    The starting signal.

    Raw input from the user or environment, processed and grounded into structured percepts that the agent's core can reason over.

  • LLM · The Brain

    The cognitive core.

    The Large Language Model carries the reasoning and maintains the agent's internal world model — its picture of what's true so far.

  • System Prompt · Standing Brief

    How it's wired to think.

    Bound tightly to the model. Defines the agent's role, gives operating instructions, and shapes how it plans.

  • Tools · The Hands

    How it acts on the world.

    When reasoning concludes that external information or capability is needed, the model emits a structured tool call. Tools are typed functions — query a database, run code, fetch a page.

  • Output · Feedback

    The loop closes.

    Tool results flow back as observations. The agent evaluates, decides whether to call another tool, and either continues the loop or returns a final answer.

When this rung fits

When is a single agent enough?

A single agent is enough when…
  • Questions are simple and direct.
  • All required tools are equally authorized.
  • No structured flow is required.
…and not enough when
  • Different tasks need different modes of reasoning.
  • Parallel processing is necessary.
  • A human must intervene at certain points.
  • Errors should be localizable to a step.

The Loop

Reason, act, observe — and back to reason.

The loop, in three moments

ReasonDecide next
ActRun a tool
ObserveFeed back

↻  repeat until the task looks done

01

Reason

The model decides what to do next: call a tool, or answer.

02

Act

The harness executes the chosen tool — never the model.

03

Observe

The result is fed back into context. The loop continues.

What it runs on

How an L1 agent reaches the world.

The Tools box in the anatomy is rarely hand-wired. Four L4 operational primitives are the substrate every single agent is already standing on.

  • Function Calling

    Tool Calling · Structured Tool Use

    Tool Integration

    The primitive. The model emits structured JSON; your harness invokes a typed function and returns the result.

    Why for L1Every L1 pattern is built on this — without it, the agent has no way to act.

    See in L4
  • Tool Registry

    Capability Catalog · Function Registry

    Tool Integration

    The catalog. Tools registered centrally alongside schemas, permissions, and versions — the antidote to tool-explosion.

    Why for L1An L1 agent with five tools doesn't need this; with fifty, it can't survive without it.

    See in L4
  • Sandbox Execution

    Isolated runtime · Containerised tools

    Governance

    Where CodeAct actually runs. Untrusted code is confined to a sealed environment so side-effects can't escape.

    Why for L1Without this, CodeAct is a footgun. With it, it's the highest-precision L1 pattern.

    See in L4

Patterns · 7 on this rung

7 reasoning patterns on this rung.

Each card is a recurring architectural answer to a different “how should this agent think?” question. Scan use-when / don’t / trade-off; open one to deep-dive.

Loop reasoning

Plan first

  • Plan-and-Execute

    aka Planner-Executor · Plan then Act · Task Planning

    Open

    An agent first generates a complete plan and then executes the steps sequentially or in a controlled manner.

    Use when
    • The overall goal can be clearly broken down into testable subtasks.
    • Execution needs to be traceable and centrally controllable.
    • Cost or latency matters; you want to minimize LLM calls.
    Don't
    • The environment is highly dynamic and the plan might fundamentally change based on early tool-call results.
    • The task is exploratory and the next step depends on the previous result.
    Trade-off
    Better structure and testability compared to ReAct, but carries the risk of the agent clinging to outdated or unsuitable plans.
    LangGraphCrewAIGoogle ADKMicrosoft Agent Framework+1

    Huang et al. (2024) — Understanding the Planning of LLM Agents: A Survey

  • ReWOO

    aka Reasoning without Observation · Planner-Solver Pattern

    Open

    The agent plans all necessary tool calls upfront, executes them in batch, and uses the aggregated results for the final answer.

    Use when
    • The required tool calls are identifiable at the beginning.
    • LLM calls need to be drastically reduced.
    Don't
    • Tool results branch heavily.
    • Interactive error handling per intermediate step is critical.
    Trade-off
    Significantly lower LLM costs and latency, but at the expense of adaptability during execution.
    LangGraphGoogle ADKOpenAI Agents SDK

    Xu et al. (2023) — ReWOO: Decoupling Reasoning from Observations

Self-improvement

  • Reflexion

    aka Self-Reflection · Self-Critique · Reflection Loop

    Open

    The agent critically evaluates its own intermediate results and uses this feedback to improve the next steps or output in iterative loops.

    Use when
    • Result quality takes precedence over minimal latency.
    • Errors can be identified by the model through targeted self-critique.
    Don't
    • The model's self-assessment is unreliable.
    • Hard external validations exist.
    • Latency and costs are strictly limited.
    Trade-off
    Leads to higher result quality, but incurs additional token costs and can lead to false confidence.
    LangGraphAutoGen / AG2Microsoft Agent FrameworkGoogle ADK+1

    Shinn et al. (2023) — Reflexion: Language Agents with Verbal Reinforcement Learning

Search / sample

  • Tree of Thoughts

    aka ToT · Branching Reasoning · Search over Thoughts

    Open

    The agent explores multiple reasoning paths simultaneously like a tree diagram and selects promising paths to pursue while discarding dead ends.

    Use when
    • The problem has multiple plausible solution paths.
    • Early decisions have high cascading effects.
    • The search space can be meaningfully evaluated by the LLM.
    Don't
    • The task is linear or directly solvable.
    • Costs and latency must remain low.
    Trade-off
    Enables a much broader and deeper exploration of the solution space, but leads to exponentially increasing computational and token overhead.
    LangGraphAutoGen / AG2Google ADK

    Yao et al. (2023) — Tree of Thoughts

  • Self-Consistency

    aka Majority Reasoning · Sample-and-Vote · Consensus Sampling

    Open

    The system generates multiple independent reasoning outputs for the same prompt, and then merges the results via consensus or voting for a final answer.

    Use when
    • The stochastic diversity of models should be leveraged.
    • The result must be robust against individual logic errors in single runs.
    Don't
    • The task can be deterministically validated anyway.
    • The cost per request is strictly limited.
    Trade-off
    Significantly more robust answers against false paths, paid for by multiple inference costs.
    Google ADKLangGraphMicrosoft Agent FrameworkAnthropic Cookbook

    Wang et al. (2022) — Self-Consistency Improves Chain-of-Thought Reasoning

Code as action

  • CodeAct

    aka Code-as-Action · Programmatic Action · Executable Reasoning

    Open

    The agent uses executable code rather than pure text as its primary medium for action and reasoning — it writes code, runs it in a sandbox, observes the typed result, and iterates, so a computation is executed rather than approximated in prose.

    Use when
    • Calculations, data transformations, or complex tool calls must be precisely executable.
    • The result should be reproducible.
    • Multi-step logic composes more cleanly as one program than as a chain of separate tool calls.
    Don't
    • Code execution cannot be safely isolated in a sandbox.
    • The task is purely linguistic.
    • The overhead of a code runtime outweighs a single direct tool call.
    Trade-off
    Maximum precision and reproducibility oppose a high sandbox, security, and runtime overhead.
    OpenAI Agents SDKAutoGen / AG2Microsoft Agent FrameworkLangGraph+1

    Wang et al. (2024) — Executable Code Actions Elicit Better LLM Agents

Pattern racer

Race two L1 patterns side-by-side.

0.0s
Single Agent

ReAct

Think → Act → Observe. Repeat.

  1. ThoughtI need three populations. I'll search for them one at a time.
  2. Actionsearch("Berlin population 2025")
  3. Observation3.85M
  4. ThoughtGood. Now Hamburg.
  5. Actionsearch("Hamburg population 2025")
  6. Observation1.91M
  7. ThoughtOne more. Munich.
  8. Actionsearch("Munich population 2025")
  9. Observation1.51M
  10. Answer~7.27M combined.
9 LLM calls3 tool callsAdaptive per step
Single Agent

Plan-and-Execute

Plan once. Execute the list.

  1. Plan1. search(Berlin)
    2. search(Hamburg)
    3. search(Munich)
    4. sum results
  2. Step 1search("Berlin population 2025") → 3.85M
  3. Step 2search("Hamburg population 2025") → 1.91M
  4. Step 3search("Munich population 2025") → 1.51M
  5. Step 4sum(3.85, 1.91, 1.51) → 7.27M
  6. Answer~7.27M combined.
2 LLM calls3 tool callsBrittle if plan drifts

Same answer. Different shapes. ReAct paid for adaptivity with extra reasoning calls. Plan-and-Execute paid for cost savings with a plan that couldn’t react if a search came back empty. Both are right — for different tasks.

Anti-patterns

Ways this rung goes wrong.

  • #04

    Tool Explosion

    SymptomTool selection accuracy collapses. The model hallucinates calls and parameter names.

    FixLeast privilege per role. Gate large catalogues behind a Tool Registry plus capability routing.

  • #08

    Unbounded Loop

    SymptomAn L1 agent stuck in unproductive infinite cycles due to flawed reasoning, with no programmed recursion limit or step budget.

    FixSet a hard recursion_limit and a step budget at the harness level. Add a Reflexion gate or a tool-call counter to break runaway loops.

  • #02

    Hidden State in Prompts

    SymptomBehaviour drifts over long conversations. Bugs reproduce only intermittently.

    FixPydantic v2 state at every node boundary. Forbid extra attributes. State belongs in code.

Frameworks

What you build this on.

LangGraphpython
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI

model = ChatOpenAI(model="gpt-4o")
graph = create_react_agent(
    model,
    tools=[web_search, fetch_page],
    prompt="Answer with tool-use.",
)

# Built-in loop: model -> tools -> model -> ... -> END
# `recursion_limit` is your guard against runaway loops.
result = graph.invoke(
    {"messages": [("user", query)]},
    config={"recursion_limit": 10},
)

Deep dive

Reason, act, observe — repeat.

An L1 agent is a while loop around an LLM. Each turn it reasons about the goal, calls a tool, reads the result, and decides whether to stop or keep going. The canonical articulation of this loop is the ReAct pattern: the model thinks about the current state, picks a tool to call (or answers), the harness executes the tool, and the result is fed back into context as an observation for the next turn.

The loop ends when the model decides it has enough information to answer, or when the harness enforces a stop — a step budget, a token ceiling, a wall-clock deadline. The harness, not the model, runs the tools and counts the budget; this separation is what makes the loop analyzable. The model can hallucinate a tool call, but it cannot hallucinate a successful execution.

You outgrow L1 when one agent's prompt is doing two jobs — when the same system message asks the model to plan, execute, and judge inside one context window. At that point the natural move is to L2 (decompose into a workflow) or L3 (split the jobs across specialist agents). The decision rests on whether the structure is knowable in code (L2) or has to be negotiated at runtime (L3).

When to climb

When one loop isn't enough, wire the flow.

The moment you can sketch the control flow on a whiteboard — fixed branches, predictable shape, failures that should localise to a step — you've outgrown a single adaptive loop. That's L2: structure in code, the model filling the slots.

Climb to L2 — Workflows

References

Where this rung was first written down.

The L1–L4 ladder is a didactic construct of this project — a way to sequence the catalog, not an external model. Its workflow-vs-agent seam (L2↔L3) follows Anthropic's Building Effective Agents (2024); each rung's patterns carry their own primary references.

Search

Search patterns, frameworks, and pages.