Get Free Community License
Agent Reasoning

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.

6 Built-in Strategies One-Line Configuration Works with Any Model
None
Fastest
CoT
Low overhead
ReAct
Balanced
Plan & Execute
Structured
Reflection
High accuracy
Tree of Thought
Maximum depth
← Lower token cost Higher accuracy →
Strategy Deep-Dives

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.

1
NoneDirect 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
Program.cs
// 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
2
Chain of ThoughtCoT
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
Program.cs
// 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
3
ReActReason + Act
Medium Cost Tools

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
Program.cs
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?"
);
4
Plan and ExecutePlan First
High Cost Tools

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
Program.cs
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."
);
5
ReflectionSelf-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
Program.cs
// 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.
6
Tree of ThoughtsToT
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
Program.cs
// 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.
Decision Matrix

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
Which Strategy?

Pick the Right Strategy.

Walk through four quick questions to find the best fit for your task.

1
Does the task require calling tools?
Yes → ReAct / Plan and Execute No → Continue
2
Does it require multi-step reasoning?
Yes → Chain of Thought No → Continue
3
Is accuracy more important than speed?
Yes → Reflection No → Continue
4
Are there multiple valid approaches?
Yes → Tree of Thoughts Otherwise → None

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.

Need help choosing? Our team can advise on strategy selection for your use case.