Skip to content
NEW BLOG

Using Surrealism to build your own extensions

Read blog

1/2

SurrealDB vs. memory middleware

Mem0, Zep, Letta, and other memory middleware add another layer between your agent and storage. The fragmented memory tax is why memory should live in the database.

Memory middleware sits between the agent and the database, introducing consistency gaps, added latency, separate permissions, and operational burden. Every memory operation becomes a round trip through another system with its own failure modes.

Spectron eliminates the middleware layer entirely - memory lives in the database.

THE LANDSCAPE

A growing category with a shared limitation

A growing number of agent memory middleware products have emerged in the last year. Each product solves a real developer pain point, but they all share the same architectural limitation: memory lives outside the database, not inside it.

Mem0

LLM-driven memory extraction and consolidation with optional graph storage. Excellent developer experience, but built on fragmented infrastructure underneath.

Zep

Long-term memory for assistants with temporal knowledge graphs and entity extraction. Adds structure, but as a separate service with its own consistency model.

Letta (MemGPT)

Self-editing memory framework where agents manage their own context window and long-term storage. Innovative, but memory lives outside the transactional boundary.

Cognee

Open-source framework for building knowledge graphs and retrieval pipelines from unstructured data. Graph construction is valuable, but disconnected from application state.

LangMem

LangChain library for persisting and retrieving agent memories within LangGraph workflows. Tightly coupled to one framework with no standalone persistence guarantees.

Memori & Synix

Enterprise memory fabrics with classification, semantic search, and provenance tracking. Rich features, but still middleware between the agent and the database.

THE FRAGMENTED MEMORY TAX

Middleware hides the problem. It doesn't solve it.

App state

User session

Vector DB

Embeddings

Graph DB

Relations

Doc store

Documents

Auth

Identity

Data fragments at every system boundary

Agent

Vector DB

Graph DB

Doc store

Auth

Total

Cumulative latency

Consistency gaps

Memory middleware sits between the agent and the database. Writes to memory and writes to state can diverge - no atomicity across systems.

Latency

Every memory operation is a round trip through middleware. Read from memory, then read from DB - two hops instead of one.

Operational burden

Another service to deploy, monitor, and secure. Another failure mode. Another set of credentials to manage.

Separate permissions

Memory middleware has its own auth. Your database has its own. Two permission models to keep in sync.

Single transaction

Vector DB

Write embedding

Graph DB

Write relation

committed

inconsistent state

rolled back

Vector DB

Similarity search

auth

config

monitor

Graph DB

Relationship store

auth

config

monitor

Doc store

Raw document index

auth

config

monitor

Auth service

Identity & tokens

auth

config

monitor

Cache layer

Hot key store

auth

config

monitor

Five systems. Five auth configs. Five things to scale, secure, and keep alive.

AGENT FRAMEWORKS

Framework memory is not database memory

LangChain, LlamaIndex, CrewAI, AutoGen, and Semantic Kernel all include memory modules. These are useful for prototyping, but they delegate persistence to external stores and offer no transactional guarantees across memory and application state.

Framework memory

Memory modules in agent frameworks provide convenience abstractions, but persistence depends on whatever backend is plugged in. No ACID, no unified permissions, no temporal awareness.

Database-native memory

Spectron provides the same memory capabilities - entity extraction, knowledge graphs, temporal facts - but as a first-class database feature with ACID transactions and unified governance.

THE ALTERNATIVE

ACID transactions across every data model

ACID memory

Spectron memory lives in SurrealDB. Agent memory and application state commit in one transaction - no divergence.

One permission model

RBAC and record-level permissions apply to memory and data alike. One auth, one policy.

No middleware

Agents write directly to the database. One round trip. No extra latency, no extra failure modes.

Vertical stack

SurrealDB + Spectron. Structured context and persistent memory in one deployment. One operational surface.

GET STARTED

Memory without the memory tax

Spectron eliminates the fragmented memory tax entirely. No middleware, no consistency gaps, no extra infrastructure.