# Send Tree Of Thoughts to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "tree-of-thoughts",
    "name": "Tree Of Thoughts",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/tobisamaa/tree-of-thoughts",
    "canonicalUrl": "https://clawhub.ai/tobisamaa/tree-of-thoughts",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/tree-of-thoughts",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=tree-of-thoughts",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "PLANNED.md",
      "SKILL.md",
      "unified_wrapper.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/tree-of-thoughts"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/tree-of-thoughts",
    "downloadUrl": "https://openagent3.xyz/downloads/tree-of-thoughts",
    "agentUrl": "https://openagent3.xyz/skills/tree-of-thoughts/agent",
    "manifestUrl": "https://openagent3.xyz/skills/tree-of-thoughts/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/tree-of-thoughts/agent.md"
  }
}
```
## Documentation

### Tree of Thoughts (ToT) Reasoning (Enhanced v2.0.0)

v2.0.0 Enhancement: Parallel execution + intelligent caching (FoT pattern)
Speed Improvement: 3-5x faster for complex problems
Cache Benefit: 50-200x faster for similar cached problems

Advanced reasoning through systematic exploration of solution spaces.

### What is Tree of Thoughts?

Traditional reasoning (Chain of Thought):

Problem → Step 1 → Step 2 → Step 3 → Solution
(Single linear path)

Tree of Thoughts:

Problem
                   /   |   \\
              Path A Path B Path C
               /  \\    |    /  \\
            A1   A2   B1  C1   C2
             |    |    |   |    |
          [eval] [eval] ... [eval]
             \\    |    |   /    /
              \\   |    |  /    /
               Best Solution

Key differences:

Explores MULTIPLE paths
Evaluates EACH branch
Can BACKTRACK from dead ends
SELECTS optimal solution
More robust than linear thinking

### When to Use ToT

Use ToT for:

Multiple possible solutions exist
Problem is ambiguous or complex
Need to compare approaches
High cost of failure
Creative/optimization problems
Uncertain which method works

Skip ToT for:

Simple, clear problems
Single obvious solution
Time-critical decisions
Routine operations
Well-known procedures

### Performance Improvements

ScenarioBeforeAfterSpeedup3-branch exploration3.0s1.0s3x5-branch exploration5.0s1.2s4.2xDeep tree (depth 4)8.0s2.0s4xSimilar cached problem5.0s0.025s200x

### Parallel Tree Generation

async def parallel_tree_of_thoughts(problem, branches=5, depth=3):
    """
    Generate and evaluate thought tree in parallel.
    
    Benefits:
    - 3-5x faster than sequential
    - All branches generated simultaneously
    - Evaluation parallelized
    """
    # Step 1: Generate all initial thoughts in parallel
    initial_thoughts = await asyncio.gather(*[
        generate_thought_async(problem) for _ in range(branches)
    ])
    
    # Step 2: Evaluate all thoughts in parallel
    evaluations = await asyncio.gather(*[
        evaluate_thought_async(thought) for thought in initial_thoughts
    ])
    
    # Step 3: Select top thoughts for expansion
    top_thoughts = select_top_k(initial_thoughts, evaluations, k=3)
    
    # Step 4: Expand in parallel
    expanded = await asyncio.gather(*[
        expand_thought_async(thought, depth-1) for thought in top_thoughts
    ])
    
    return select_best_solution(expanded)

### Intelligent Caching

def cached_tree_of_thoughts(problem, cache_ttl_hours=24):
    """
    ToT with semantic caching for similar problems.
    
    Cache hits when:
    - Same problem repeated (exact match)
    - Similar problem (>85% semantic similarity)
    - Related problem type (same domain)
    """
    cache_key = semantic_hash(problem)
    cached = cache_get(cache_key)
    
    if cached and semantic_similarity(problem, cached['problem']) > 0.85:
        return {
            "solution": cached['solution'],
            "from_cache": True,
            "cache_age": (now - cached['timestamp']).minutes
        }
    
    # Generate fresh solution
    result = parallel_tree_of_thoughts(problem)
    
    # Cache for future
    cache_set(cache_key, {
        'problem': problem,
        'solution': result,
        'timestamp': now()
    })
    
    return {**result, "from_cache": False}

### CLI Flags

--parallel         Use parallel execution (default)
--cached           Enable caching (default)
--sequential       Disable parallel execution
--no-cache         Disable caching
--branches N       Set number of branches (default: 5)
--depth N          Set tree depth (default: 3)

### Step 1: GENERATE Thoughts

Given problem, generate multiple initial approaches:
- Thought A: [Approach 1]
- Thought B: [Approach 2]
- Thought C: [Approach 3]

### Step 2: EVALUATE Thoughts

For each thought, assess:
- Feasibility: Can this work?
- Quality: How good would result be?
- Cost: Time/resources needed?
- Risk: What could fail?

### Step 3: EXPAND Promising Thoughts

Take best thoughts and expand:
- Thought A → A1, A2, A3
- Thought B → B1, B2
(Expand only promising branches)

### Step 4: EVALUATE Branches

Evaluate each expanded branch:
- A1: [score/10]
- A2: [score/10]
- B1: [score/10]

### Step 5: SEARCH for Solution

Strategies:
- BFS: Explore all branches breadth-first
- DFS: Dive deep into promising branches
- Best-First: Always expand highest-rated
- Beam Search: Keep top-K branches

### Step 6: SELECT Optimal Path

Choose path with best expected outcome:
- Highest evaluation score
- Most feasible
- Best cost/benefit ratio

### Evaluation Criteria

Feasibility (0-10):

- 10: Definitely possible
- 7-9: Likely possible
- 4-6: Maybe possible
- 1-3: Unlikely to work
- 0: Impossible

Quality (0-10):

- 10: Perfect solution
- 7-9: Great solution
- 4-6: Adequate solution
- 1-3: Poor solution
- 0: Doesn't solve problem

Cost (0-10, inverse):

- 10: Negligible cost
- 7-9: Low cost
- 4-6: Moderate cost
- 1-3: High cost
- 0: Prohibitively expensive

Risk (0-10, inverse):

- 10: No risk
- 7-9: Low risk
- 4-6: Moderate risk
- 1-3: High risk
- 0: Certain failure

### Scoring Formula

Score = (Feasibility * 0.3) + (Quality * 0.3) + (Cost * 0.2) + (Risk * 0.2)

Adjust weights based on priorities:

Quality-focused: Quality * 0.5
Speed-focused: Cost * 0.5
Safety-focused: Risk * 0.5

### Breadth-First Search (BFS)

Level 1: Explore all initial thoughts
Level 2: Expand all promising thoughts
Level 3: Continue breadth-wise
Good for: Comprehensive exploration

### Depth-First Search (DFS)

Level 1: Pick most promising thought
Level 2: Dive deep into that branch
Level 3: Continue depth-wise
Good for: Quick deep solutions

### Best-First Search

Always expand the highest-rated node
Use priority queue
Good for: Finding optimal quickly

### Beam Search

Keep only top-K branches at each level
Prune low-rated branches early
Good for: Efficiency with quality

### Decision Problem

## Problem: [Decision to make]

### Initial Thoughts
1. **Option A**: [Description]
   - Feasibility: 8/10
   - Quality: 7/10
   - Cost: 9/10
   - Risk: 8/10
   - **Score**: 7.9/10

2. **Option B**: [Description]
   - Feasibility: 9/10
   - Quality: 6/10
   - Cost: 7/10
   - Risk: 6/10
   - **Score**: 7.1/10

3. **Option C**: [Description]
   - Feasibility: 6/10
   - Quality: 9/10
   - Cost: 5/10
   - Risk: 4/10
   - **Score**: 6.3/10

### Expansion (Top 2)
**Option A** → A1: [Refinement] (Score: 8.5/10)
**Option B** → B1: [Refinement] (Score: 7.8/10)

### Selected Path: A1
Reason: Highest score, good balance of feasibility and quality

### Creative Problem

## Problem: [Creative challenge]

### Thought Branches
1. **Creative A**: [Idea]
   - Novelty: 9/10
   - Feasibility: 5/10
   - Impact: 8/10
   - **Score**: 7.4/10

2. **Creative B**: [Idea]
   - Novelty: 7/10
   - Feasibility: 8/10
   - Impact: 7/10
   - **Score**: 7.3/10

3. **Safe C**: [Conservative idea]
   - Novelty: 4/10
   - Feasibility: 9/10
   - Impact: 6/10
   - **Score**: 6.3/10

### Hybrid Approach: A + B
Combine novelty of A with feasibility of B
Score: 8.2/10

### ToT + Task Decomposition

1. Use ToT to choose decomposition strategy
2. Compare different breakdown approaches
3. Select optimal decomposition

### ToT + Error Recovery

1. When error occurs
2. Generate multiple recovery options via ToT
3. Evaluate each recovery path
4. Select best recovery strategy

### ToT + Self-Reflection

1. After completing task
2. Reflect: Did I consider enough options?
3. Should I have used ToT?
4. Was my evaluation accurate?

### Backtracking

When a path fails:

1. Mark branch as dead end
2. Record why it failed
3. Backtrack to decision point
4. Try next best alternative
5. Learn from failure

Example:

Path A → A1 → A1a [FAILED: X didn't work]
Backtrack to A
Path A → A2 → A2a [SUCCESS]

### Pruning Strategies

Early pruning:

Score < 3/10: Drop immediately
Infeasible: Drop immediately
High risk + low quality: Drop

Continuous pruning:

After expansion, keep only top 50%
Remove redundant branches
Merge similar thoughts

### Example 1: Choose Architecture

## Problem: Design system architecture

### Thoughts
1. Monolith: Simple, fast to build, hard to scale
   Score: 6/10 (good for MVP, bad for scale)

2. Microservices: Scalable, complex, slow to build
   Score: 7/10 (good for scale, overkill now)

3. Modular Monolith: Balanced, medium complexity
   Score: 8/10 (best of both)

### Expansion
Modular Monolith →
  - M1: Start modular, split later (8.5/10)
  - M2: Full modules from start (7/10)

### Decision: M1
Start with modular monolith, design for future split

### Example 2: Fix Performance Bug

## Problem: API too slow

### Thoughts
1. Cache everything: Fast, memory-heavy, stale data risk
   Score: 6/10

2. Optimize queries: Moderate speedup, accurate data
   Score: 8/10

3. Add indexes: Quick win, limited impact
   Score: 7/10

4. Rewrite in faster language: High impact, high cost
   Score: 5/10

### Expansion
Optimize + Indexes → Combined approach
Score: 9/10 (synergy)

### Decision: Optimize queries + Add strategic indexes

### ToT Reasoning Log

Track ToT sessions in: memory/tot-sessions.md

## [Date] ToT Session: [Problem]

### Options Considered: [N]
### Paths Explored: [N]
### Depth: [N levels]
### Decision: [Chosen path]
### Rationale: [Why this won]
### Outcome: [Did it work?]
### Lesson: [What was learned]

### Metrics

Average thoughts generated per problem
Search depth average
Backtrack rate
Decision quality (outcomes)
Time to decision
Solution diversity

### Quick Actions

tot [problem] - Run ToT reasoning
compare [options] - Evaluate multiple options
decide [decision] - Make decision with ToT
branches - Show current ToT tree

### Best Practices

Generate many thoughts initially (5-10)
Evaluate objectively (use criteria)
Prune aggressively (don't explore poor options)
Expand gradually (depth vs breadth balance)
Backtrack when stuck (dead ends happen)
Document reasoning (learn from decisions)
Review outcomes (improve evaluation accuracy)

Remember: The best solution is rarely the first one you think of. Explore, evaluate, select.

### Real Usage Example

Scenario: Choosing the best system improvement to implement

### Problem

"What ONE improvement should I make to the OpenClaw system today?"

### Initial Thoughts (Generated 5 options)

OptionDescriptionFeasibilityQualityCostRiskScoreAAuto-create log files97998.3BAdd quick-action triggers48355.0CAdd integration examples96897.6DCreate error pattern detection79677.4ECreate skill test runner69566.5

### Scoring Formula

Score = (Feasibility × 0.3) + (Quality × 0.3) + (Cost × 0.2) + (Risk × 0.2)

### Expansion (Top 2)

A → A1: Auto-create all log files AND error folder → Score: 8.5
D → D1: Simple regex-based error classifier → Score: 7.8

### Decision: A1 (Auto-create log files)

Rationale: Highest score, lowest risk, immediate usability improvement

### Outcome

Created:

memory/criticism-log.md
memory/tot-sessions.md
memory/errors/error-log.md

Lesson: Simple infrastructure improvements often beat complex features.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: tobisamaa
- Version: 2.0.0
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-04-30T16:55:25.780Z
- Expires at: 2026-05-07T16:55:25.780Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/tree-of-thoughts)
- [Send to Agent page](https://openagent3.xyz/skills/tree-of-thoughts/agent)
- [JSON manifest](https://openagent3.xyz/skills/tree-of-thoughts/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/tree-of-thoughts/agent.md)
- [Download page](https://openagent3.xyz/downloads/tree-of-thoughts)