Expand description
Optional, schema-first type layer for the graph (HelixDB-inspired, ADR-252 P1/P2).
RuVector’s graph is schemaless by default and its Cypher engine is interpreted
at runtime. This module adds an opt-in schema that catches type errors
before execution — declared node labels, typed edges with from/to label
constraints, indexed properties, and vector types bound to a node label +
property (so a vector hit can be traversed back into the graph as a
first-class, validated relationship rather than a runtime string + property
name).
The module is pure-Rust with no storage/HNSW dependency, so it compiles for WASM. It coexists with schemaless mode: only declared labels/edges are checked, and undeclared ones pass through untouched.
Structs§
- Edge
Schema - Schema for an edge type (
E::in HelixQL) withfrom/tolabel constraints. - Graph
Schema - A complete, optional graph schema.
- Node
Schema - Schema for a node label (
N::in HelixQL). - Property
Schema - Declaration for a single property.
- Vector
Schema - Schema for a vector type (
V::in HelixQL), bound to a node label + property.
Enums§
- Distance
Metric - Distance metric for a vector type. Search always ranks by a higher-is-better
score, so
Euclideanis surfaced as the negated distance. - Property
Type - Declared type of a node/edge property.
Functions§
- extract_
vector - Coerce a property value into a dense
Vec<f32>if it is vector-shaped. - reciprocal_
rank_ fusion - Reciprocal Rank Fusion over several ranked id lists (ADR-252 P4 core).
- score_
property - Score a vector-shaped property against a query without allocating in the
common
FloatArraycase (zero-copy slice scoring). ReturnsNoneif the property is not vector-shaped or its dimension does not match the query.