Control How YourAgents 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. Expand any card to see code, best practices, and when to avoid.
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.
- Simple Q&A and lookup tasks
- Greetings and conversational replies
- Single-step text transformations
- Tasks where latency is the top priority
- The task requires multi-step reasoning
- Accuracy is critical and the question is ambiguous
- External tools or data sources are needed
// Strategy: None (default)
var agent = Agent.CreateBuilder(model)
.WithPlanningStrategy(PlanningStrategy.None)
.Build();
var result = await agent.ExecuteAsync(
"What is the capital of France?"
);
Console.WriteLine(result.Content);
// Output: Paris
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.
- Math and arithmetic problems
- Logic puzzles and riddles
- Multi-step decision making
- Explaining reasoning to the user
- The task is trivial and doesn't need reasoning
- Latency matters more than accuracy
- Responses must be extremely short
// Strategy: Chain of Thought
var agent = Agent.CreateBuilder(model)
.WithPlanningStrategy(
PlanningStrategy.ChainOfThought)
.Build();
var result = await agent.ExecuteAsync(
"A store sells apples at $2 each. If I buy 5 " +
"and get a 20% discount, how much do I pay?"
);
// The agent reasons step-by-step:
// 1) 5 apples x $2 = $10
// 2) 20% discount = $10 x 0.20 = $2
// 3) Final price = $10 - $2 = $8
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.
- Research tasks requiring web search
- Data gathering from multiple sources
- Interactive tool calling workflows
- Dynamic decision-making with feedback
- No external tools are needed
- The full plan is known upfront
- Token budget is very tight
using LMKit.Agents.Tools.BuiltIn;
// Strategy: ReAct (Reason + Act)
var agent = Agent.CreateBuilder(model)
.WithPlanningStrategy(
PlanningStrategy.ReAct)
.WithTools(tools =>
{
tools.Register(BuiltInTools.WebSearch);
tools.Register(BuiltInTools.Calculator);
})
.Build();
var result = await agent.ExecuteAsync(
"What is the current population of Tokyo, " +
"and how does it compare to New York City?"
);
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.
- Complex multi-phase research projects
- Tasks that benefit from a visible roadmap
- Orchestrating many different tools
- Auditable, step-by-step workflows
- The task is simple or single-step
- You need fast, interactive responses
- The plan may change dynamically mid-task
using LMKit.Agents.Tools.BuiltIn;
// Strategy: Plan and Execute
var agent = Agent.CreateBuilder(model)
.WithPlanningStrategy(
PlanningStrategy.PlanAndExecute)
.WithTools(tools =>
{
tools.Register(BuiltInTools.WebSearch);
tools.Register(BuiltInTools.Http);
})
.Build();
var result = await agent.ExecuteAsync(
"Compare the pricing tiers of the top 3 " +
"cloud providers and create a summary table."
);
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.
- High-stakes content (legal, medical, policy)
- Complex writing where quality matters
- Tasks with many constraints to satisfy
- Reducing hallucination risk
- Speed is more important than quality
- The task is simple and low-stakes
- Token budget is constrained
// Strategy: Reflection (Self-Critique)
var agent = Agent.CreateBuilder(model)
.WithPlanningStrategy(
PlanningStrategy.Reflection)
.Build();
var result = await agent.ExecuteAsync(
"Draft a privacy policy for a mobile app " +
"that collects location data. It must comply " +
"with GDPR and CCPA requirements."
);
// The agent drafts, critiques, and refines
// until all compliance points are addressed.
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.
- Strategic planning with many viable paths
- Creative brainstorming and ideation
- Complex decisions with trade-offs
- Problems where the best approach is unclear
- There is a single obvious solution
- Token budget is limited
- Speed is the primary concern
// Strategy: Tree of Thoughts
var agent = Agent.CreateBuilder(model)
.WithPlanningStrategy(
PlanningStrategy.TreeOfThought)
.Build();
var result = await agent.ExecuteAsync(
"Our SaaS product has a 40% churn rate " +
"in the first 90 days. Propose a strategy " +
"to improve user retention."
);
// The agent explores multiple approaches:
// Branch A: Onboarding redesign
// Branch B: Engagement gamification
// Branch C: Pricing restructuring
// ...then selects the strongest path.
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.
Working Demos.
Runnable sample projects demonstrating each reasoning strategy in real scenarios.
Research Assistant
ReActAutonomous research agent that searches the web, synthesizes findings, and produces structured reports.
View demoTool Calling Assistant
ReActInteractive agent that invokes custom tools on demand, demonstrating the ReAct reasoning loop.
View demoContent Creation Pipeline
Pipeline + CoTMulti-stage content pipeline that drafts, reviews, and polishes articles using sequential agents.
View demoCustom Sampling
AdvancedFine-grained control over token sampling, temperature, and reasoning depth with dynamic strategies.
View demoNews Monitoring Agent
ReActContinuously monitors news sources, filters by topic relevance, and generates summarized briefings.
View demoMulti-Turn Chat with Tools
ToolsConversational 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.
Choose the Right Reasoning Strategy
Decision framework for matching task types to reasoning strategies.
Control Reasoning and Chain-of-Thought
Tune CoT verbosity, step limits, and output format.
Create an AI Agent with Tools
Register built-in and custom tools with the agent builder.
Build a Function-Calling Agent
Implement structured function calling with schema validation.
Control Token Sampling with Dynamic Strategies
Configure temperature, top-p, and sampling for each strategy.
Monitor Agent Execution with Tracing
Observe reasoning steps, tool calls, and performance metrics.
Key Concepts.
Core terminology behind agent planning, reasoning, and execution.
Agent Planning
How agents decompose complex goals into structured plans.
Agent Reasoning
The cognitive process agents use to evaluate and decide.
Agent Reflection
Self-critique loops that improve output quality iteratively.
Agent Execution
Running plans and invoking actions in the real world.
AI Agents
Autonomous systems that perceive, reason, and act on goals.
Agent Tools
External capabilities agents invoke to interact with the world.
Dynamic Sampling
Adaptive token selection that adjusts per-task for optimal output.
Context Windows
The token limit defining how much information an agent can process.
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.