Class AtomGenerator

java.lang.Object
com.tnsai.prompt.aot.AtomGenerator

public class AtomGenerator extends Object
Generates atomic reasoning units from complex problems.

AtomGenerator decomposes a complex problem into independent atoms that can be solved in parallel, avoiding error propagation typical in linear Chain-of-Thought reasoning.

Usage


 AtomGenerator generator = new AtomGenerator(llmClient);

 List<Atom> atoms = generator.decompose(
     "Calculate the total cost including tax and shipping for 3 items"
 );

 // atoms might include:
 // - Atom 1: Calculate item subtotal
 // - Atom 2: Calculate tax amount
 // - Atom 3: Calculate shipping cost
 // - Atom 4: Sum all components (depends on 1, 2, 3)
 
  • Constructor Summary

    Constructors
    Constructor
    Description
    AtomGenerator(com.tnsai.llm.LLMClient llmClient)
    Creates an AtomGenerator with LLM-based decomposition.
    AtomGenerator(com.tnsai.llm.LLMClient llmClient, int maxAtoms, boolean useHeuristics)
    Creates an AtomGenerator with custom settings.
  • Method Summary

    Modifier and Type
    Method
    Description
    decompose(String problem)
    Decomposes a problem into atoms.
    static Atom
    singleAtom(String problem)
    Creates a simple single-atom decomposition for trivial problems.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AtomGenerator

      public AtomGenerator(com.tnsai.llm.LLMClient llmClient)
      Creates an AtomGenerator with LLM-based decomposition.
    • AtomGenerator

      public AtomGenerator(com.tnsai.llm.LLMClient llmClient, int maxAtoms, boolean useHeuristics)
      Creates an AtomGenerator with custom settings.
      Parameters:
      llmClient - LLM client for decomposition
      maxAtoms - maximum number of atoms to generate
      useHeuristics - use pattern-based heuristics before LLM
  • Method Details

    • decompose

      public List<Atom> decompose(String problem)
      Decomposes a problem into atoms.
      Parameters:
      problem - the problem to decompose
      Returns:
      list of atoms
    • singleAtom

      public static Atom singleAtom(String problem)
      Creates a simple single-atom decomposition for trivial problems.