Class CompiledAgentGraph<TState>

A compiled, execution-ready agent graph.

Returned by AgentGraph.compile() — do not instantiate directly.

Wraps a CompiledExecutionGraph IR object and a GraphRuntime instance, exposing the three execution modes: synchronous invoke(), streaming stream(), and checkpoint-based resume().

Type Parameters

Constructors

Methods

  • Execute the graph to completion and return the final artifacts payload.

    This is the simplest execution mode — it buffers all events internally and returns only the terminal output. Use stream() when you need real-time progress updates.

    Parameters

    • input: unknown

      Initial user-provided input frozen into GraphState.input.

    Returns Promise<unknown>

    The GraphState.artifacts value after the last node completes.

  • Execute the graph while yielding GraphEvent values at each significant step.

    Events are emitted in strict causal order: run_start → (node_startnode_endedge_transition?)+ → run_end

    Parameters

    • input: unknown

      Initial user-provided input frozen into GraphState.input.

    Returns AsyncIterable<GraphEvent, any, any>

    Yields

    Runtime events in causal order.

  • Resume a previously interrupted run from its latest persisted checkpoint.

    The patch argument is accepted for API compatibility with future resume-with-patch support; it is not forwarded to the runtime in the current implementation.

    Parameters

    • checkpointId: string

      Either the original run id or an exact checkpoint id.

    • Optional patch: Partial<TState>

      Reserved for future use: optional partial state override.

    Returns Promise<unknown>

    The final GraphState.artifacts value after resumption completes.

    Throws

    When no checkpoint exists for the given identifier.

  • Inspect execution state for a completed or in-progress run.

    Parameters

    • _runId: string

      The unique run identifier assigned at stream() call-time.

    Returns Promise<unknown>

    A stub object — full inspection support is tracked separately.

    Full runtime inspection is not implemented yet; this currently returns a stub object until the run-registry subsystem lands.