Tree of thoughts

From Miosa-osa/canopy · View interactive version

Tree of thoughts is an AI agent skill from the GitHub repository Miosa-osa/canopy. Multi-path reasoning with evaluation and backtracking - 74% success on complex tasks

How to use this skill

Skill file

Tree of Thoughts (ToT) Pattern

Multi-path reasoning that explores, evaluates, and backtracks. Achieved 74% success rate on Game of 24 vs 4% with standard CoT.

Activation

Triggers on:

Process

Phase 1: Decompose

Break problem into intermediate steps that can be evaluated independently.

Phase 2: Generate (Branch)

At each step, generate 3 candidate "thoughts" (reasoning paths):

STEP N:
├─ Thought A: [approach 1]
├─ Thought B: [approach 2]
└─ Thought C: [approach 3]

Phase 3: Evaluate

Score each thought (0-10) on:

Phase 4: Search Strategy

Phase 5: Backtrack

If path scores drop below threshold (5/10), backtrack to last good node.

Zero-Shot ToT Prompt

Use this simple prompt for ToT without explicit tree construction:

"Imagine three different experts are answering this question.
All experts will write down 1 step of their thinking, then share it with the group.
Then all experts will go on to the next step.
If any expert realizes they're wrong at any point, they leave.
Continue until consensus."

Integration


Based on Princeton/DeepMind research - arXiv:2305.10601

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.