<< All versions

Skill v1.0.1

currentAutomated scan100/100
samotech/skills-tree/mcts

+4 new

──Details
PublishedDecember 1, 2026 at 12:15 PM
Content Hashsha256:edf44f97084e6892...
Git SHA2f456eb973cd
Bump Typepatch
Compare with v1.0.0
──Files
Files (1 file, 3.4 KB)
SKILL.md3.4 KBactive
SKILL.md · 75 lines · 3.4 KB

name: mcts description: Use stochastic rollout and value estimates to explore a decision tree while controlling expansion, simulation, and selection budgets. metadata: source: skills/09-agentic-patterns/mcts.md category: 09-agentic-patterns version: "v2"


[Image: Dependency Status]

Monte Carlo Tree Search

Category: agentic-patterns Skill Level: advanced Stability: stable Added: 2025-03

Description

Use stochastic rollout and value estimates to explore a decision tree while controlling expansion, simulation, and selection budgets. Selection balances exploitation of high-value nodes against exploration of under-sampled ones, and every simulated reward is validated against a real terminal or value signal.

Inputs / Outputs

DirectionFieldTypeContract
Inputroot_stateobjectThe start state with a deterministic seed where possible
Inputaction_spacelist of objectThe actions available at each node
Outputbest_actionobjectThe root action with the highest validated value estimate
Outputbudget_ledgerobjectSimulations and expansions spent against the declared budget

Procedure

  1. Declare the simulation budget, expansion policy, and a deterministic seed where possible.
  2. Select a node by balancing value estimates against visit counts.
  3. Expand it with one unexplored action; roll out to a terminal or value signal.
  4. Back up the result along the path; validate that the value signal is real, not a heuristic artifact.
  5. Stop at the budget; select the root action with the best validated estimate.
  6. Report the estimate, its sample count, and the budget spent; distrust value estimates with tiny samples.

Example

python
stats = {'left': {'n': 4, 'mean': 0.5}, 'right': {'n': 10, 'mean': 0.8}}
budget = 14
spent = sum(s['n'] for s in stats.values())
def ucb(s, c=1.0, N=spent): return s['mean'] + c * (2 * 0.5 / max(1, s['n'])) ** 0.5
best = max(stats, key=lambda k: stats[k]['mean'] if stats[k]['n'] >= 3 else -1)
assert best == 'right' and spent <= budget
print({'best': best, 'mean': stats[best]['mean'], 'n': stats[best]['n'], 'spent': spent})

Related Skills

Failure Modes

  • A poor value heuristic amplified by random rollouts into confident wrong choices.
  • Selection on value estimates backed by tiny sample counts.
  • Non-reproducible rollouts where a deterministic seed was required.
  • Budget exhaustion reported as convergence.

Changelog

  • v2 (2026-11): Structural modernization; added the input/output contract table, a skill-specific execution procedure, a deterministic example, and corpus-verified related links (replaced the unresolvable cross-category related references).
  • v1 (2025-03): Initial entry.

Evidence

  • https://agentskills.io/specification

Evidence status: implementation guidance only; pattern behavior must be checked against current framework documentation; no benchmark claim is made without reproducible evidence.

← v1.0.0All versions