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

Per-node result cache (opt-in). More...

#include <neograph/api.h>
#include <neograph/graph/types.h>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <mutex>
#include <optional>
#include <set>
#include <string>
#include <unordered_map>
Include dependency graph for node_cache.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  neograph::graph::CacheKeyPolicy
 Explicit cache identity policy for one node. More...
 
class  neograph::graph::NodeCache
 Per-node result cache. More...
 

Enumerations

enum class  neograph::graph::CacheScope
 Lifetime boundary for a cached node result. More...
 

Functions

NEOGRAPH_API std::string neograph::graph::hash_state_for_cache (const json &state_value)
 Stable hash over the JSON state used as the cache-key suffix.
 

Detailed Description

Per-node result cache (opt-in).

Definition in file node_cache.h.

Enumeration Type Documentation

◆ CacheScope

enum class neograph::graph::CacheScope
strong

Lifetime boundary for a cached node result.

Execution is the safe default: results never cross a run() or resume() call. Reusable is an explicit assertion that the node is pure with respect to every run context dependency. A context key may further partition a Reusable cache by declared, stable context identity.

Definition at line 31 of file node_cache.h.

Function Documentation

◆ hash_state_for_cache()

NEOGRAPH_API std::string neograph::graph::hash_state_for_cache ( const json &  state_value)

Stable hash over the JSON state used as the cache-key suffix.

Concrete impl is FNV-1a over the canonical (sorted-key) dump — fine for in-process caches where collision risk is negligible.

References neograph::graph::hash_state_for_cache().

Referenced by neograph::graph::hash_state_for_cache().