← Back to Articles
Agentic Architectural Patterns • Part 1

Single Agent Patterns: Reason and Act Loop

Intent

Interleave explicit reasoning with environment actions so that each action is conditioned on an up-to-date interpretation of observations.

Introduction

In autonomous agent design, the core challenge is enabling large language models (LLMs) to interact with external environments dynamically while maintaining a goal-oriented plan. Traditional systems rely either on rigid, hard-coded execution graphs, or unconstrained model completions that fail to adapt to feedback. The Reason and Act (ReAct) Loop resolves this by integrating logical reasoning traces and concrete tools actions in a unified execution flow.

Structure of the Loop

The ReAct loop operates as a stateful cycle managed by an execution harness. The model generates a reasoning trace (a "thought") explaining its plan, followed by a structured action (a "tool call"). The harness intercept and executes this tool, collecting the result (the "observation"), and appends it back to the context window. The loop repeats until the model decides it has reached a terminal answer.

USER PROMPT TERMINAL ANSWER Reason Thought Trace Act Tool Execution Observe Env Response

Originally introduced in the research paper ReAct: Synergizing Reasoning and Acting in Language Models [1], this pattern has become the foundational substrate of contemporary AI agents. Modern implementations have refined this pattern by replacing free-text action parsing with native function-calling interfaces. These interfaces enforce schema-constrained tool calls directly at the model output layer, yielding higher reliability and fewer parsing errors.

Trade-offs

While the ReAct loop provides robust, step-by-step problem-solving capabilities, it comes with important engineering and economic trade-offs:

Maximally Adaptive

Allows the agent to observe intermediate execution outcomes and dynamically adjust its path or recover from tools errors at each step.

Token Cost & Accumulation

The entire conversation history accumulates in the context window with each iteration, driving exponential token usage and higher cost.

Error Compounding

Minor hallucinations or incorrect tool observation parses in early steps compound across subsequent loop runs, leading to drift.

Infinite Wandering

Without strict loop-detection schemas, step budgets, and deterministic stop conditions, agents can enter infinite loops or wander endlessly.

Known Uses

The Reason and Act pattern forms the backbone of several major agent frameworks and benchmarks:

References