---
title: "Knowledge graph | Agent Memory | SurrealDB"
description: "Agent Memory keeps one entity and relation graph for conversations and documents, with every fact carrying its source."
url: https://surrealdb.com/agent-memory/knowledge-graph
---

KNOWLEDGE GRAPH

# Memory that connects

[Start in Studio](https://studio.surrealdb.com/current/contexts) [Technical deep-dive](https://surrealdb.com/agent-memory/deep-dive)

**Shared.** One entity and relation graph for turns and documents.

**Linked.** Chunks sit in sections, and documents link by keyword and citation.

**Cited.** Facts from turns and documents cite the passage they came from.

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)

01 |ONE GRAPH

## One graph for turns and documents. Every fact cites its source.

Conversational turns and parsed documents write to the same entity and relation graph. Each fact keeps a source object, so a fact from a turn or a document resolves to the passage it came from.

chunk

text

embedding vector

passage_id

source

kind

ref

span

trust

source

attribute

key

value

confidence

valid_from

source

entity

type

name

memory_category

relates_to

label

valid_from

valid_until

entity

type

name

memory_category

02 |WHAT YOU GET

## Entities, relations and passages. Joined in one graph.

### [Directed relations](https://surrealdb.com/agent-memory/deep-dive)

A relation links two entities and carries its own valid_from and valid_until.

Read more

### [Turns and documents together](https://surrealdb.com/agent-memory/deep-dive)

Conversations and documents write to the same graph, so facts from either attach to the same entities.

Read more

### [Documents parsed](https://surrealdb.com/agent-memory/deep-dive)

PDFs, images, audio and video are parsed, chunked and extracted into facts.

Read more

### [Linked by section and keyword](https://surrealdb.com/agent-memory/recall)

Chunks sit in sections, and documents are linked by keyword and by citation, so related passages connect.

Read more

### [Cited to the passage](https://surrealdb.com/agent-memory/provenance)

Each fact extracted from a document is cited back to its source passage.

Read more

### [Vectors beside the graph](https://surrealdb.com/agent-memory/recall)

Embeddings sit on passages and sections in the same database as the graph, so graph and vector signals rank together.

Read more

03 |WHY IT MATTERS

## What a vector store cannot say. Which entity a fact is about, and where it came from.

Shared

### One graph across sources

A fact learnt in conversation and a fact extracted from a document attach to the same entity, so recall can walk from one to the other.

Cited

### A source object on every fact

Each fact stores its source as a kind and a trust level, with a reference and span back to the passage, or the facts it was derived from, so a citation points at its origin.

Engine

### One transaction per fact

Each fact, its edges and its history are written in one transaction, so a partial write never lands.

Matching

### Entities are matched by name

Differently named references to the same entity are not merged automatically; that is a deliberate trade-off.

## Keep exploring

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

The attributes, relations and actions in the graph.

### [Recall](https://surrealdb.com/agent-memory/recall)

How graph connections feed retrieval.

### [Technical deep-dive](https://surrealdb.com/agent-memory/deep-dive)

The graph model in full.

GET STARTED

## Give your agents connected memory. One graph for conversations and documents, with every fact carrying its source.

[Start in Studio](https://studio.surrealdb.com/current/contexts) [Talk to sales](https://surrealdb.com/contact/sales)

![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 the context and memory layer for AI agents. A multi-model database for documents, graphs, vectors, and time-series.","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","context layer","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":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://surrealdb.com"},{"@type":"ListItem","position":2,"name":"Agent Memory","item":"https://surrealdb.com/agent-memory"},{"@type":"ListItem","position":3,"name":"Knowledge graph","item":"https://surrealdb.com/agent-memory/knowledge-graph"}]}
```
