Documentation

Procedures Reference

Procedures Reference

All procedures are invoked via CALL procedure.name(args) YIELD col1, col2 RETURN ... over any connection (REST, Bolt, or gRPC).

Schema Procedures (db.*)

ProcedureArgumentsYieldsDescription
db.registerNodeType name, id_kind node_type_id Register a node type. id_kind is "string" or "integer".
db.registerEdgeType {name, from_node_type, to_node_type, …} edge_type_id Register an edge type. Optional fields include bin_boundaries, tracked_property, activity_bitmap.tick_size_secs, node_histogram, minimal_payload, bool_property, and symmetric.
db.registerProperty name, value_type property_id Register a named property. Types: "int", "float", "string", "bool", "timestamp".
db.finalizeSchema schema_version Lock the schema. Must be called before any data writes.
db.schema node_types, edge_types, properties Introspect the current schema definition.
db.nodeStats type, count O(1) node count per type — use instead of MATCH (n:TYPE) RETURN count(n).
db.memoryUsage total_bytes, payload_bytes, edge_pair_count, breakdown, process_rss_bytes, … Full in-process memory model: total_bytes sums payload and structural terms (indirection, stacks, slack) and should align with process_rss on Linux. payload_bytes is the schema data lower bound. High RSS at large scale reflects partitions × edge types × directions in the edge stores, not a discrepancy to "debug" away with allocator settings alone; reducing footprint means layout or partitioning changes.
db.resetGraph ok Wipe all data and schema. Only available when ENABLE_ADMIN_RESET=true.

Graph Procedures (graph.*)

ProcedureDescription
graph.ingest(nodes, edges) Batch upsert of nodes and edges in a single round-trip. Returns ok, nodes_created, edges_created.
graph.upsertEdge(edge_type, src_typed_id, dst_typed_id) O(1) atomic edge upsert — increments tx_count and updates activity bitmap. Returns created_new, tx_count, approx_sum.
graph.edgeState(src, dst, edge_type, windows?) Returns one edge pair's state: tx_count, approx_sum, last_seen, bool_flag, and activity_counts. The optional windows list is expressed in activity ticks.
graph.lastNeighbor(node_typed_id, edge_type) Returns the most recently seen neighbor — useful for impossible-travel and last-location detection.
graph.fraudContext(node_typed_id) Returns connected fraud nodes, max neighbor fraud score, and propagation depth.
graph.createFraudCase(case_id, participants, score, reason) Create an explicit fraud case and link all participating nodes.
graph.removeFraudCaseNode(case_id, participant) Remove one participant from a fraud case.
graph.histogram(node, edge_type, hours?, days?) Returns node-level histogram buckets and aggregated counts. Pass hours to use the hourly ring, or null, days to use the daily ring.
graph.featureVector(node, edge_types, hours?, days?) Returns a compact flat vector of neighbour counts per edge type. For richer structured ML features, combine graph.histogram, graph.edgeState, or use the REST /features/vector endpoint.
graph.findSimilar(node_typed_id, k) Jaccard-based k-nearest-neighbor lookup using the SIMILAR_TO edge index.
graph.buildSimilarityGraph(edge_type, k) Batch-compute similarity edges for all nodes of a given edge type.
graph.deleteNode(node_typed_id) Delete a node and detach all its relationships.
graph.clearEdgeTypeData(edge_type) Remove all edges of a given type without touching nodes.
graph.saveSnapshot() Trigger a full snapshot immediately. Returns ok, path.

Edge Type Variants

When registering edge types, the storage variant is determined by registration fields. Choose the smallest payload that still answers your feature queries:

VariantTriggerPhysical payloadFeaturesWhen to use
Full / numeric bin_boundaries present CompactEdgePayload (~36 B payload) tx_count, approx_sum, last_seen, 21-tick activity bitmap, 8 numeric bins, optional bool flag Transaction edges where you query velocity, amounts, and amount buckets.
Slim No bin_boundaries, not minimal SlimEdgePayload (~16 B payload) tx_count, last_seen, 21-tick activity bitmap, optional bool flag. No amount bins or approx_sum. High-cardinality event edges where you need counts/velocity but not amount histograms.
Static minimal_payload: true StaticEdgePayload (~8 B payload) value + last_seen only Structural or derived-score edges such as SIMILAR_TO.
cypher — register a static edge type
// Static edges use an ~8 B payload — ideal for derived scores and similarity links CALL db.registerEdgeType({ name: "SIMILAR_TO", from_node_type: "CARD", to_node_type: "CARD", minimal_payload: true, symmetric: true }) YIELD edge_type_id RETURN edge_type_id