NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
compiler.h
Go to the documentation of this file.
1
16#pragma once
17
18#include <neograph/api.h>
22#include <map>
23#include <memory>
24#include <optional>
25#include <set>
26#include <string>
27#include <vector>
28
29namespace neograph::graph {
30
31class GraphNode;
32
39struct ChannelDef {
40 std::string name;
41 ReducerType type = ReducerType::OVERWRITE;
42 std::string reducer_name = "overwrite";
43 json initial_value;
44};
45
59 std::string name;
60 std::vector<ChannelDef> channel_defs;
61 std::map<std::string, std::unique_ptr<GraphNode>> nodes;
62 std::vector<Edge> edges;
63 std::vector<ConditionalEdge> conditional_edges;
64 BarrierSpecs barrier_specs;
65 std::set<std::string> interrupt_before;
66 std::set<std::string> interrupt_after;
69 std::optional<RetryPolicy> retry_policy;
70};
71
79class NEOGRAPH_API GraphCompiler {
80public:
94 static CompiledGraph compile(const json& definition,
95 const NodeContext& default_context);
96};
97
98} // namespace neograph::graph
NEOGRAPH_API export/import macro for shared-library builds.
Stateless JSON → CompiledGraph translator.
Definition compiler.h:79
static CompiledGraph compile(const json &definition, const NodeContext &default_context)
Parse a JSON graph definition into a CompiledGraph.
Graph engine type definitions: channels, edges, nodes, events, and control flow.
ReducerType
Strategy for merging values when writing to a channel.
Definition types.h:53
Singleton registries for custom reducers, conditions, and node types.
Pure routing / next-step-planning logic extracted from GraphEngine.
std::map< std::string, std::set< std::string > > BarrierSpecs
Static barrier declarations extracted at graph-compile time.
Definition scheduler.h:75
Declarative configuration for a single state channel.
Definition compiler.h:39
Parsed graph definition, ready for the engine to run.
Definition compiler.h:58
std::optional< RetryPolicy > retry_policy
Present iff the JSON defined a top-level "retry_policy" object.
Definition compiler.h:69
Dependency injection context passed to nodes during construction.
Definition types.h:251