Skip to content

Recursive deepen — real tree-of-thought, not one level #45

Description

@UditAkhourii

Idea

`deepenIdea` in src/engine.ts:265 expands the top-K ideas exactly once (depth 0 → depth 1 children). It's fan-out-then-pick-then-expand-once, not actual tree search.

Proposal

Make `run()` recursive with a depth budget:

  • Add `maxDepth` (default 1, matching current behavior) to `RunOptions`.
  • After deepening an idea into `childIdeas`, if `depth < maxDepth`, score the children and recurse into the best of those before finalizing the shortlist.
  • Guard against combinatorial blowup: cap total LLM calls per run (e.g. `framesPerRun * ideasPerFrame * topK^maxDepth`) and refuse to start a run that would exceed it, with a clear CLI error.
  • `Idea.depth` and `Idea.parentId` already exist in src/types.ts — the data model supports this, the orchestration loop doesn't yet.

Roadmap item, no prior issue number.

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureLoad-bearing design changesenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions