NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
node.h File Reference

Graph node implementations: base class and built-in node types. More...

#include <neograph/api.h>
#include <neograph/graph/run_context.h>
#include <neograph/graph/types.h>
#include <neograph/graph/state.h>
#include <neograph/runtime_interposition_consumer.h>
#include <asio/awaitable.hpp>
#include <stdexcept>
#include <mutex>
#include <set>
#include <string_view>
Include dependency graph for node.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  neograph::graph::GraphNode
 Abstract base class for all graph nodes. More...
 
class  neograph::graph::IntentClassifierNode
 Node that classifies user intent via LLM and routes execution. More...
 
class  neograph::graph::LLMCallNode
 Node that makes LLM completion calls. More...
 
struct  neograph::graph::NodeInput
 Per-call input bundle for the unified run() virtual. More...
 
class  neograph::graph::SubgraphNode
 Node that runs a compiled GraphEngine as a single node (hierarchical composition). More...
 
class  neograph::graph::SyncGraphNode
 Adapter for CPU-light synchronous custom nodes. More...
 
class  neograph::graph::ToolDispatchNode
 Node that dispatches and executes pending tool calls. More...
 

Typedefs

using neograph::graph::NodeOutput = NodeResult
 Output of the unified run() virtual.
 

Enumerations

enum class  neograph::graph::SubgraphPersistence { Legacy , PerInvocation , PerThread , Stateless }
 A subgraph's checkpoint lifetime. Legacy preserves the pre-#238 wire identity. More...
 

Detailed Description

Graph node implementations: base class and built-in node types.

Defines the abstract GraphNode base class and all built-in node types:

  • LLMCallNode: makes LLM completion calls
  • ToolDispatchNode: executes pending tool calls
  • IntentClassifierNode: LLM-based intent routing
  • SubgraphNode: hierarchical graph composition

Custom node API

Custom nodes implement the single coroutine-native run(NodeInput) -> awaitable<NodeOutput> virtual. The pre-v1 execute* virtual cross-product has been removed; see docs/migration-v0.4-to-v1.0.md for before/after examples.

The engine threads RunContext through NodeInput::ctx. Nodes can use cancellation, usage accounting, thread/step/stream metadata, Store access, resume values, and C++ RunMetadata deadline/trace metadata.

Example overrides that match the v0.4.x surface:

  • examples/01_react_agent.cpp — basic ReAct agent
  • examples/02_custom_graph.cpp — custom node subclass
  • examples/05_parallel_fanout.cpp — Send / Command pattern
See also
docs/migration-v0.4-to-v1.0.md

Definition in file node.h.

Typedef Documentation

◆ NodeOutput

using neograph::graph::NodeOutput = typedef NodeResult

Output of the unified run() virtual.

Alias for NodeResult: channel writes plus optional Command and Send directives.

Definition at line 75 of file node.h.

Enumeration Type Documentation

◆ SubgraphPersistence

A subgraph's checkpoint lifetime. Legacy preserves the pre-#238 wire identity.

Enumerator
Legacy 

Existing parent-thread/step/task namespace (compatibility default).

PerInvocation 

Fresh namespace for each parent run; durable across its resume.

PerThread 

Retain channel state across parent runs on the same thread.

Stateless 

No child checkpoint or child interrupt/resume.

Definition at line 308 of file node.h.