NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
neograph::graph::RunConfig Struct Reference

Configuration for a graph execution run. More...

#include <engine.h>

Public Attributes

std::shared_ptr< CancelTokencancel_token
 Optional cooperative cancel handle (v0.3+).
 
json input
 Initial channel writes (e.g., {"messages": [...]}).
 
int max_steps = 50
 Safety limit for maximum super-steps per run.
 
bool resume_if_exists = false
 Auto-resume from latest checkpoint for thread_id (v0.3.1+).
 
StreamMode stream_mode = StreamMode::ALL
 Which event types to emit during streaming.
 
std::string thread_id
 Thread ID for checkpoint association.
 

Detailed Description

Configuration for a graph execution run.

Definition at line 40 of file engine.h.

Member Data Documentation

◆ cancel_token

std::shared_ptr<CancelToken> neograph::graph::RunConfig::cancel_token

Optional cooperative cancel handle (v0.3+).

When set, the engine super-step loop polls cancel_token->is_cancelled() between steps and bails with CancelledException. The pybind binding additionally binds the token's cancellation_slot to the run's co_spawn so an in-flight LLM HTTP request gets aborted at the socket layer.

Default nullptr → no cancellation; existing behaviour unchanged for callers that haven't opted in.

Definition at line 58 of file engine.h.

◆ resume_if_exists

bool neograph::graph::RunConfig::resume_if_exists = false

Auto-resume from latest checkpoint for thread_id (v0.3.1+).

Default false keeps the historical behaviour: every run starts from a fresh GraphState initialized by reducers and overwritten by input. Multi-turn callers carrying prior conversation state through the input dict themselves see no change.

When true:

  1. The engine loads the latest checkpoint for thread_id (if one exists). The checkpoint's channel values seed GraphState instead of the per-channel initial values.
  2. input is then applied on top via the same reducer pipeline as a fresh run — so e.g. an APPEND messages channel grows by the new turn instead of being clobbered.
  3. The super-step loop starts at the entry node (plan_start_step) — this flag is for the multi-turn-chat use case where the previous run completed at __end__ and the caller wants to add a new user message and re-run. For HITL resume from an interrupted run, use resume() / resume_async() instead.
  4. If no checkpoint exists for thread_id, behaves as if the flag were unset (fresh run from input). No error.

Requires a configured CheckpointStore — without one the flag is a no-op.

Definition at line 88 of file engine.h.


The documentation for this struct was generated from the following file: