AI Agents
What is Chain-of-thought?
Prompting a model to reason step by step before answering, which improves accuracy on multi-step problems.
How it works
Asking the model to 'think step by step' or show its reasoning lets it work through intermediate steps instead of jumping to an answer. It costs more output tokens but sharply reduces errors on logic, math, and planning tasks.
Example
In practiceInstead of answering a multi-part question directly, the model works through each part in turn, then gives the final answer.
Does chain-of-thought always help?
On reasoning-heavy tasks, yes. On simple lookups it just adds tokens and latency for no gain.
Go deeper: Deploy Your First AI Agent
The complete, step-by-step guide — every command, config, and the reasoning behind it.
Get the guide