Table of Contents

What Planning Strategies Can an AI Agent Use to Solve Complex Tasks?


TL;DR

LM-Kit.NET offers six planning strategies: None (direct response), ChainOfThought (step-by-step reasoning), ReAct (interleaved reasoning and tool use), PlanAndExecute (plan first, then execute), Reflection (generate, critique, refine), and TreeOfThought (explore multiple reasoning paths). Choose based on task complexity: use None for simple Q&A, ReAct for tool-using agents, and PlanAndExecute or TreeOfThought for complex multi-step problems.


The Six Strategies

None (Default)

No explicit planning. The agent responds directly without structured reasoning.

var agent = Agent.CreateBuilder(model)
    .WithPlanning(PlanningStrategy.None)
    .Build();

Best for: Simple Q&A, factual questions, single-step tasks. Trade-off: Fastest, lowest token overhead.

ChainOfThought

The agent reasons step by step before providing its final answer.

var agent = Agent.CreateBuilder(model)
    .WithPlanning(PlanningStrategy.ChainOfThought)
    .Build();

Best for: Math problems, logical deduction, multi-step analysis, explanation tasks. Trade-off: Increases response length and latency, but significantly improves accuracy on reasoning tasks.

Interleaves reasoning traces with tool actions in a Thought → Action → Observation loop:

var agent = Agent.CreateBuilder(model)
    .WithPlanning(PlanningStrategy.ReAct)
    .WithTools(tools =>
    {
        tools.Register(BuiltInTools.WebSearch);
        tools.Register(BuiltInTools.Calculator);
    })
    .Build();

How it works:

Thought: I need to find the current population of Tokyo.
Action:  websearch("Tokyo population 2026")
Observation: Tokyo metro area: ~37.4 million
Thought: Now I can answer the user's question.
Answer:  The Tokyo metropolitan area has approximately 37.4 million people.

Best for: Agents with tools, dynamic adaptation based on results, information gathering, multi-step workflows. Trade-off: Multiple model calls per response, but each step is informed by real data.

PlanAndExecute

Two-phase approach: first generates a complete plan, then executes each step sequentially.

var agent = Agent.CreateBuilder(model)
    .WithPlanning(PlanningStrategy.PlanAndExecute)
    .Build();

How it works:

Plan:
1. Search for recent sales data
2. Calculate quarterly growth rate
3. Compare with industry benchmarks
4. Summarize findings

Executing step 1... [tool call]
Executing step 2... [calculation]
Executing step 3... [tool call]
Executing step 4... [synthesis]

Best for: Complex multi-step tasks, sequential dependencies, project-style workflows where seeing the full plan upfront helps. Trade-off: Higher upfront latency, but more coherent execution across steps.

Reflection

Generate an initial response, critically evaluate it, then produce a refined version.

var agent = Agent.CreateBuilder(model)
    .WithPlanning(PlanningStrategy.Reflection)
    .Build();

How it works:

Draft:    [initial response]
Critique: "The explanation lacks a concrete example and the third paragraph contradicts the first."
Refined:  [improved response addressing the critique]

Best for: Critical accuracy tasks, writing and editing, code review, fact-checking. Trade-off: 2x to 3x latency, but noticeably better output quality.

TreeOfThought

Explores multiple reasoning paths in parallel, evaluates intermediate states, and selects the most promising branches.

var agent = Agent.CreateBuilder(model)
    .WithPlanning(PlanningStrategy.TreeOfThought)
    .Build();

How it works:

Path A: Approach via algorithm X → Score: 0.7
Path B: Approach via algorithm Y → Score: 0.9 ← selected
Path C: Approach via brute force → Score: 0.3

Continuing with Path B...

Best for: Problems with multiple solution approaches, creative tasks, puzzles, exploration-driven problems. Trade-off: Highest computational cost, but finds better solutions for complex problems.


Decision Guide

Task Type Recommended Strategy
Simple Q&A, factual answers None
Math, logic, step-by-step reasoning ChainOfThought
Agent with tools (search, APIs, files) ReAct
Complex multi-step project PlanAndExecute
Writing, editing, code review Reflection
Creative problem-solving, puzzles TreeOfThought

Combining Strategy with Tools

Planning strategies and tools work together. The strategy controls how the agent thinks; tools control what the agent can do:

var agent = Agent.CreateBuilder(model)
    .WithPlanning(PlanningStrategy.ReAct)     // How: reason-act loop
    .WithTools(tools =>                        // What: search and calculate
    {
        tools.Register(BuiltInTools.WebSearch);
        tools.Register(BuiltInTools.Calculator);
    })
    .WithMaxIterations(15)                     // Safety: limit reasoning loops
    .Build();

Share