Class GraphOfThoughtsExecutor

java.lang.Object
com.tnsai.reasoning.got.GraphOfThoughtsExecutor

public final class GraphOfThoughtsExecutor extends Object
Graph of Thoughts (GoT) executor for complex problem solving.

Extension of Tree of Thoughts that allows cycles and merging of thought branches. Better for problems where partial solutions can be combined.

Usage


 GraphOfThoughtsExecutor got = GraphOfThoughtsExecutor.builder()
     .llm(client)
     .evaluator(BranchEvaluator.llm(client))
     .operations(List.of(GoTOperation.GENERATE, GoTOperation.AGGREGATE, GoTOperation.REFINE))
     .maxNodes(20)
     .build();

 GoTResult result = got.explore("Design a database schema for e-commerce");
 System.out.println(result.getBestThought());
 System.out.println(result.aggregatedInsight());
 

Research Reference

"Graph of Thoughts" (Besta et al., 2023)