Skip to main content

Module c_api

Module c_api 

Source
Expand description

C-compatible FFI bindings.

Functions§

amem_graph_add_edge
Add an edge. Returns AMEM_OK or error code.
amem_graph_add_node
Add a node. Returns the assigned node ID, or -1 on error.
amem_graph_correct
Record a correction. Returns new node ID or error.
amem_graph_dimension
Get dimension.
amem_graph_edge_count
Get edge count.
amem_graph_free
Free a graph handle.
amem_graph_get_confidence
Get a node’s confidence. Returns -1.0 if not found.
amem_graph_get_content
Get a node’s content. Writes to buffer. Returns content length or error.
amem_graph_get_edges
Get edges from a node. Returns edge count or error.
amem_graph_get_event_type
Get a node’s event type. Returns -1 if not found.
amem_graph_new
Create a new empty graph. Returns handle or NULL on failure.
amem_graph_node_count
Get node count.
amem_graph_open
Load a graph from an .amem file. Returns handle or NULL on failure.
amem_graph_resolve
Resolve: follow SUPERSEDES chain. Returns final node ID or error.
amem_graph_save
Save a graph to an .amem file. Returns AMEM_OK or error code.
amem_graph_touch
Touch a node (update access tracking).
amem_graph_traverse
Traverse from a start node. Returns visited count.