---
title: "The database and memory for every agent | SurrealDB"
description: "SurrealDB is the database and memory for every agent: it starts on its first query, scales to zero, speaks PostgreSQL and MySQL, and remembers in one query."
url: https://surrealdb.com
---

# The database and memory for every agent

A database for every agent

SurrealDB Earth

Starts on its first query. Speaks PostgreSQL and MySQL.
Scales to zero instantly. Remembers in one query.

[Explore the database](https://surrealdb.com/surrealdb) [Explore Agent Memory](https://surrealdb.com/agent-memory)

**Earth.** Serverless on Cloudflare, with each database running where it is first queried.

**Agent Memory.** Connects and retrieves context wherever your data lives, every fact carrying its source.

**Self-hosted.** The same engine runs on your own servers, embedded in your app, or fully managed in Cloud.

## SurrealDB Earth

[Explore SurrealDB Earth](https://surrealdb.com/earth)

CLI

MCP

`surreal cloud instance create my-agent --region earth`

Copy

Built on Cloudflare.

**Serverless.** Starts on its first query on Cloudflare's network, cold starts in ~300ms and scales to zero instantly.

**Isolated by default.** Each database is its own instance, for as many agents as you need, with no compute billed when idle.

**One query, many Workers.** A query splits across Workers and merges its answer, every leg reading the same point in time.

1. ![Babcock](https://surrealdb.com/assets/static/babcock.lo4rnVg1.svg)
2. ![ING](https://surrealdb.com/assets/static/ing.X3I6S3_V.svg)
3. ![British Airways](https://surrealdb.com/assets/static/british-airways.KEsZiwV-.svg)
4. ![Nvidia](https://surrealdb.com/assets/static/nvidia.DaIEuMil.svg)
5. ![Apple](https://surrealdb.com/assets/static/apple.D5pq4flY.svg)
6. ![SpaceX](https://surrealdb.com/assets/static/spacex.CQJEk-IL.svg)
7. ![Samsung](https://surrealdb.com/assets/static/samsung.CH-vQgnb.svg)
8. ![adidas](https://surrealdb.com/assets/static/adidas.DdTC5qhk.svg)
9. ![Tencent](https://surrealdb.com/assets/static/tencent.paQmLxyy.svg)
10. ![Alibaba](https://surrealdb.com/assets/static/alibaba.B16idgfM.svg)
11. ![PolyAI](https://surrealdb.com/assets/static/poly-ai.c3w_fAg6.svg)
12. ![Later](https://surrealdb.com/assets/static/later.Ds736jFO.svg)
13. ![Verizon](https://surrealdb.com/assets/static/verizon.BI7CajdX.svg)
14. ![Liberty Mutual](https://surrealdb.com/assets/static/liberty-mutual.B7qOU1pd.svg)
15. ![Walmart](https://surrealdb.com/assets/static/walmart.BjDg_Sr8.svg)
16. ![Carrier](https://surrealdb.com/assets/static/carrier.D21gC6NX.svg)
17. ![Saks Fifth Avenue](https://surrealdb.com/assets/static/saks-fifth-avenue.COIDpLSb.svg)
18. ![San Francisco Compute Company](https://surrealdb.com/assets/static/sfcc.B7jlImq4.svg)
19. ![Shield AI](https://surrealdb.com/assets/static/shield-ai.pINZ0KJr.svg)
20. ![Wix](https://surrealdb.com/assets/static/wix.DvHhmoBi.svg)

## SurrealDB and SurrealDB Earth. What every agent gets.

[Explore SurrealDB](https://surrealdb.com/4)

- Scales to zero instantly.
- Remembers in one query.
- Fully transactional. Still ACID.
- Speaks PostgreSQL and MySQL.
- Cold starts on Earth in ~300ms.
- Instance creation time ~500ms.
- Starts on its first query on SurrealDB Earth.
- One engine. Serverless, Cloud or self-hosted.
- Scales to as many agents and users as you need.

## One query. Thousands of compute units. One answer.

A client sends a query to a coordinator, which splits it across SurrealDB Earth cells on Cloudflare. Each cell reads its share of the data from object storage, every leg reading the same point in time, and the results are merged into one answer, transactional throughout. At peak, that is 10+ billion rows per second.

[Explore SurrealDB Earth](https://surrealdb.com/earth)

![A query fanning out from a coordinator across SurrealDB Earth cells to object storage](https://surrealdb.com/assets/static/film-cloudflare-light-poster.CZAge90I.avif)

## Load rises. Earth scales up with it.

Load falls, and Earth scales back down, to zero. Earth starts with one client, and as more arrive it adds database cells to serve them, each handling its share of the transactions against object storage. As the load falls, the cells are removed until nothing is left running, with no idle server costs.

[Explore SurrealDB Earth](https://surrealdb.com/earth)

![Database cells added as transactions climb and removed as they fade](https://surrealdb.com/assets/static/film-transactions-light-poster.Dg4vjAUW.avif)

HOW IT FITS TOGETHER

## A database for every agent. Memory on top. One connected view of everything your application and agents know.

Your application

Entity extraction

Knowledge Graph

Temporal facts

Hybrid retrieval

Documents

Graphs

Vectors

Relations

Time-series

Live queries

Object storageS3 / S3-compatible

WHAT SETS IT APART

## What makes it different

Database

Agent Memory

### [One database.Every data model.](https://surrealdb.com/surrealdb)

SurrealQL unifies SQL, knowledge graphs, vector and full-text search, temporal and key-value queries in one language - on one database, backed by object storage.

\- explore the database

### [Better context.Less overhead.](https://surrealdb.com/surrealdb)

Retrieve more relevant context with fewer calls - helping improve accuracy, reduce latency and avoid wasting LLM tokens on unnecessary data.

\- explore the database

### [One retrieval query.Fewer system hops.](https://surrealdb.com/surrealdb)

Search, graph traversal, filtering and permissions in one retrieval query, so the context stack has fewer systems to cross.

\- explore the database

### [Access control.Built into the data layer.](https://surrealdb.com/surrealdb)

Define permissions at the role, record and field level, so every user, service or agent only sees and changes exactly what it should.

\- explore the database

USE CASES

## What teams build on one engine. With the data model each workload needs.

### [GraphRAG](https://surrealdb.com/solutions/graph-rag)

Database

Retrieval that combines graph traversal with vector search for grounded, connected context.

Explore the database

### [Agent Memory](https://surrealdb.com/agent-memory)

Agent Memory

Persistent, queryable memory for agents - relationships, semantics, and recency in one store.

Explore Agent Memory

### [Knowledge graphs](https://surrealdb.com/use-cases/knowledge-graphs)

Database

Model entities and relationships natively - query structure and meaning together.

Explore the database

### [Temporal facts](https://surrealdb.com/agent-memory/temporal)

Agent Memory

Facts that supersede one another with the history kept, so an agent knows what changed and when.

Explore Agent Memory

### [Digital twins](https://surrealdb.com/use-cases/digital-twins)

Database

Assets, dependencies, telemetry and the agents that reason over them, in one transactional engine.

Explore the database

### [Real-time applications](https://surrealdb.com/use-cases/real-time)

Database

Live queries and change streams, so every client sees a write as it commits.

Explore the database

One SurrealQL query searches vectors, walks the graph, filters documents and ranks full text, and commits it all in one ACID transaction.

CUSTOMER STORIES

## Proven in production

[See more case studies](https://surrealdb.com/casestudies)

### [Three data stores collapsed into one](https://surrealdb.com/customer/samsung)

![Samsung](https://surrealdb.com/assets/static/4c58b81e7b3c9466.C_Hv0eml.svg)

### [An AI assistant for 10,000 technicians](https://surrealdb.com/customer/verizon)

![Verizon](https://surrealdb.com/assets/static/18b99996c689000f.B5PQ-nI9.svg)

### [Nine backend tools consolidated into one](https://surrealdb.com/customer/tencent)

![Tencent](https://surrealdb.com/assets/static/401d8346058682c8.DqM87mst.svg)

### [Low-latency RAG, under the customer's control](https://surrealdb.com/customer/polyai)

![PolyAI](https://surrealdb.com/assets/static/c5fa07c66cd05131.BnC7wHcc.svg)

### [45 million recommendation queries a month](https://surrealdb.com/customer/saks)

![Saks Fifth Avenue](https://surrealdb.com/assets/static/saks-fifth-avenue-white.pDJ9HGmf.svg)

## Your questions, answered

What is SurrealDB?

SurrealDB is a database for every agent. Relational, document, graph, vector and time-series data are native primitives you can query together in one ACID transaction, through SurrealQL or through PostgreSQL and MySQL clients. On SurrealDB Earth, each database starts on its first query and scales to zero immediately when the query ends. Authentication, row-level permissions and live queries are built in.

How is Agent Memory related to the database?

Can I use SurrealDB without Agent Memory?

Does SurrealDB work with my PostgreSQL or MySQL clients?

Can I self-host SurrealDB?

How is SurrealDB licensed?

Can I get started without speaking to sales?

THE PLATFORM

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

Database

Document, graph, vector, time-series and relational in one engine.

![Five data models as dotted tiles: documents, graph, vector, time-series and relational](https://surrealdb.com/assets/static/platform-database.DUdumYDz.avif)

Read more

[Database](https://surrealdb.com/surrealdb)

Agent Memory

What an agent learns, with its source and its time, in the same engine.

![A timeline of remembered facts, each with its source](https://surrealdb.com/assets/static/platform-agent-memory.Cvv8D5Wl.avif)

Read more

[Agent Memory](https://surrealdb.com/agent-memory)

Cloud

Dedicated clusters by region, or serverless on SurrealDB Earth.

![Clusters in three regions on a world map, each running or scaling](https://surrealdb.com/assets/static/platform-cloud.--QZnaVi.avif)

Read more

[Cloud](https://surrealdb.com/cloud)

Studio

Query, explore and design the schema from the browser.

![A SurrealQL query in Studio and the schema graph under it](https://surrealdb.com/assets/static/platform-studio.7ykBFNLq.avif)

Read more

[Studio](https://surrealdb.com/studio)

MCP

Every model that speaks MCP reaches the database and the memory directly.

![Three models connected through MCP to the database and Agent Memory](https://surrealdb.com/assets/static/platform-mcp.D_oH0_wm.avif)

Read more

[MCP](https://surrealdb.com/mcp)

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

## Start with the database, or start with Agent Memory. Both run on one engine. The database is a free account away. Agent Memory is a context in Studio away.

[Explore the database](https://surrealdb.com/surrealdb) [Explore Agent Memory](https://surrealdb.com/agent-memory) [Start on SurrealDB Earth](https://studio.surrealdb.com/current/instances/deploy)

![ISO 27001](https://surrealdb.com/assets/static/iso.BzQy4FFy.svg)

![AICPA SOC 2 Type 2](https://surrealdb.com/assets/static/aicpa-soc.CE_YjqhK.svg)

![Cyber Essentials](https://surrealdb.com/assets/static/cyber-essentials.CtbmbYfL.svg)

![GDPR](https://surrealdb.com/assets/static/gdpr.IadR7loS.svg)

![Cyber Essentials Plus](https://surrealdb.com/assets/static/cyber-essentials-plus.Cl5P05xe.svg)

```json
{"@context":"https://schema.org","@type":"Organization","@id":"https://surrealdb.com/#organization","name":"SurrealDB","url":"https://surrealdb.com","logo":"https://surrealdb.com/assets/static/logo.BG7_TG2b.svg","description":"SurrealDB is a database for every agent. It starts on its first query, scales to zero when idle, speaks PostgreSQL and MySQL, and remembers in one query.","foundingDate":"2022","legalName":"SurrealDB Ltd","identifier":{"@type":"PropertyValue","propertyID":"GB-COH","value":"13615201"},"address":{"@type":"PostalAddress","streetAddress":"3rd Floor, 1 Ashley Road","addressLocality":"Altrincham","addressRegion":"Cheshire","postalCode":"WA14 2DT","addressCountry":"GB"},"contactPoint":[{"@type":"ContactPoint","contactType":"customer support","email":"support@surrealdb.com","url":"https://surrealdb.com/contact","availableLanguage":"English"},{"@type":"ContactPoint","contactType":"sales","email":"info@surrealdb.com","url":"https://surrealdb.com/contact","availableLanguage":"English"},{"@type":"ContactPoint","contactType":"security","email":"security@surrealdb.com","url":"https://surrealdb.com/.well-known/security.txt","availableLanguage":"English"},{"@type":"ContactPoint","contactType":"legal","email":"legal@surrealdb.com","url":"https://surrealdb.com/legal","availableLanguage":"English"}],"hasCertification":[{"@type":"Certification","name":"SOC 2 Type 2"},{"@type":"Certification","name":"GDPR"},{"@type":"Certification","name":"Cyber Essentials Plus"},{"@type":"Certification","name":"ISO 27001"}],"owns":[{"@type":"SoftwareApplication","name":"SurrealDB","url":"https://surrealdb.com/surrealdb"},{"@type":"SoftwareApplication","name":"Agent Memory","url":"https://surrealdb.com/agent-memory"}],"knowsAbout":["multi-model databases","document databases","graph databases","vector search","time-series databases","SurrealQL","Agent Memory","real-time databases","embedded databases","AI agent database","graph ontology","distributed database","knowledge graphs","distributed transaction protocols","highly-scalable databases"],"sameAs":["https://www.wikidata.org/wiki/Q124316308","https://github.com/surrealdb/surrealdb","https://twitter.com/surrealdb","https://www.youtube.com/@surrealdb","https://www.linkedin.com/company/surrealdb","https://discord.gg/surrealdb","https://www.reddit.com/r/surrealdb","https://www.instagram.com/surrealdb","https://medium.com/surrealdb","https://dev.to/surrealdb"]}
```

```json
{"@context":"https://schema.org","@type":"WebSite","name":"SurrealDB","url":"https://surrealdb.com","potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://surrealdb.com/docs?search={search_term_string}"},"query-input":"required name=search_term_string"}}
```

```json
{"@context":"https://schema.org","@type":"SoftwareApplication","name":"SurrealDB","applicationCategory":"DeveloperApplication","operatingSystem":"Linux, macOS, Windows","url":"https://surrealdb.com/surrealdb","description":"A database for every agent. It starts on its first query, scales to zero when idle, speaks PostgreSQL and MySQL, and remembers in one query.","offers":{"@type":"Offer","price":"0","priceCurrency":"USD"}}
```

```json
{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What is SurrealDB?","acceptedAnswer":{"@type":"Answer","text":"SurrealDB is a database for every agent. Relational, document, graph, vector and time-series data are native primitives you can query together in one ACID transaction, through SurrealQL or through PostgreSQL and MySQL clients. On SurrealDB Earth, each database starts on its first query and scales to zero immediately when the query ends. Authentication, row-level permissions and live queries are built in."}},{"@type":"Question","name":"How is Agent Memory related to the database?","acceptedAnswer":{"@type":"Answer","text":"Agent Memory is a separate SurrealDB product built on the database. It turns conversations, documents and business events into a knowledge graph with provenance, using the database's own relationships and permissions rather than a second store alongside it."}},{"@type":"Question","name":"Can I use SurrealDB without Agent Memory?","acceptedAnswer":{"@type":"Answer","text":"Yes. SurrealDB, the database, is a complete product on its own, and is in production at Samsung, Verizon, Tencent and Saks Fifth Avenue. Agent Memory is an addition for teams building agents that need persistent, governed context."}},{"@type":"Question","name":"Does SurrealDB work with my PostgreSQL or MySQL clients?","acceptedAnswer":{"@type":"Answer","text":"Yes. SurrealDB speaks the PostgreSQL and MySQL wire protocols, so most existing drivers, tools and ORMs can connect and run queries without changes. Some types and ORM schema definitions behave differently, and the documentation lists the details."}},{"@type":"Question","name":"Can I self-host SurrealDB?","acceptedAnswer":{"@type":"Answer","text":"Yes. Run it on your own infrastructure, embed it inside your application, use SurrealDB Cloud, managed for you in the provider and region you choose, or run it serverless on SurrealDB Earth. The same queries work across all of them."}},{"@type":"Question","name":"How is SurrealDB licensed?","acceptedAnswer":{"@type":"Answer","text":"The SurrealDB engine is free to use, modify and self-host, including in production. The one thing its licence (BSL 1.1) reserves is running SurrealDB as a database service for third parties, where they create and manage their own schemas or tables. Each version becomes Apache 2.0 no later than four years after its release, and the SDKs and tools are open source under Apache 2.0 or MIT from day one."}},{"@type":"Question","name":"Can I get started without speaking to sales?","acceptedAnswer":{"@type":"Answer","text":"Yes for the database: create a free account and start building, or start on SurrealDB Earth's free tier with no card. Agent Memory is live too: create a context in Studio and start on the free Sandbox. Enterprise support, security review and procurement are there when you need them."}}]}
```
