|
NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
|
Node that runs a compiled GraphEngine as a single node (hierarchical composition). More...
#include <node.h>
Public Member Functions | |
| std::string | checkpoint_thread_id (const std::string &parent_thread_id, int parent_step, std::string_view task_id, std::string_view graph_invocation_id={}) const |
| Reconstruct an inspection namespace from its parent path and invocation. | |
| std::string | get_name () const override |
| Get the node's unique name within the graph. | |
| asio::awaitable< NodeOutput > | run (NodeInput in) override |
v0.4 PR 9a: unified run — drives the child engine via run_async (or run_stream_async when in.stream_cb is non-null), maps channels through input_map / output_map. | |
| SubgraphNode (const std::string &name, std::shared_ptr< GraphEngine > subgraph, std::map< std::string, std::string > input_map={}, std::map< std::string, std::string > output_map={}, SubgraphPersistence persistence=SubgraphPersistence::Legacy) | |
| Construct a subgraph node. | |
Node that runs a compiled GraphEngine as a single node (hierarchical composition).
Enables the Supervisor pattern and nested workflows. Input mappings seed the child from the parent's current channel values. Output mappings forward only child-produced ChannelWrite deltas, in execution order and with Mode intact; they never feed the child's final state snapshot through the parent reducer. An explicit child Mode::Overwrite is the snapshot-replacement operation.
Runtime context is deliberately derived at the engine boundary rather than stored in additional public RunContext fields: cancellation reaches a child through a descendant operation token; usage, deadline, trace ID, and stream mode are inherited; and a non-empty child thread ID is a deterministic derivative of the parent invocation. An unscoped parent (empty thread ID) leaves the child unscoped, preserving the checkpoint coordinator's disabled behavior. A parent Store or checkpoint backend takes precedence when present, otherwise the child engine keeps its own configured resource. Parent ToolGate policy runs before the child's policy, so a child can narrow access but cannot bypass a parent deny or interrupt. A resumed parent resumes a child only when that child's derived checkpoint identity exists.
| neograph::graph::SubgraphNode::SubgraphNode | ( | const std::string & | name, |
| std::shared_ptr< GraphEngine > | subgraph, | ||
| std::map< std::string, std::string > | input_map = {}, |
||
| std::map< std::string, std::string > | output_map = {}, |
||
| SubgraphPersistence | persistence = SubgraphPersistence::Legacy |
||
| ) |
Construct a subgraph node.
| name | Unique node name within the parent graph. |
| subgraph | Compiled GraphEngine to run as a sub-workflow. |
| input_map | Mapping of parent_channel -> child_channel for input. |
| output_map | Mapping of child_channel -> parent_channel for ordered child write deltas. Empty means identity mapping. |
| std::string neograph::graph::SubgraphNode::checkpoint_thread_id | ( | const std::string & | parent_thread_id, |
| int | parent_step, | ||
| std::string_view | task_id, | ||
| std::string_view | graph_invocation_id = {} |
||
| ) | const |
Reconstruct an inspection namespace from its parent path and invocation.
PerInvocation requires the parent's persisted graph invocation ID.
|
inlineoverridevirtual |
Get the node's unique name within the graph.
Implements neograph::graph::GraphNode.
|
overridevirtual |
v0.4 PR 9a: unified run — drives the child engine via run_async (or run_stream_async when in.stream_cb is non-null), maps channels through input_map / output_map.
in.ctx.cancel_token flows through into the child run's RunConfig so a parent cancel cascades to the subgraph.
Implements neograph::graph::GraphNode.