No history yet

Agentic Reasoning Patterns

From Prompts to Architectures

An AI agent does more than just respond to a prompt. It operates within a cognitive architecture, a framework that guides how it perceives its environment, makes decisions, and takes action. This moves us beyond single, linear interactions into building systems that can strategize and solve problems on their own.

At the heart of these architectures is a continuous cycle. The agent perceives new information, reasons about what it means and what to do next, acts on that reasoning, and learns from the outcome. This loop is the foundation of autonomous behavior.

The fundamental agentic loop: Perceive → Reason → Plan → Act → Observe. This cycle repeats, allowing the agent to adapt and progress toward its goal.

Reflection and Planning

Two key patterns enable agents to think more deeply: reflection and planning.

Reflection is a form of self-correction. Instead of just producing an output, the agent critiques its own work. It asks questions like, "Is this answer complete?" or "Does this code follow best practices?" and then refines its output based on the critique. This iterative process leads to higher-quality results without needing a human to step in and make corrections.

Planning involves task decomposition. When faced with a complex goal, like "research and summarize the impact of quantum computing on cryptography," an agent breaks it down into smaller, executable subtasks:

  1. Search for articles on quantum computing and cryptography.
  2. Identify the key cryptographic algorithms at risk.
  3. Summarize the principles of Shor's algorithm.
  4. Find information on quantum-resistant algorithms.
  5. Synthesize the findings into a coherent summary.

This plan provides a clear roadmap. The agent's approach to creating this plan can be either static or dynamic.

A static plan is created entirely upfront. It's efficient for predictable tasks where the steps are well-known. However, it's brittle—if an early step fails or returns an unexpected result, the rest of the plan might become invalid.

A dynamic plan is generated one step at a time. The agent completes a task, observes the outcome, and then decides on the next best action. This is more flexible and resilient but can be less efficient, as it requires more reasoning cycles.

Reasoning Workflows

Specific workflows structure how an agent combines reasoning with action. The two most prominent are ReAct and ReWOO.

The ReAct pattern, a portmanteau for Reasoning and Acting, is perhaps the most famous and foundational design in the agentic world.

ReAct (Reasoning and Acting) synergizes thought and action in a tight loop. The agent thinks about what to do, takes a single action (like querying an API), observes the result, and then thinks again based on the new information. It's like a detective who finds a clue, thinks about its implications, and then decides where to look for the next clue.

This interleaving of reasoning and acting makes the agent highly adaptable. It can handle unexpected tool outputs and dynamically change its plan based on real-time feedback.

ReWOO (Reasoning Without Observation) takes a different approach by decoupling reasoning from execution. First, the agent creates a complete plan, outlining all the tools it will need to call and how their outputs will connect. Think of it as a chef writing out a full recipe before starting to cook.

Once the plan is finalized, an executor module takes over and runs all the tool calls. The LLM is not involved in this execution phase. This can be faster and more cost-effective since it minimizes calls to the reasoning engine. The downside is a loss of adaptability; if a tool fails or returns something unexpected, the model can't adjust its plan on the fly.

FeatureReAct (Reasoning + Acting)ReWOO (Reasoning Without Observation)
WorkflowInterleaves thought and actionPlans first, executes second
AdaptabilityHigh (can react to new info)Low (plan is fixed)
EfficiencySlower, more LLM callsFaster, fewer LLM calls
RobustnessMore robust to tool errorsBrittle if a tool fails
Best ForComplex, unpredictable tasksSimple, well-defined tasks

Choosing between these patterns involves a trade-off. ReAct offers flexibility at the cost of efficiency, while ReWOO prioritizes speed and cost for tasks with predictable steps. By understanding these cognitive patterns, you can design agents that don't just answer questions, but can strategize, self-correct, and achieve complex, multi-step goals.

Quiz Questions 1/6

What is the continuous cycle at the heart of an AI agent's cognitive architecture?

Quiz Questions 2/6

An AI agent writes a piece of code, then reviews it for errors and adherence to style guides before finalizing the output. This process is an example of: