Skip to content
NEW BENCHMARKS

SurrealDB 3.x by the numbers

View

1/3

Build context-aware AI agents

Agents fail because of context, not models. SurrealDB + Spectron give AI agents structured context, persistent memory, and transactional consistency in one system.

THE PROBLEM

The context wall

Every AI team hits the same wall. The model is capable, but the agent cannot remember what happened two turns ago, cannot connect a user preference to a product entity, and cannot guarantee that concurrent writes stay consistent.

Today's teams assemble five or six systems - a vector database, a document store, a graph database, a cache, a queue, and a memory middleware layer - then spend months writing glue code to keep them consistent. Every seam is a place where context leaks.

Context leakage

When data flows between separate systems, agents lose context. Relationships, history, and metadata get fragmented.

No atomicity

Without unified transactions, an agent can update memory in one system but fail to update state in another.

Latency spikes

Multi-system pipelines add round trips. Each hop introduces latency that compounds under load.

Operational overhead

Five systems means five failure modes, five monitoring setups, five sets of credentials to manage.

THE SOLUTION

The read-think-write loop

Agents operate in a continuous cycle: read context, reason over it, and write results back. The context layer keeps the entire loop inside one transactional system.

READ

Graph traversal, vector search, and temporal facts - one SurrealQL statement, one round trip.

SurrealQL

Multi-model query

Graph

Vector

Temporal

Unified result set

THINK

Documents, relationships, embeddings, and history arrive together. The agent reasons over complete context.

Result set

Multi-model query output

Documents

Relations

Vectors

History

Complete context

WRITE

Persist decisions, update entities, trigger events - one ACID transaction, no partial writes.

BEGIN TRANSACTION

ACID transaction boundary

Update

Create

Trigger

COMMITTED

CONTEXT ENGINEERING

Context engineering in one query

SurrealQL lets you combine graph traversal, vector similarity, structured filters, and temporal queries in a single statement. One round trip gives the agent everything it needs.

1-- Context engineering: combine graph, vector, and temporal data
2LET $user = user:jaime;
3LET $query_vec = fn::embed("What products does this user like?");
4
5SELECT
6 ->purchased->product AS purchase_history,
7 ->reviewed->product[WHERE vector::similarity::cosine(embedding, $query_vec) > 0.8] AS relevant_products,
8 ->preferences[WHERE valid_at <= time::now()] AS current_preferences
9FROM ONLY $user;

MULTI-AGENT

Multi-agent coordination

Multiple agents share the same knowledge graph and memory. Coordination happens through shared context with ACID guarantees - no message passing, no race conditions.

Shared memory

Agents read from and write to the same Spectron memory graph. Knowledge accumulates across the team.

ACID consistency

Concurrent writes from multiple agents are serialised. No conflicts, no lost updates.

Event-driven handoffs

Live queries and events trigger downstream agents when relevant data changes.

Unified permissions

RBAC and record-level permissions apply consistently across all agents accessing the system.

THE STACK

SurrealDB + Spectron

SurrealDB provides the multi-model database for structured context. Spectron provides persistent memory for AI agents. Together, they form the context layer - one stack, one transaction boundary, one permission model.

Structured context

SurrealDB stores documents, graphs, vectors, time-series, and relational data in one engine.

Learn more

Documents
Graphs
Vectors
Time-series

One engine

Persistent memory

Spectron provides knowledge graphs, entity extraction, and temporal facts for agent memory.

Learn more

Knowledge graph

Entities
Relations

Memory layer

Temporal facts
Entity extraction

Agent memory

Hybrid retrieval

Combine vector similarity, graph traversal, and structured filters in a single query.

Learn more

Single query

SELECT ..., vector::similarity(...), ->relates->

Vector
Graph
Filter

One result set

Managed infrastructure

Deploy the full stack in SurrealDB Cloud - fully managed, scale on demand.

Learn more

SurrealDB Cloud

SurrealDB

Active

Spectron

Active

Storage layer

Active

WORKS WITH YOUR FRAMEWORK

The context layer beneath your orchestrator

LangGraph, CrewAI, and AutoGen orchestrate agent logic - the control flow. SurrealDB provides the persistent context layer beneath - the data, the memory, the knowledge graph. They are complementary. Connect through MCP, SDKs, or direct API calls.

FREQUENTLY ASKED QUESTIONS

AI agents

GET STARTED

Build context-aware AI agents

The context layer for AI agents. Structured context, persistent memory, elastic storage. One stack.

SamsungNVIDIAAppleVerizonTencent

SOC 2 Type 2

GDPR

Cyber Essentials Plus

ISO 27001

SurrealDB

The context layer for AI agents.

Documents, graphs, vectors, time-series, and memory - in one transaction, one query, one deployment.

Explore with AI

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