Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

Choosing Reasoning Patterns for Problem Solving

Introduction

In our last lesson, we established the fundamental mechanism of agentic action: how an agent uses a structured data protocol to request the execution of an external tool. You now understand that the LLM decides on an action, and the orchestration layer executes it.

However, a single tool call is just one step. Complex problems, like the underwriting analysis or research synthesis you're interested in, require a sequence of steps—a plan. This brings us to a crucial architectural question: how does an agent formulate and execute a multi-step plan?

This lesson addresses that question. Our learning outcome is to be able to select appropriate reasoning patterns (e.g., ReAct, Chain-of-Thought, Reflection) for given problem types. These patterns are the cognitive frameworks that enable an agent to decompose a complex goal into a sequence of thoughts and actions. Mastering them is essential for designing effective, reliable, and cost-efficient agentic systems.

From Static Prompts to Dynamic Reasoning

First, let's formalize what a "reasoning pattern" is. In a conventional LLM application, you provide a static prompt and receive a single output. Reasoning patterns, by contrast, are inference-time frameworks that orchestrate an iterative process. At each step, the agent might generate an intermediate thought, call a tool, and then incorporate the result into its next decision.

This approach is a form of test-time scaling—a set of techniques that improve the performance of a pre-trained LLM by using more computation at inference time to structure its reasoning process. Instead of just asking for an answer, you're asking the model to "show its work."

The Cost of Dynamic Reasoning: Demystifying AI Agents and Test-Time Scaling

To start with a rigorous definition, let's turn to the paper 'The Cost of Dynamic Reasoning'. It clearly defines AI agents and contrasts their dynamic, multi-step nature with conventional LLM use.

Please read sections II-A ('Definition of AI Agents') and II-C ('Test-Time Scaling in AI Agents'). Focus on the distinction between a 'static input-output mapping' and the 'dynamic' coordination of multiple model invocations and tool interactions that defines an agent.

A Taxonomy of Core Reasoning Patterns

While many patterns exist, we will focus on a few foundational ones that form the building blocks for more complex agent designs. The paper you just read provides a helpful classification in its Table I, which we will use as a guide.

1. Chain-of-Thought (CoT): Structuring Internal Reasoning

Chain-of-Thought is the simplest and most fundamental reasoning pattern. It prompts the LLM to break down a problem into a sequence of intermediate, logical steps before arriving at a final conclusion. It doesn't use external tools; its entire purpose is to make the model's internal reasoning process more explicit and reliable.

  • Core Concept: Sequential, step-by-step logical deduction.
  • Analogy: A financial analyst writing out each step of a valuation calculation, rather than just stating the final number. This reduces errors and makes the process auditable.
  • When to Use: Problems that can be solved with information already known to the model and benefit from structured, step-by-step logic. This includes math problems, logic puzzles, and summarizing complex text.

AI Agents 3 - Agentic Design Patterns

To see how CoT works in practice, this lecture from Prof. Ghassemi provides a clear, concrete example. It shows how a single user query is decomposed into multiple, sequential LLM calls to implement the CoT pattern.

Watch the segment from 00:13:54 to 00:19:54. Pay close attention to how the input to each successive LLM call includes the output from the previous step, forming a 'chain' of reasoning.

The AWS blog post on agentic patterns in finance maps this concept to a Workflow Pattern, which is ideal for processes with clear dependencies and a required information flow, such as AML/KYC compliance or claims adjudication.

2. ReAct (Reason + Act): The Workhorse of Agentic AI

ReAct is arguably the most important pattern for building capable agents. It extends CoT by interleaving reasoning steps (Thoughts) with actions that interact with the external world (Actions, i.e., tool use). The agent observes the outcome of its action and uses that new information to inform its next thought.

  • Core Concept: An iterative loop of Thought -> Act -> Observation -> Thought...
  • Analogy: A consultant tasked with a market analysis. They don't know all the answers upfront. Their process is:
    1. Thought: "I need to understand the current market size."
    2. Act: Query a market research database (tool use).
    3. Observation: Receive the market size data.
    4. Thought: "Given this size, who are the key competitors? I need to find a list."
    5. Act: Perform a web search (tool use).
      ...and so on, until the final report is complete.
  • When to Use: Almost any task that requires gathering information or taking actions in an external environment to solve a problem. This is the default pattern for research, planning, and interacting with APIs.
ReAct vs. Reflexion Agentic Reasoning Patterns
This diagram shows the core loop of the ReAct pattern on the left: the agent observes, reasons about what to do next, and then acts. This action-oriented cycle is fundamental to how agents interact with their environment.

The Cost of Dynamic Reasoning: Demystifying AI Agents and Test-Time Scaling

The 'Cost of Dynamic Reasoning' paper formally defines ReAct and contrasts it with other patterns. This will solidify your understanding of its structure.

Review the bullet points under the 'AI agent workflows' heading in Section III, specifically the descriptions for 'Tool use' and how the ReAct agent operates (Figure 3b). Note that ReAct is the first pattern in this list that explicitly incorporates tool use.

3. Reflection: Self-Critique for Higher Quality

While ReAct is powerful, it can sometimes get stuck in a loop or produce a suboptimal result. The Reflection pattern adds a layer of self-evaluation. After generating a plan or completing a task, a "critic" component (often another LLM call with a specific prompt) assesses the work against the initial goal and a set of quality criteria. This evaluation provides feedback to the original agent, which then refines its output.

  • Core Concept: An iterative cycle of Attempt -> Evaluate -> Refine.
  • Analogy: The legal principle of a two-person integrity rule. One lawyer drafts a document (the "actor"), and a second lawyer reviews it for errors and omissions (the "reflector"). The first lawyer then incorporates the feedback to produce a more robust final version.
  • When to Use: Complex tasks where the first draft is unlikely to be perfect and quality is paramount. This includes code generation, writing long-form reports, or generating complex financial models. The trade-off is higher accuracy for increased latency and cost.

The diagram above also illustrates the Reflexion pattern (right side), showing its meta-cognitive loop of Reason -> Improve -> Reflect. The AWS blog refers to this as a Loop Pattern, where iterative cycles allow the system to self-improve until a quality threshold is met, useful for optimizing trading strategies or credit scoring models.

Master ALL 20 Agentic AI Design Patterns [Complete Course]

For a clear visualization of the Reflection pattern, let's watch a segment from Mark Kashef's overview of agentic design patterns.

Watch the section on 'Reflection' from 00:13:16 to 00:15:45. Notice the distinct 'Critic Agent' that applies a quality rubric and provides structured feedback to the generating agent.

A Framework for Selecting the Right Pattern

As an architect, your role is to choose the right tool for the job. The choice of reasoning pattern is a critical trade-off between task performance, cost, and latency.

Comparing AI Agent Reasoning Patterns
This table provides a structured comparison of different reasoning paradigms. Note the distinctions in core concepts, adaptability, and primary applications. For example, CoT is linear and excels at step-by-step problems, while more advanced patterns like Graph-Based Reasoning (which we will touch on in multi-agent systems) are suited for complex interconnected tasks like financial analysis.

Here is a decision framework to guide your selection:

If your problem is... Start with this pattern... Because... Example Use Case
Simple and requires logical deduction without external data. Chain-of-Thought (CoT) It improves the reliability of the LLM's internal reasoning with minimal overhead. "Calculate the compound annual growth rate given these three yearly revenue figures."
Complex and requires up-to-date information or interaction with external systems. ReAct (Reason+Act) It's the standard for dynamically planning and executing a sequence of tool calls based on intermediate results. "Research and summarize the latest analyst ratings for HSBC."
Generative, where the output quality must be very high and iterative refinement is acceptable. Reflection It introduces a self-correction loop that significantly improves the quality and accuracy of the final output, at the cost of time. "Generate a Python script to backtest a moving average crossover trading strategy."
Highly structured with a predefined, linear sequence of tasks. Workflow (CoT-based) It provides a methodical, auditable progression where each step must be completed before the next, ensuring compliance and rigor. Automating an insurance claims adjudication process from FNOL to settlement.

The academic paper LINK quantifies these trade-offs. Its analysis in Figure 13 (Section V-A) shows that as you move from simpler patterns (like ReAct) to more complex ones (like Reflexion and Tree Search), accuracy generally increases, but so does latency, often with diminishing returns. For a business executive, this is a familiar Pareto frontier analysis: you must decide how much you're willing to pay in cost and time for marginal gains in accuracy.

Conclusion

You now have a framework for thinking about and selecting the appropriate reasoning pattern for an AI agent. This moves you beyond simply enabling tool use to architecting how an agent thinks.

Key Takeaways:

  • Reasoning patterns are structured, iterative methods for problem decomposition that improve an LLM's performance at inference time.
  • Chain-of-Thought (CoT) is for structured internal reasoning without external tools.
  • ReAct is the fundamental pattern for dynamic tasks that require interleaving thought and action (tool use).
  • Reflection adds a self-critique loop to improve the quality of complex or creative outputs.
  • The choice of pattern is a critical architectural decision, balancing task complexity, required accuracy, and acceptable cost and latency.

Preview of the Next Lesson:

We've focused on how a single agent can formulate a plan. But some problems are too large or complex for any single agent, no matter how sophisticated its reasoning pattern. What if you need to model the interactions between different departments in your bank—underwriting, risk, and compliance? This requires a team of agents.

In our next lesson, we will explore multi-agent architectures. We will examine patterns like hierarchical and collaborative systems, where specialized agents work together to achieve a common goal. This will directly build on some of the more advanced graph and swarm patterns mentioned in today's resources.

Can't find a good explanation? Sign up and we'll make it for you

Sign up