Volume 13 taught chain-of-thought, tree-of-thoughts, and prompt-level reflection. In Volume 15, reasoning is that same intermediate inference—but now it sits inside an agent loop that can call tools instead of only emitting text. Planning sets the map; reasoning chooses the next legal move given observations.
ReAct (Reason + Act) is the practical glue: a thought, then a tool call, then a new thought. Later, reflection critiques finished attempts. Module 15.2 memory types store the traces that reasoning needs.
Learning Objectives
By the end of this lesson, students should be able to:
- Distinguish prompt-only CoT from tool-augmented agent reasoning.
- Describe the ReAct pattern: Thought → Action → Observation.
- Decide when to reason vs when to call a tool for facts.
- Implement a small ReAct-style loop with OpenAI tool calling.
- Recognize fluent-but-wrong reasoning and ground it with tools.
- Link reasoning traces to memory, reflection, and eval.
Reasoning (in agents) is the model’s intermediate inference used to interpret observations, choose among tools or plan steps, and justify a halt or a final answer. Unlike pure CoT, agent reasoning is expected to ground claims in tool results when facts live outside the weights.
CoT vs Agent Reasoning
| Dimension | Prompt CoT (Vol. 13) | Agent reasoning (Vol. 15) |
|---|---|---|
| Output | Scratchpad + answer | Thoughts + tool calls + answer |
| Grounding | Mostly parametric / prompt context | Observations from tools / RAG |
| Control | One completion | Multi-step loop |
| Failure mode | Wrong chain, still fluent | Same, plus wasted tool calls |
| Fix | Better prompts / self-consistency | Tools, schemas, halt, reflection |
ReAct: Thought → Action → Observation
Do not ask the model to invent order statuses. Ask it to think about which tool to use, call it, then reason over the returned string. Keep user-facing answers short; keep traces in logs (and later in episodic memory).
When to Think vs When to Act
Reason in-weights
- Formatting, tone, summaries
- Logic over already-fetched facts
- Choosing among known options
Call a tool
- Live data (orders, SLAs, prices)
- Math you do not want hallucinated
- Search / RAG / code execution
Stop
- Answer is grounded
- Policy forbids the action
- Need a human (ambiguity/risk)
Strengths
- Improves multi-hop tool use
- Debuggable traces
- Composes with CoT / ToT skills
- Feeds reflection and eval
Tradeoffs
- Tokens and latency
- Leaking scratchpads to users
- Confident wrong chains
- Reasoning instead of retrieving
“Longer reasoning always yields better agent decisions.” Extra tokens can rationalize a bad tool choice. Prefer short, goal-oriented thoughts plus mandatory tool use for external facts. Measure task success, not thought length.
Knowledge Check
- Short Answer: How does agent reasoning differ from Vol. 13 CoT? Answer: It runs in a loop and should ground facts via tools/observations, not only text.
- True/False: ReAct interleaves thoughts with actions and observations. Answer: True.
- Multiple Choice: Live order status should come from: (a) parametric memory only, (b) a tool/API, (c) CSS. Answer: (b).
- Short Answer: What should you do with reasoning traces in production UX? Answer: Log them; show users a concise grounded answer (unless transparency requires more).
- True/False: Planning and reasoning are the same module concept. Answer: False—planning structures the task; reasoning infers the next move.
- Multiple Choice: Fluent wrong chains are fixed mainly by: (a) bigger fonts, (b) tools + halt + eval, (c) dropping JSON. Answer: (b).
- Short Answer: Name the three ReAct beats. Answer: Thought, Action, Observation.
- Short Answer: Which later lecture critiques a finished attempt? Answer: Reflection.
- Multiple Choice: Module 15.2 helps reasoning by storing: (a) CUDA kernels, (b) memory traces/types, (c) CSS themes. Answer: (b).
- True/False: You should invent SLAs if the tool is slow. Answer: False.
Key Takeaways
- Agent reasoning is CoT-plus-tools: infer, act, observe, infer again.
- Use tools for external facts; use thoughts for control and synthesis.
- Keep traces for debug/eval; do not equate verbosity with quality.
- ReAct feeds planning, the agent loop, reflection, and memory.
- Next: memory—what the reasoner is allowed to remember.
Whiteboard: Take a hallucinated SLA answer and rewrite it as a ReAct trace that must call lookup_sla.
Lab: Add a second tool get_tier_for_account. Require the agent to chain both tools before answering.
Recap: Reasoning chooses the next grounded move inside the loop. Continue with Memory.