Create a vector index
A vector index is defined by a name, a dimension, and a distance metric. Syntax:- Cypher
- Python SDK
Load embeddings
Once the index exists, load your pre-computed embeddings from a file. Each row in the file maps a numerical ID to a vector. The file path is relative to your TuringDB data directory (~/.turing/data by default).
The TuringDB data directory defaults to
~/.turing/data. You can change it at startup with the -turing-dir flag.- Cypher
- Python SDK
Search
VECTOR SEARCH finds the k nearest neighbors of a query vector and yields their IDs. It is a read statement, so you can chain it with MATCH to pull back the actual graph data.
Syntax:
Standalone search
- Cypher
- Python SDK
Combining with MATCH
This is where it gets interesting. ChainVECTOR SEARCH with a MATCH clause to join the nearest-neighbor IDs back to your graph:
- Cypher
- Python SDK
ids variable works exactly like a variable introduced by CALL ... YIELD, so any subsequent MATCH clause can reference it.
Manage indexes
List all vector indexes
Delete a vector index
Complete workflow
- Cypher
- Python SDK
Embeddings as node properties
The vector index above is a standalone, root-level structure keyed by numeric IDs. Separately, you can store an embedding directly as a node or edge property (typeEmbedding) and compare embeddings inline with the cosine_similarity and euclidean_distance functions — no index required.
Embedding literals use parentheses (...), not square brackets (which are list literals):
Bulk-loading embeddings from Parquet — LOAD EMBEDDING FROM
To attach embeddings to existing nodes in bulk, load them from a Parquet file. This is a write, so run it inside a change.
Syntax:
data directory) must have exactly two columns:
Embedding. The load fails if any node_id is missing from the graph, or if the property name already exists with a non-embedding type.
When importing a graph from JSONL, you can mark embedding properties at load time instead — see
LOAD JSONL ... WITH EMBEDDINGS.
