Planning, Reasoning and Quality Control Terms
~15 min read
The 10 terms covering how an agent figures out what to do, improves through feedback, and stays within acceptable bounds — Planning, ReAct, Reflection, Evaluation, Guardrails and more.
This is the largest cluster in the glossary because it covers everything from 'how does the agent decide what to do next' through to 'how do we keep it from doing something bad.'
Planning is determining the sequence of steps an agent must take to reach its goal — breaking a large objective into an ordered set of smaller actions before (or while) executing them. ReAct is a specific framework where reasoning (thought) and acting (tool use) are combined step by step — rather than planning everything upfront, the agent alternates between thinking about what to do next and actually doing it, using each observation to inform the next thought.
Reflection is the agent's process of self-assessing its actions to improve future performance — after acting, the agent looks back and asks 'did that work, and what should I do differently?' This connects directly to the Feedback loop: a continuous process of collecting outcomes, observing effects, and adjusting actions — reflection is one instance of a feedback loop operating at the level of a single agent's own behavior.
Few-shot learning is teaching an agent new behaviors or tasks with just a few examples — rather than retraining, you show the agent 2-3 examples of the desired input/output pattern directly in its context. ARQ is a newer structured reasoning approach where an agent solves complex, domain-specific problems step by step — a more rigorous, domain-tailored cousin of general chain-of-thought style reasoning.
Evaluation is the process of assessing how well an agent performs against its intended goals — the measurement layer that tells you whether any of the above techniques are actually working.
Rounding out this cluster are the quality-control terms: Guardrails are rules or boundaries that prevent an agent from taking harmful or undesired actions, Guidelines are policies or constraints that keep an agent's behavior aligned with desired outcomes (softer and more advisory than guardrails' hard limits), and Tool call is simply an API invocation made by an agent to perform a specific task — the concrete unit of action that planning, ReAct, and reflection are all ultimately organizing.
💻 Code example
class ReflectiveAgent:
"""Illustrates Planning, ReAct-style step-by-step reasoning,
Reflection, and Guardrails working together."""
def __init__(self, llm, guardrails: list[str]):
self.llm = llm
self.guardrails = guardrails # rules the agent must not violate
def plan(self, goal: str) -> list[str]:
"""Planning: break the goal into an ordered sequence of steps."""
return self.llm.decompose_goal(goal)
def react_step(self, step: str, observation: str) -> dict:
"""ReAct: thought -> tool call (Action), one step at a time."""
thought = self.llm.reason(step, observation)
tool_call = self.llm.decide_tool_call(thought) # a single Tool call
for rule in self.guardrails: # Guardrails check before acting
if self.llm.violates(rule, tool_call):
return {"blocked_by_guardrail": rule}
return {"thought": thought, "tool_call": tool_call}
def reflect(self, step: str, result: str) -> str:
"""Reflection: self-assess the outcome to improve the next step —
one instance of a broader Feedback loop."""
return self.llm.critique(step=step, result=result)
💬 Deep Dive with AI
Key points
- •Planning breaks a goal into ordered steps; ReAct interleaves reasoning ('thought') and acting ('tool use') one step at a time instead
- •Reflection is the agent self-assessing its own actions — one specific instance of a broader Feedback loop
- •Few-shot learning teaches new behavior via a handful of in-context examples, no retraining needed
- •Evaluation measures whether all of the above is actually working against the agent's intended goals
- •Guardrails (hard limits) and Guidelines (softer policies) both keep agent behavior aligned, at different levels of strictness