Introduction to Reasoning › What Is Chain-of-Thought Prompting?

Michael BrenndoerferJune 21, 20252 min read
AI Agent HandbookAll chapters
Part 4 of 15Reasoning - Teaching the Agent to Think
Chapter 9Introduction to Reasoning › What Is Chain-of-Thought Prompting?
Reading section 3 of 14 · What Is Chain-of-Thought Prompting? · 2 minSection 3 of 14 · 2 min

Book contents

Section 3 of 14 · 2 min read

Introduction to Reasoning › What Is Chain-of-Thought Prompting?One section · Sections in this chapter3 / 14 ↓

The technique we just used has a name: chain-of-thought prompting. The idea is simple: instead of asking for just an answer, you ask the model to show its reasoning process. You're essentially saying, "Don't just tell me the answer. Show me how you got there."

This approach works because it changes how the model generates its response. When you ask for step-by-step thinking, the model produces intermediate reasoning steps. Each step builds on the previous one, creating a chain of thought that leads to the final answer.

Think of it like this: if someone asks you a complex question and expects an immediate answer, you might guess or oversimplify. But if they say "take your time and explain your thinking," you'll naturally break the problem down, consider different aspects, and arrive at a more thoughtful response. Chain-of-thought prompting does the same thing for AI agents.

When Reasoning Helps

Not every question needs explicit reasoning. If you ask "What's the capital of France?" the agent can answer directly: "Paris." There's no need for step-by-step thinking.

But reasoning becomes valuable when:

The problem has multiple steps: Math problems, logic puzzles, or any task that requires sequential thinking benefits from breaking down the process.

The question is ambiguous: When a question could be interpreted different ways, reasoning helps the agent clarify what it's solving before jumping to an answer.

Accuracy matters more than speed: If you need a reliable answer and can afford a slightly longer response, reasoning reduces errors.

You need to verify the answer: When the agent shows its work, you can check whether its logic makes sense, even if you don't know the correct answer yourself.