Interface Planner

All Known Implementing Classes:
ConditionalPlanner, GoalOrientedPlanner, LoopPlanner, P2PPlanner, ParallelMapperPlanner, ParallelPlanner, SequentialPlanner, SupervisorPlanner

public interface Planner
  • Method Details

    • init

      default void init(InitPlanningContext initPlanningContext)
    • executionState

      default Map<String,Object> executionState()
      Returns the planner's current execution state as a map of serializable values. This state is persisted to the AgenticScope after each agent invocation, enabling the planner to resume from the correct position after a crash.

      The returned state must be such that, when passed to restoreExecutionState(Map) and firstAction(PlanningContext) is called, the planner produces the correct resume action.

      Stateless planners (e.g., parallel, conditional) can use the default empty implementation.

      Returns:
      a map of state entries to persist, or an empty map if no state needs saving
    • restoreExecutionState

      default void restoreExecutionState(Map<String,Object> state)
      Restores the planner's execution state from a previously saved map. Called by the execution loop before firstAction(PlanningContext) when recovering from a persisted scope.
      Parameters:
      state - the previously saved execution state
    • firstAction

      default Action firstAction(PlanningContext planningContext)
    • topology

      default AgenticSystemTopology topology()
    • nextAction

      Action nextAction(PlanningContext planningContext)
    • terminated

      default boolean terminated()
    • noOp

      default Action noOp()
    • call

      default Action call(AgentInstance... agents)
    • call

      default Action call(List<AgentInstance> agents)
    • done

      default Action done()
    • done

      default Action done(Object result)
    • as

      default <T extends AgentInstance> T as(Class<T> agentInstanceClass, AgentInstance agentInstance)