Skip to content
NEW

Introducing SurrealDB Studio, the new official app of SurrealDB

Learn more

1/3

GRAPH AND VECTOR

Graph and vector, one query

Model relationships as native graph edges and search meaning with HNSW vector indexes - in the same database, over the same records. Traverse connections and rank by similarity in a single SurrealQL statement, with structured filters narrowing the set first.

01 |CONNECTED DATA

Relationships and similarity, together

Edges are full documents you traverse with arrow syntax; vectors are an index on the same table. Because both live in one engine, one query can walk the graph and rank by meaning.

GRAPH RELATIONSHIPS

Edges are records you traverse

RELATE connects two records through an edge that carries its own fields. Arrow syntax walks those connections without a join.

RELATE customer:alice->purchased->product:widget_pro
SET quantity = 2, date = time::now(), source = 'web';

SELECT ->purchased[WHERE date > time::now() - 30d]->product.name
FROM customer:alice;

VECTOR SEARCH

Similarity on the same records

Define an HNSW index on a field of embeddings, then rank by distance - with a structured WHERE clause scoping the candidates before the vector search runs.

DEFINE INDEX product_embedding ON product
FIELDS embedding HNSW DIMENSION 1536 DIST COSINE;

SELECT id, name, vector::distance::knn() AS distance
FROM product
WHERE category = 'tools'
AND embedding <|10,40|> $query_embedding
ORDER BY distance;

A graph database and a vector database in one

Native relationships, approximate-nearest-neighbour search, and full-text ranking compose in a single query language over a single copy of your data.

02 |ONE ENGINE

No vector store bolted to a graph store

The usual stack stitches a graph database, a vector database, and a document store together, then syncs them. SurrealDB makes all three the same records, queried the same way.

One query, both models

Traverse relationships and rank by similarity in a single statement, instead of querying two systems and merging results in application code.

No sync to drift

There is no pipeline copying rows into a separate vector index that can fall behind or disagree with the source.

Lower latency

Filter, traverse, and rank happen in one engine, in one pass, without a network hop between stores.

Keep exploring

GET STARTED

Query relationships and meaning together

Traverse the graph and rank by vector similarity in one SurrealQL query, over one copy of your data.

SamsungNVIDIAAppleVerizonTencent

SOC 2 Type 2

GDPR

Cyber Essentials Plus

ISO 27001

SurrealDB

The unified data layer for AI

Graph, vector, document, and relational in one engine.
Agent Memory that connects and retrieves context wherever your data lives.

Explore with AI

Stay in the loop

Tutorials, AI agent recipes, and product updates, every two weeks.

Independently verified

SOC 2 Type 2

GDPR

Cyber Essentials Plus

ISO 27001

Trust Centre

Copyright © 2026 SurrealDB Ltd. Registered in England and Wales. Company no. 13615201

Registered address: 3rd Floor 1 Ashley Road, Altrincham, Cheshire, WA14 2DT, United Kingdom

Trading address: Huckletree Oxford Circus, 213 Oxford Street, London, W1D 2LG, United Kingdom