Learn › AI Agents: Core Capabilities › Planning and Reasoning Patterns

Planning and Reasoning Patterns

Intermediate 🕐 13 min Lesson 3 of 7
What you'll learn
  • Describe the four main reasoning patterns: CoT, ReAct, Tree of Thoughts, and Reflection
  • Explain why ReAct is the dominant pattern for tool-using agents
  • Match a reasoning pattern to a task given its requirements and constraints

Reasoning Is a Design Choice

It's tempting to treat an agent's reasoning as something that just happens inside the model. In practice, how you prompt the agent to reason — and which pattern you use — has a large effect on output quality, token cost, and failure rate.

These patterns emerged from research published between 2022 and 2024 and are now standard vocabulary for anyone building agents.

Chain-of-Thought (CoT)

Introduced by Wei et al. (2022), chain-of-thought prompting asks the model to generate intermediate reasoning steps before producing its final answer. Instead of jumping from question to conclusion, the model works through the problem in visible steps.

The original paper showed that adding "Let's think step by step" to a prompt significantly improved performance on multi-step math and reasoning tasks. CoT is the foundation all the other patterns build on.

  • Best for — structured reasoning tasks where the intermediate steps are predictable
  • Cost — moderate; more tokens than a direct answer but less than more complex patterns

ReAct (Reasoning + Acting)

ReAct, developed by researchers at Princeton and Google in 2022, interleaves reasoning steps with action steps. The model alternates between "Thought: I need to find the current price of X" and "Action: call the search tool" and "Observation: the result is Y." Each observation updates the agent's reasoning for the next step.

ReAct has become the dominant pattern in production agents because it turns memory-based recall (which hallucinates) into tool-based verification (which checks). It underpins the default agent loop in LangChain, OpenAI Agents SDK, and the Claude Agent SDK.

  • Best for — any agent that uses tools; open-ended tasks where the path isn't known in advance
  • Cost — higher than CoT; generates roughly 2–4x more tokens per step than a no-reasoning baseline

Tree of Thoughts (ToT)

Yao et al. (2023) extended chain-of-thought to explore multiple reasoning paths before committing to one. Instead of a single chain, the model generates several candidate next thoughts, evaluates which is most promising, and continues down that branch — like a chess player thinking several moves ahead.

  • Best for — high-stakes decisions where the cost of a wrong path is high; creative or strategic planning problems
  • Cost — high; requires multiple parallel LLM calls per step, which grows combinatorially on deep trees

Some newer reasoning models (like o1-class models with extended thinking) perform something similar internally, without requiring ToT prompting explicitly.

Reflection

In a reflection pattern, the agent generates an output and then critiques it against explicit criteria before returning it. The critique may be from the same model or a separate "critic" agent. If the output fails the criteria, the agent revises and tries again.

  • Best for — quality-critical outputs: code, long-form writing, structured data extraction
  • Cost — significant; two reflection passes on a 3,000-token output cost the equivalent of 5–6 original generations

A practical recommendation from practitioners: use a different model for the critic than for the generator when possible. The same model that generated an output often misses the same flaws.

Choosing a Pattern

  • Tool-using agent → ReAct (it was designed for this)
  • Structured step-by-step task → CoT
  • High-stakes one-shot decision → Tree of Thoughts (or a model with extended thinking)
  • Quality-critical deliverable → Reflection (but watch the token cost)
Key takeaways
  • Chain-of-thought is the foundation: asking the model to reason step-by-step before answering improves multi-step performance
  • ReAct interleaves thought and action — it replaces memory-based recall with tool-based verification, which is why it dominates production agents
  • Tree of Thoughts explores multiple paths before committing — powerful for high-stakes decisions but expensive due to parallel LLM calls
  • Reflection critiques and revises output — effective for quality, but two passes can cost 5-6x the original generation tokens
Learn more every week Get 5 hand-picked prompts + new AI tools every Monday. Free.