NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
execution.h
1#pragma once
2
4
5#include <memory>
6#include <optional>
7#include <stdexcept>
8#include <utility>
9
10namespace neograph::graph {
11
18class NEOGRAPH_API GraphExecution final {
19public:
20 explicit GraphExecution(std::shared_ptr<GraphEngine> engine)
21 : engine_(std::move(engine)) {
22 if (!engine_) throw std::invalid_argument("GraphExecution requires an engine");
23 }
24
25 asio::awaitable<RunResult> run_stream_async(
27 RunMetadata metadata, RunResources resources) const {
28 return engine_->run_stream_async(std::move(config), std::move(cb),
29 std::move(metadata), std::move(resources));
30 }
31
32 asio::awaitable<RunResult> resume_async(
33 RunConfig config, json value, GraphStreamCallback cb,
34 RunMetadata metadata, RunResources resources) const {
35 return engine_->resume_async(std::move(config), std::move(value),
36 std::move(cb), std::move(metadata),
37 std::move(resources));
38 }
39
40 asio::awaitable<RunResult> resume_from_async(
41 RunConfig config, std::string checkpoint_id, json value,
43 RunResources resources) const {
44 return engine_->resume_from_async(std::move(config), std::move(checkpoint_id),
45 std::move(value), std::move(cb),
46 std::move(metadata), std::move(resources));
47 }
48
53 std::optional<CheckpointPhase> latest_resume_phase(const std::string& thread_id) const {
54 auto history = engine_->get_state_history(thread_id, 1);
55 if (history.empty()) return std::nullopt;
56 return history.front().interrupt_phase;
57 }
58
59private:
60 std::shared_ptr<GraphEngine> engine_;
61};
62
63} // namespace neograph::graph
Owning, concrete execution capability for protocol hosts.
Definition execution.h:18
std::optional< CheckpointPhase > latest_resume_phase(const std::string &thread_id) const
Resume admission only: absent session or latest interrupt phase.
Definition execution.h:53
Main graph execution engine with super-step loop and HITL support.
std::function< void(const GraphEvent &)> GraphStreamCallback
Callback for receiving graph execution events.
Definition types.h:881
Configuration for a graph execution run.
Definition engine.h:225
Optional per-run metadata without changing the stable RunConfig ABI.
Definition engine.h:341
Optional persistence resources scoped to one run or resume call.
Definition engine.h:183