AIAgentPlanner

abstract class AIAgentPlanner<State, Plan>(val stateType: KType)(source)

An abstract base planner component, which can be used to implement different types of AI agent planner execution flows.

An entry point is an execute method, which accepts an initial arbitrary State and returns the final State after the execution.

Planner flow works as follows:

  1. Build a plan: buildPlan

  2. Execute a step in the plan: executeStep

  3. Repeat steps 1 and 2 until the plan is considered completed. Then the final State is returned.

Inheritors

Constructors

Link copied to clipboard
constructor(stateType: KType)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun execute(context: AIAgentFunctionalContext, input: State): State

Executes the main loop for the planner, which involves building and executing plans iteratively until the plan is considered successfully completed or a max number of iterations is reached.