langgoap.GoapState#
- class GoapState[source]#
LangGraph state schema for the GOAP execution loop.
Keys#
world_stateCurrent world state as a flat dictionary.
goalThe goal specification to achieve. May be a single
GoalSpecor aMultiGoalwrapping several sub-goals.planThe current action plan (set by planner node).
current_stepIndex of the next action to execute.
execution_historyAppend-only log of action results.
replan_countHow many times the planner has been invoked for the current (sub-)goal. Reset to zero when a
MultiGoaladvances between sequential sub-goals so each sub-goal receives its ownmax_replansbudget.replan_reasonWhy the last replan was triggered. One of
"action_failed","state_deviation","every_action_replan","plan_exhausted","max_replans_exceeded", or"subgoal_achieved"(only emitted when aMultiGoaladvances between sequential sub-goals).statusCurrent execution status.
blacklisted_actionsAction names the planner must skip.
action_failure_countsPer-action cumulative failure counts.
current_subgoal_indexWhen
goalis aMultiGoalrunning insequentialmode, the 0-based index of the sub-goal being worked on. Defaults to 0.no_plan_explanationSerialised
NoPlanExplanation(via.to_dict()) produced when A* returnsNone.Nonewhen a plan was found. Usefrom_dict()to reconstruct the object.reflection_contextOrdered list of verbal reflection summaries produced by
ReflexionTracerafter action failures. Each entry is a human-readable string of the form"[action_name] reflection → suggestion". Set by the planner node on each planning round so downstream LLM-evaluated conditions can read them without coupling directly to the tracer.
- __init__(*args, **kwargs)#
Methods
__init__(*args, **kwargs)clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()pop(k[,d])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem()Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()Attributes
world_stategoalplancurrent_stepexecution_historyreplan_countreplan_reasonstatusblacklisted_actionsaction_failure_countscurrent_subgoal_indexno_plan_explanationreflection_contextwall_clock_started_at