Core knowledge graph data structure.
Stores nodes indexed by ID, type, tag label, and subgoal description. Supports bidirectional linking between nodes and batch mutation via changesets.
Summary
Functions
Applies a changeset's additions and links to the graph.
Removes a node from the graph, cleans up link references, and rebuilds indexes.
Fetches a node by its ID, returning nil if not found.
Creates a typed bidirectional link between two nodes. No-op if either ID is missing.
Creates an empty graph.
Returns all nodes matching the given type atom.
Inserts a node into the graph, updating all secondary indexes.
Types
Functions
@spec apply_changeset(t(), Mnemosyne.Graph.Changeset.t()) :: t()
Applies a changeset's additions and links to the graph.
Removes a node from the graph, cleans up link references, and rebuilds indexes.
Fetches a node by its ID, returning nil if not found.
@spec link(t(), String.t(), String.t(), Mnemosyne.Graph.Edge.edge_type()) :: t()
Creates a typed bidirectional link between two nodes. No-op if either ID is missing.
@spec new() :: t()
Creates an empty graph.
Returns all nodes matching the given type atom.
Inserts a node into the graph, updating all secondary indexes.