API Reference#
Every symbol listed below is part of the stable v0.1.0 public surface
re-exported from the top-level langgoap package. Anything not
listed here is internal and subject to change without notice.
Core#
Builder that produces a compiled LangGraph for GOAP execution. |
|
Specification of a GOAP action for planning. |
|
Base class for object-oriented GOAP action definitions. |
|
Decorator that converts a function into an ActionSpec. |
|
Specification of a GOAP goal. |
|
A composite goal made up of one or more |
|
A resource/budget constraint for CSP optimization. |
|
Immutable, hashable representation of a GOAP world state. |
|
Result of executing a single GOAP action. |
|
LangGraph state schema for the GOAP execution loop. |
Planning#
Find an optimal action sequence from start to goal using A*. |
|
Two-phase planning: A* finds sequences, CSP validates/optimizes. |
|
A sequence of actions that achieves a goal from a given start state. |
|
Metadata about how a plan was generated. |
|
A pluggable planning strategy. |
|
Pure A* construction heuristic. |
|
Run CSP validation / optimization over an existing candidate plan. |
|
A* construction + CSP refinement, composed as a single strategy. |
Constraints, scoring, and CSP#
Abstract base for all score types. |
|
A single scalar score. |
|
A two-level score with hard and soft components. |
|
A variable-width score with any number of hard and soft levels. |
|
Factory and aggregator for |
|
A single in-progress fluent chain. |
|
Output of a single terminated builder chain. |
|
Tagged bundle returned by |
|
Results from the CSP optimizer. |
|
Status of a CSP solve attempt. |
|
Per-key resource breakdown for a plan. |
|
Per-action temporal slot in a schedule. |
Integrations (low-code LangGraph on-ramp)#
Create a compiled GOAP agent from a list of LangChain tools and a goal. |
|
Wrap a LangChain |
|
A GOAP planner packaged as a reusable sub-graph. |
|
Attach a GOAP sub-graph as a node inside a parent |
Natural-language goal interpreter#
Converts natural language requests into GoalSpec objects via LLM. |
|
Structured goal extracted from a natural language request. |
|
A resource constraint extracted from natural language. |
|
An optimization objective extracted from natural language. |
Graph nodes#
LangGraph node that invokes the planner. |
|
LangGraph node that executes the current action in the plan. |
|
LangGraph node that decides the next step via Command routing. |
Tracing#
Sync + async observability hooks for the GOAP planning loop. |
|
No-op tracer — the default when no tracer is configured. |
|
Tracer that routes every event through stdlib |
|
Fan a single event out to multiple tracers. |
Execution history#
One planner → executor → observer loop outcome. |
|
Execution history backed by a LangGraph |
|
Return a stable short hash of a goal's conditions. |
Types#
Protocol for dynamic action cost functions. |
|
Direction for numeric optimization objectives. |
|
Direction for numeric optimization objectives. |
|
Direction for numeric optimization objectives. |
|
When to trigger replanning during execution. |
Visualization#
Render a Plan as a Mermaid |
|
Render a Plan's schedule as a Mermaid |
|
Render a Plan as a Graphviz DOT digraph. |
|
Render a Plan as a top-to-bottom ASCII tree. |
|
Render the plan's schedule as an ASCII Gantt chart. |
|
Render a Plan for display. |