NEW

SurrealDB 4 is here, introducing SurrealDB Earth and SurrealDS!

Learn more

GraphRAG, in one engine

Traversal. Typed edges are records, so retrieval walks from a document to the entities around it.
Vector search. HNSW vectors and BM25 full-text beside the graph, combined by reciprocal rank fusion in one engine.
One query. Traversal, vectors and ranking together in SurrealQL, over one consistent snapshot per agent turn.

Retrieval that understands relationships.

Traverse, not just match

Typed edges are records, so retrieval walks from a document to the entities around it.

Hybrid ranking built in

HNSW vectors, BM25 full-text and reciprocal rank fusion, natively in SurrealQL.

One round trip

One engine, one query and one consistent snapshot on every agent turn.

HOW IT WORKS

Three retrieval modes, one query. Embed, recall, rank, then walk the graph.

Embed the question, fuse vector recall with keyword relevance, then walk from the winning passages to the entities that ground the answer.

1-- Embed the question once
2LET $q = "why did the deployment fail on Tuesday?";
3LET $vec = fn::embed($q);
4
5-- Hybrid recall: vector similarity fused with BM25
6LET $passages = search::rrf([
7 (SELECT id, title,
8 (1 - vector::distance::knn()) AS vec_score
9 FROM document
10 WHERE embedding <|10,40|> $vec),
11 (SELECT id, title,
12 search::score(1) AS bm25_score
13 FROM document
14 WHERE content @1@ $q
15 ORDER BY bm25_score DESC)
16], 10);
17
18-- Ground the winners: walk to the entities around them
19SELECT id, title,
20 ->mentions->entity.* AS entities,
21 ->mentions->entity->relates_to->entity.* AS related
22FROM $passages;

MANAGED OR HAND-BUILT

Build it yourself, or let Agent Memory build it. The same pipeline, hand-built or managed.

Everything on this page is in the database today: you design the schema, own the graph and compose the queries. Agent Memory runs the same pipeline for you, extracting entities, building the knowledge graph and serving hybrid retrieval.

Your questions,answered

Retrieval-augmented generation grounded in a knowledge graph. Retrieval follows the relationships between entities, so the model receives connected context: who did what, when, and how it relates to the question.

THE PLATFORM

Everything an application and its agents know. Five surfaces, one engine.

IN PRODUCTION

Trusted at scale. Samsung, Nvidia, Verizon, Tencent, and Walmart run on SurrealDB.

14,000+

Developers building on SurrealDB Cloud

4M+

Developers building on SurrealDB worldwide

FROM THE TEAMS

SurrealDB gives us a foundation where we can unify semantic search, knowledge graphs, and AI-driven decision making without stitching together multiple systems. Collapsing responsibility into SurrealDB has become our default engineering posture.
Justin Foley

VP of Engineering, Later

GET STARTED

Ground your retrieval. Graph traversal, vector search and full-text ranking in one engine.

ISO 27001
AICPA SOC 2 Type 2
Cyber Essentials
GDPR
Cyber Essentials Plus