Class GoalOrientedPlanner
java.lang.Object
dev.langchain4j.agentic.patterns.goap.GoalOrientedPlanner
- All Implemented Interfaces:
dev.langchain4j.agentic.planner.Planner
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondev.langchain4j.agentic.planner.ActionfirstAction(dev.langchain4j.agentic.planner.PlanningContext planningContext) voidinit(dev.langchain4j.agentic.planner.InitPlanningContext initPlanningContext) dev.langchain4j.agentic.planner.ActionnextAction(dev.langchain4j.agentic.planner.PlanningContext planningContext) voidrestoreExecutionState(Map<String, Object> state) GoalOrientedPlanner does not persist execution state becausefirstAction(PlanningContext)recomputes the path from the current scope state via graph search.dev.langchain4j.agentic.planner.AgenticSystemTopologytopology()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.langchain4j.agentic.planner.Planner
as, call, call, done, done, executionState, noOp, terminated
-
Constructor Details
-
GoalOrientedPlanner
public GoalOrientedPlanner()
-
-
Method Details
-
init
public void init(dev.langchain4j.agentic.planner.InitPlanningContext initPlanningContext) - Specified by:
initin interfacedev.langchain4j.agentic.planner.Planner
-
firstAction
public dev.langchain4j.agentic.planner.Action firstAction(dev.langchain4j.agentic.planner.PlanningContext planningContext) - Specified by:
firstActionin interfacedev.langchain4j.agentic.planner.Planner
-
nextAction
public dev.langchain4j.agentic.planner.Action nextAction(dev.langchain4j.agentic.planner.PlanningContext planningContext) - Specified by:
nextActionin interfacedev.langchain4j.agentic.planner.Planner
-
restoreExecutionState
GoalOrientedPlanner does not persist execution state becausefirstAction(PlanningContext)recomputes the path from the current scope state via graph search. On recovery, completed agents' outputs are already in scope, so the search produces a shorter path containing only the remaining agents. The cursor resets to 0 naturally, making state persistence unnecessary and potentially harmful (a stale cursor could point beyond the bounds of the recomputed path).- Specified by:
restoreExecutionStatein interfacedev.langchain4j.agentic.planner.Planner
-
topology
public dev.langchain4j.agentic.planner.AgenticSystemTopology topology()- Specified by:
topologyin interfacedev.langchain4j.agentic.planner.Planner
-