How agents reason
Agentic AI Foundations · Lesson 2 of 20 · 9:12
YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗
Learning with these videos? Subscribe for new courses and exam-style questions.
Subscribe on YouTube (opens in a new tab)In this lesson
Prepare for the Oracle Agentic AI Foundations Associate exam (1Z0-1157-26). In this lesson: chain-of-thought prompting (zero-shot and few-shot), the ReAct pattern of thoughts, actions, and observations, tree-of-thought, and which reasoning pattern fits which task. Includes three original practice questions, with Fairhaven Furniture, a fictional furniture seller, as the example.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
Reasoning over several steps
A Fairhaven customer writes: my sofa arrived with a broken leg, can I get a replacement before Saturday? To answer, the agent must find the order, check the warranty, look for delivery slots, and only then reply. That takes reasoning over several steps, and the way an agent reasons is a pattern that you choose.
Chain of thought
Chain of thought is a prompting technique: you ask the model to show its reasoning step by step before it gives the answer. In zero-shot chain of thought, you simply add an instruction like: let's think step by step. In few-shot chain of thought, you include a few examples whose answers show the steps. Seeing the steps makes the model's logic transparent, and easier to debug when the answer is wrong. But chain of thought does not make the model know more: it reasons only with what it already knows, and it cannot check a single fact against the real world.
ReAct
ReAct stands for reasoning and acting. It interleaves three steps in a loop: a thought, where the model reasons about what to do; an action, where it calls a tool; and an observation, the result that comes back. Then the next thought starts from that observation, so the reasoning stays grounded in real data. In other words, ReAct is chain of thought plus tool use, in a loop. It's the pattern behind most agent frameworks, including the LangChain agents that you build in lesson five.
Here's ReAct on the broken sofa. Thought: I need the order first. Action: the order lookup tool, with the customer's email. Observation: the order was delivered on Monday, with a two year warranty. Thought: damage on delivery is covered, so now I need a slot. Action: the delivery slot tool, before Saturday. Observation: Friday morning is free. And the final answer offers a replacement on Friday morning.
Tree of thought
Tree of thought goes further: instead of following one line of reasoning, the model explores several branches, evaluates them, and keeps the most promising one, like a chess player who considers several moves before playing. It helps with hard problems where the first idea is often wrong, such as planning or puzzles. But every branch costs extra model calls, so it's slower and more expensive.
Which pattern to use
So which pattern should you use? Chain of thought is cheap, but it only works with what the model knows. ReAct grounds every step in tool results, which is why most production agents use it. Tree of thought is for the few tasks that need deliberate search. And whatever the pattern, the loop around it still needs its limits.
Recap
Let's recap. Chain of thought asks the model to show its steps: zero-shot with an instruction, few-shot with examples, but only with what the model already knows. ReAct interleaves thought, action, and observation, so the reasoning stays grounded in real data. Tree of thought explores and evaluates several branches, at a higher cost. And most production agents use ReAct, inside a loop with limits.
Quick checks for this lesson
The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.
Fairhaven’s team asks a model with no tools to work out a delivery date, step by step. The steps look logical, but the date falls on a slot that was already booked. What explains this?
- The prompt needed more few-shot examples
- Chain of thought cannot check real data
- The model reasoned through too many steps
- Zero-shot prompts do not show reasoning
Show the answer
Chain of thought cannot check real data
Chain of thought reasons only with what the model already knows, so it cannot see which slots are booked today. “The prompt needed more few-shot examples” would show the steps better, but examples cannot reveal today's bookings. “The model reasoned through too many steps” is not the cause: with more steps or fewer, the model still has no data. And “Zero-shot prompts do not show reasoning” is wrong: a zero-shot instruction like let's think step by step does show the reasoning.
In a ReAct loop, Fairhaven’s agent has just called the delivery slot tool. Which step comes right after this action?
- A final answer, written right after the call
- A new tool definition from the model
- A new thought, before the call returns
- An observation: the result of the tool
Show the answer
An observation: the result of the tool
After an action comes the observation, the result that the tool returns, and the next thought starts from it. “A final answer, written right after the call” would skip the observation, so the answer could ignore the result. “A new tool definition from the model” is not part of the loop: tool definitions are sent to the model before it starts. And “A new thought, before the call returns” would reason before the result is known, which defeats the purpose of ReAct.
Fairhaven wants the model to draft several delivery plans for a busy day, score each plan, and keep the best one, and it accepts the extra cost. Which reasoning pattern fits?
- Tree of thought, with branches scored
- Zero-shot chain of thought, one line
- Few-shot chain of thought, with examples
- ReAct, one thought per tool result
Show the answer
Tree of thought, with branches scored
Tree of thought explores several branches, evaluates them, and keeps the most promising one, at the cost of extra model calls. “Zero-shot chain of thought, one line” would follow a single line of reasoning, with no comparison between plans. “Few-shot chain of thought, with examples” adds examples, but it still follows one line. And “ReAct, one thought per tool result” is for grounding each step in tool results, not for comparing several full plans.