- None Fastest
- CoT Low overhead
- ReAct Balanced
- Plan & Execute Structured
- Reflection High accuracy
- Tree of Thought Maximum depth
Control how your agents think.
Six reasoning strategies from zero-overhead direct responses to multi-branch exploratory thinking. Match the cognitive demand of each task to the right strategy and optimize for accuracy, latency, or token cost.
Six ways to think.
Each strategy controls how the agent reasons before, during, and after execution. Each card explains the strategy, when to use it, when to avoid it, and shows the exact configuration code.
1 None Direct execution Low cost
Zero overhead. The model generates a response in a single pass without any internal reasoning steps. Ideal for well-scoped, simple tasks where additional thinking would only add latency and cost.
Best for
- Simple Q&A and lookup tasks
- Greetings and conversational replies
- Single-step text transformations
- Tasks where latency is the top priority
Avoid when
- The task requires multi-step reasoning
- Accuracy is critical and the question is ambiguous
- External tools or data sources are needed
2 Chain of Thought CoT Low cost
The agent "thinks out loud" before answering, breaking a problem into logical steps. Adds minimal token overhead while significantly boosting accuracy on reasoning-heavy prompts like math, logic, and multi-constraint problems.
Best for
- Math and arithmetic problems
- Logic puzzles and riddles
- Multi-step decision making
- Explaining reasoning to the user
Avoid when
- The task is trivial and doesn't need reasoning
- Latency matters more than accuracy
- Responses must be extremely short
3 ReAct Reason + Act Medium costTools
The agent interleaves reasoning and action in a tight loop: think, act (call a tool), observe the result, think again. This is the go-to strategy for any task that needs external data or tool calls.
Best for
- Research tasks requiring web search
- Data gathering from multiple sources
- Interactive tool calling workflows
- Dynamic decision-making with feedback
Avoid when
- No external tools are needed
- The full plan is known upfront
- Token budget is very tight
4 Plan and Execute Plan first High costTools
The agent first creates a complete, explicit plan, then executes each step sequentially. Ideal for complex, multi-phase projects where you want visibility into the overall approach before any action is taken.
Best for
- Complex multi-phase research projects
- Tasks that benefit from a visible roadmap
- Orchestrating many different tools
- Auditable, step-by-step workflows
Avoid when
- The task is simple or single-step
- You need fast, interactive responses
- The plan may change dynamically mid-task
5 Reflection Self-critique Medium cost
The agent generates an initial response, then critiques it against the requirements and iterates. This produce-then-refine loop catches errors, hallucinations, and gaps that a single pass would miss.
Best for
- High-stakes content (legal, medical, policy)
- Complex writing where quality matters
- Tasks with many constraints to satisfy
- Reducing hallucination risk
Avoid when
- Speed is more important than quality
- The task is simple and low-stakes
- Token budget is constrained
6 Tree of Thoughts ToT High cost
The agent explores multiple reasoning branches in parallel, evaluates each path, and selects the most promising one. Ideal for open-ended strategy problems where several approaches could be valid.
Best for
- Strategic planning with many viable paths
- Creative brainstorming and ideation
- Complex decisions with trade-offs
- Problems where the best approach is unclear
Avoid when
- There is a single obvious solution
- Token budget is limited
- Speed is the primary concern
Compare at a glance.
Token cost, latency profile, best-fit use case, and tool requirements side by side.
| Strategy | Token cost | Latency | Best for | Tools? |
|---|---|---|---|---|
| None | Minimal | Fastest | Simple Q&A, lookups, single-step tasks | No |
| Chain of Thought | Low | Low | Math, logic, multi-step reasoning | No |
| ReAct | Medium | Medium | Research, data gathering, tool workflows | Yes |
| Plan and Execute | High | High | Complex multi-phase projects, auditing | Yes |
| Reflection | Medium | Medium | High-stakes writing, compliance, accuracy | No |
| Tree of Thoughts | High | High | Strategy, brainstorming, trade-off analysis | No |
Pick the right strategy.
Walk through four quick questions to find the best fit for your task.
Question 1
Does the task require calling tools?
Yes → ReAct or Plan and Execute. No → continue.
Question 2
Does it require multi-step reasoning?
Yes → Chain of Thought. No → continue.
Question 3
Is accuracy more important than speed?
Yes → Reflection. No → continue.
Question 4
Are there multiple valid approaches?
Yes → Tree of Thoughts. Otherwise → None.
Working demos.
Runnable sample projects demonstrating each reasoning strategy in real scenarios.
ReAct
Research assistant
Autonomous research agent that searches the web, synthesizes findings, and produces structured reports.
View demoReAct
Tool calling assistant
Interactive agent that invokes custom tools on demand, demonstrating the ReAct reasoning loop.
View demoPipeline + CoT
Content creation pipeline
Multi-stage content pipeline that drafts, reviews, and polishes articles using sequential agents.
View demoAdvanced
Custom sampling
Fine-grained control over token sampling, temperature, and reasoning depth with dynamic strategies.
View demoReAct
News monitoring agent
Continuously monitors news sources, filters by topic relevance, and generates summarized briefings.
View demoTools
Multi-turn chat with tools
Conversational agent that maintains context across turns while dynamically invoking registered tools.
View demoStep-by-step guides.
Practical walkthroughs for configuring, combining, and optimizing reasoning strategies.
Guide
Choose the right reasoning strategy
Decision framework for matching task types to reasoning strategies.
Guide
Control reasoning and Chain-of-Thought
Tune CoT verbosity, step limits, and output format.
Guide
Create an AI agent with tools
Register built-in and custom tools with the agent builder.
Guide
Build a function-calling agent
Implement structured function calling with schema validation.
Guide
Control token sampling with dynamic strategies
Configure temperature, top-p, and sampling for each strategy.
Guide
Monitor agent execution with tracing
Observe reasoning steps, tool calls, and performance metrics.
Key concepts.
Core terminology behind agent planning, reasoning, and execution.
Term
Agent planning
How agents decompose complex goals into structured plans.
Term
Agent reasoning
The cognitive process agents use to evaluate and decide.
Term
Agent reflection
Self-critique loops that improve output quality iteratively.
Term
Agent execution
Running plans and invoking actions in the real world.
Term
AI agents
Autonomous systems that perceive, reason, and act on goals.
Term
Agent tools
External capabilities agents invoke to interact with the world.
Term
Dynamic sampling
Adaptive token selection that adjusts per-task for optimal output.
Term
Context windows
The token limit defining how much information an agent can process.
Reasoning plus the rest.
Streaming & thinking tokens
Render reasoning steps live in your UI. Distinguish Thinking from Content tokens, hide or show as you choose.
Tools & function calling
ReAct and Plan-and-Execute strategies need tools. 70+ built-in tools, custom ITool, attribute-based [LMFunction].
Resilience
Reasoning loops can stall. Timeout, retry, and circuit-breaker policies stop runaway agents and recover from transient failures.
Observability
Each Thought, Action, and Observation emits a span. Forensic analysis of why an agent picked one path over another.
Build it. Read it. Try it.
Working console demos on GitHub, step-by-step how-to guides on the docs site, and the API reference for the classes used on this page.
Research assistant
Agent demo: ReAct planning, search, reason, synthesise.
Open on GitHub → How-to guideChoose the right planning strategy
ReAct vs Plan-and-Solve vs Tree-of-Thoughts: when to use which.
Read the guide → How-to guideControl reasoning and chain of thought
Configure ReasoningLevel and intermediate-step visibility.
Read the guide →Match strategy to task. Ship smarter agents.
Pick the right reasoning strategy and let your agents think at exactly the depth each task demands. Start with a single line of configuration.