Vector Values
LoraDB treats VECTOR as a first-class value type. Vectors can be
constructed in Cypher, stored as node or relationship properties,
returned through every binding, indexed through CREATE VECTOR INDEX,
and used as input to built-in vector math functions.
A VECTOR has three fixed attributes:
- a dimension in the range
1..=4096; - a coordinate type drawn from six canonical tags;
- a values array whose length always equals
dimension.
CREATE VECTOR INDEX and db.index.vector.queryNodes /
queryRelationships are supported. By default an index is exact: it
scores every entity in its label/type scope. Opt in to approximate
nearest-neighbour search with an HNSW graph per index via
vector.indexProvider: 'hnsw' — see Choosing a provider.
LoraDB also has no plugin system today, so there is no built-in embedding generation. Produce embeddings in your application (hosted API, local model, batch job) and pass them in as parameters.
Construction
RETURN [1, 2, 3]::VECTOR<INTEGER>(3) AS v;
RETURN [1.05, 0.123, 5]::VECTOR<FLOAT32>(3) AS v;
RETURN $embedding::VECTOR<FLOAT32>(384) AS v;
RETURN CAST('[1.05e+00, 0.123, 5]' AS VECTOR<FLOAT>(3)) AS vUse value::VECTOR<COORD>(DIM) for compact handwritten Cypher, or
CAST(value AS VECTOR<COORD>(DIM)) when that reads better in generated
or parenthesized expressions. TRY_CAST(value AS VECTOR<COORD>(DIM)) returns null instead of reporting a conversion
error. The cast input may be:
- value —
LIST<INTEGER | FLOAT>or a string like"[1, 2, 3]"(numbers separated by commas, decimal or scientific notation). An empty string list"[]"parses to zero coordinates, which then has to match a zero-dimension declaration — but dimension0is rejected, so an empty vector is never constructible. The dimension is part of the target type and must be in1..=4096. Anything outside the valid ranges is rejected at evaluation time with a clear error.
Coordinate types
| Canonical tag | Aliases accepted on input |
|---|---|
FLOAT64 | FLOAT |
FLOAT32 | — |
INTEGER | INT, INT64, INTEGER64 |
INTEGER32 | INT32 |
INTEGER16 | INT16 |
INTEGER8 | INT8 |
Alias matching is case-insensitive. Output always emits the canonical tag.
DOUBLE is not accepted; typos surface as a clear
unknown vector coordinate type '