Skip to content
NEW

Introducing SurrealDB Studio, the new official app of SurrealDB

Learn more

1/4

GraphRAG, in one engine

Flat vector search returns disconnected chunks. GraphRAG grounds retrieval in the relationships between your entities - and SurrealDB runs the traversal, the vector search, and the ranking in a single query.

WHY GRAPHRAG

Retrieval that understands relationships

A vector store can tell you which chunks look similar to a question. It cannot tell you how those chunks relate: which customer raised the ticket, which system the incident touched, which decision superseded which. GraphRAG keeps that structure in the retrieval path, so agents answer from connected context rather than isolated fragments.

Traverse, don't just match

Typed graph edges are first-class records. Retrieval walks from a matched document to the entities, decisions, and events around it in the same query. No second system, no join gymnastics.

Hybrid ranking built in

HNSW vector indexes and BM25 full-text search live beside your operational data. Combine semantic similarity, keyword relevance, and reciprocal rank fusion natively in SurrealQL.

One round trip

No stitching a vector database to a graph database and reconciling results in application code. One engine, one query, one consistent snapshot, and lower latency on every agent turn.

HOW IT WORKS

Three retrieval modes, one SurrealQL query

Embed the question, recall semantically similar passages, rank them against keyword relevance, then walk the graph from the winners to the entities that ground the answer.

-- Embed the question once
LET $q = "why did the deployment fail on Tuesday?";
LET $vec = fn::embed($q);

-- Hybrid recall: vector similarity fused with BM25
LET $passages = search::rrf([
(SELECT id, title,
(1 - vector::distance::knn()) AS vec_score
FROM document
WHERE embedding <|10,40|> $vec),
(SELECT id, title,
search::score(1) AS bm25_score
FROM document
WHERE content @1@ $q
ORDER BY bm25_score DESC)
], 10);

-- Ground the winners: walk to the entities around them
SELECT id, title,
->mentions->entity.* AS entities,
->mentions->entity->relates_to->entity.* AS related
FROM $passages;

MANAGED OR HAND-BUILT

Build GraphRAG yourself, or let agent memory build it for you

Everything on this page is available in the database today: you design the schema, own the graph, and compose the queries. Agent Memory, our agent memory layer in early access, runs the same pipeline for you - extracting entities, building the knowledge graph, and serving hybrid retrieval from your conversations, documents, and systems.

FREQUENTLY ASKED QUESTIONS

GraphRAG

GET STARTED

Ground your retrieval

Graph traversal, vector search, and full-text ranking in one engine. Start with the database, or join the early access for managed agent memory.

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