NeoGraph 0.10.0
A C++17 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/types.h>
#include <neograph/graph/state.h>
#include <asio/awaitable.hpp>
#include <stdexcept>
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 v0.4 unified run() virtual. More...
 
class  neograph::graph::SubgraphNode
 Node that runs a compiled GraphEngine as a single node (hierarchical composition). More...
 
class  neograph::graph::ToolDispatchNode
 Node that dispatches and executes pending tool calls. More...
 

Macros

#define NEOGRAPH_DEPRECATED_VIRTUAL
 PR 4 (v0.4.0): deprecation marker for the legacy 8-virtual chain.
 

Typedefs

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

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

v0.4.x migration navigator (external authors)

Writing a custom node subclass in v0.4.x? Keep using the legacy 8-virtual surface (execute / execute_async / execute_full / execute_stream and their _async pairs) — those still work and the engine drives them on every dispatch path. The new unified run(NodeInput) -> awaitable<NodeOutput> virtual is additive in v0.4.0 (PR 2 in ROADMAP_v1.md): it forwards to the legacy chain by default, so existing subclasses compile unchanged. PR 4 of the same plan will mark the legacy virtuals [[deprecated]]; v1.0 deletes them.

The RunContext field plumbed through NodeInput::ctx is engine-internal for now — PR 1 (v0.4.0) only carries it through the dispatch hops. User-overridable virtuals receive it once PR 2 lands. Until then, cancel token / deadline / trace_id propagate via the legacy paths.

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
ROADMAP_v1.md for the v0.4 → v1.0 PR sequence

Definition in file node.h.

Macro Definition Documentation

◆ NEOGRAPH_DEPRECATED_VIRTUAL

#define NEOGRAPH_DEPRECATED_VIRTUAL
Value:
[[deprecated( \
"v0.4: override run(NodeInput) -> awaitable<NodeOutput> " \
"instead. The legacy 8-virtual chain is preserved for " \
"back-compat through v0.5 and removed in v1.0. " \
"Migration recipe: docs/migration-v0.4-to-v1.0.md")]]

PR 4 (v0.4.0): deprecation marker for the legacy 8-virtual chain.

Centralised so the message stays consistent across every override point. v0.4.x emits -Wdeprecated-declarations warnings; v1.0 removes the marked methods entirely. See ROADMAP_v1.md PR 9.

Migration recipe with case-by-case before/after examples: docs/migration-v0.4-to-v1.0.md

Definition at line 105 of file node.h.

Typedef Documentation

◆ NodeOutput

using neograph::graph::NodeOutput = typedef NodeResult

Output of the v0.4 unified run() virtual.

Same shape as the legacy NodeResult (writes + optional Command + Sends), aliased here so user code can use either name interchangeably during the deprecation window. The ROADMAP names it NodeOutput because the "input → output" pairing reads more naturally than "input → result" at the call site; the underlying structure is unchanged.

Definition at line 96 of file node.h.