diff --git a/libs/langgraph/langgraph/graph/state.py b/libs/langgraph/langgraph/graph/state.py index 0dbddab41..65b553f75 100644 --- a/libs/langgraph/langgraph/graph/state.py +++ b/libs/langgraph/langgraph/graph/state.py @@ -117,6 +117,13 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]): will be used to aggregate the values of that key received from multiple nodes. The signature of a reducer function is `(Value, Value) -> Value`. + !!! warning + + `StateGraph` is a builder class and cannot be used directly for execution. + You must first call `.compile()` to create an executable graph that supports + methods like `invoke()`, `stream()`, `astream()`, and `ainvoke()`. See the + `CompiledStateGraph` documentation for more details. + Args: state_schema: The schema class that defines the state. context_schema: The schema class that defines the runtime context.