AgentSkillsCN

reasoner

使用搜索策略(束搜索、MCTS)进行高级推理。何时:解决复杂问题需要探索多个解路径、优化问题、决策树,需要评分/排序的推理路径时。何时不:简单线性推理(使用 sequential_thinking)、琐碎问题,不需要分支时。

SKILL.md
--- frontmatter
name: reasoner
description: >
  Advanced reasoning with search strategies (beam search, MCTS).
  WHEN: Complex problem-solving requiring exploration of multiple solution paths, optimization problems, decision trees, when you need scored/ranked reasoning paths.
  WHEN NOT: Simple linear reasoning (use sequential_thinking), trivial problems, when branching isn't needed.
version: 0.1.0

Reasoner - Advanced Multi-Strategy Reasoning

Core Concept

mcp__plugin_kg_kodegen__reasoner provides sophisticated reasoning with multiple search strategies. Unlike sequential_thinking (simple linear tracking), reasoner uses algorithms like Beam Search and Monte Carlo Tree Search (MCTS) to explore and score multiple solution paths, finding optimal reasoning chains.

Strategies

StrategyBest ForDescription
beam_searchGeneral problemsMaintains top N paths simultaneously
mctsDecision treesUCB1/PUCT exploration-exploitation
mcts_002_alphaCreative solutions10% higher exploration bonus
mcts_002alt_alphaDetailed analysisRewards longer reasoning paths

Key Parameters

Required:

ParameterTypeDescription
thoughtstringCurrent reasoning step
thought_numbernumberCurrent step (1-based)
total_thoughtsnumberEstimated total needed
next_thought_neededbooleanWhether more steps needed

Optional:

ParameterTypeDescription
strategy_typestringbeam_search (default), mcts, mcts_002_alpha, mcts_002alt_alpha
beam_widthnumberPaths to maintain (1-10, default: 3)
num_simulationsnumberMCTS rollouts (1-150, default: 50)
parent_idstringParent node for branching

Usage Examples

Beam Search (Default)

json
{
  "thought": "Analyzing possible caching strategies for the API",
  "thought_number": 1,
  "total_thoughts": 4,
  "next_thought_needed": true,
  "strategy_type": "beam_search",
  "beam_width": 3
}

MCTS for Decision Making

json
{
  "thought": "Evaluating database migration approaches",
  "thought_number": 1,
  "total_thoughts": 3,
  "next_thought_needed": true,
  "strategy_type": "mcts",
  "num_simulations": 100
}

Creative Problem Solving

json
{
  "thought": "Exploring novel approaches to distributed consensus",
  "thought_number": 1,
  "total_thoughts": 5,
  "next_thought_needed": true,
  "strategy_type": "mcts_002_alpha",
  "num_simulations": 75
}

Detailed Analysis

json
{
  "thought": "Deep comparison of microservices vs monolithic architecture",
  "thought_number": 1,
  "total_thoughts": 6,
  "next_thought_needed": true,
  "strategy_type": "mcts_002alt_alpha",
  "num_simulations": 50
}

Branching from Parent

json
{
  "thought": "Alternative approach using event sourcing",
  "thought_number": 3,
  "total_thoughts": 5,
  "next_thought_needed": true,
  "parent_id": "previous-node-uuid"
}

Output Format

json
{
  "session_id": "uuid-v4",
  "thought": "echoed input",
  "score": 0.85,
  "depth": 2,
  "is_complete": false,
  "next_thought_needed": true,
  "branches": 3,
  "best_path_score": 0.92,
  "strategy": "beam_search",
  "history_length": 5
}

When to Use What

Problem TypeToolWhy
Simple step-by-stepsequential_thinkingNo scoring needed
Optimizationreasoner (mcts)Finds optimal path
Multiple alternativesreasoner (beam_search)Tracks top N paths
Creative explorationreasoner (mcts_002_alpha)Higher exploration
Detailed analysisreasoner (mcts_002alt_alpha)Rewards depth

Reasoner vs Sequential Thinking

FeatureSequential ThinkingReasoner
Path scoringNoYes (0.0-1.0)
Strategy selectionNobeam_search, MCTS variants
Semantic analysisNoYes (Stella 400M embeddings)
Best path trackingNoYes (best_path_score)
ComplexityLowerHigher
Use caseLinear reasoningOptimization/exploration

Remember

  • Choose strategy wisely - beam_search for general, MCTS for optimization
  • Adjust beam_width - higher = more paths but slower
  • num_simulations - more = better MCTS results but slower
  • Check scores - output includes quality scores (0.0-1.0)
  • Use for complex problems - overkill for simple reasoning
  • Prefer sequential_thinking for straightforward step-by-step