---
title: "Get memory graph for visualization"
description: "One graph for visualization: entity nodes plus their ``RELATES_TO`` facts.\n\nEvery entity with a live fact in scope appears, whatever produced it — a\nchat turn, an agent-tool write, or an API ingest of any ``type``.\n``source_description`` is a provenance label and never decides what is\nshown, and no entity type is hidden. Episodes are not nodes here; they\nstay stored verbatim and come back through\n``GET /memories/export?include_episodes=true``.\n\n``cursor`` paginates edges. Namespace views (``graph_id``) require a\nservice token."
---

> Documentation Index
> Fetch the complete documentation index at: https://truememory-docs.mvstg.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: AI Gateway API › Memory

`GET /memories/graph`

One graph for visualization: entity nodes plus their ``RELATES_TO`` facts.

Every entity with a live fact in scope appears, whatever produced it — a
chat turn, an agent-tool write, or an API ingest of any ``type``.
``source_description`` is a provenance label and never decides what is
shown, and no entity type is hidden. Episodes are not nodes here; they
stay stored verbatim and come back through
``GET /memories/export?include_episodes=true``.

``cursor`` paginates edges. Namespace views (``graph_id``) require a
service token.

## Authentication

- `HTTPBearer`, http, header `Authorization`

## Query parameters

- `agent_id` (`get_memory_graph.query.agent_id`; any of, optional)
  - any of: `string`, `null`
- `graph_id` (`get_memory_graph.query.graph_id`; any of, optional) — Optional. Render a shared namespace instead of the user's own graph. Requires a service token; mutually exclusive with agent_id; no subject user needed.
  - any of: `string`, `null`
- `limit` (`get_memory_graph.query.limit`; integer, optional)
  - min 1; max 500; default `200`
- `cursor` (`get_memory_graph.query.cursor`; any of, optional) — Optional. Opaque keyset cursor over edges: pass back the previous page's next_cursor verbatim. Format is '<iso-datetime>|<edge-id>' — the id half is what keeps edges sharing a timestamp from being skipped, so do not truncate it. Malformed values return 400 VALIDATION_ERROR.
  - any of: `string`, `null`
- `visibility` (`get_memory_graph.query.visibility`; any of, optional) — Optional. Narrow the graph to nodes with this visibility; an edge survives only when both its endpoints do. Omit for the full graph.
  - any of: `string`, `null`

## Header parameters

- `X-On-Behalf-Of` (`get_memory_graph.header.X-On-Behalf-Of`; any of, optional)
  - any of: `string`, `null`
- `X-External-User-Id` (`get_memory_graph.header.X-External-User-Id`; any of, optional)
  - any of: `string`, `null`
- `X-App-Id` (`get_memory_graph.header.X-App-Id`; any of, optional)
  - any of: `string`, `null`

## Code samples

### cURL

```bash
curl --request GET \
  --url https://truememory-api.mvstg.com/memories/graph \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://truememory-api.mvstg.com/memories/graph';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://truememory-api.mvstg.com/memories/graph"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

Successful Response

#### Example

```json
{
  "nodes": [
    {
      "id": "string",
      "name": "string",
      "summary": "string",
      "summary_raw": "string",
      "labels": [
        "string"
      ],
      "visibility": "private",
      "attributes": {},
      "created_at": "string"
    }
  ],
  "edges": [
    {
      "id": "string",
      "source": "string",
      "target": "string",
      "label": "string",
      "fact": "string",
      "created_at": "string",
      "valid_at": "string"
    }
  ],
  "next_cursor": "string"
}
```

- `nodes` (`get_memory_graph.response.200.nodes`; array<object>, required)
  - `id` (`get_memory_graph.response.200.nodes.id`; string, required)
  - `name` (`get_memory_graph.response.200.nodes.name`; string, required)
  - `summary` (`get_memory_graph.response.200.nodes.summary`; string, required) — Humanized summary when available, else the raw one.
  - `summary_raw` (`get_memory_graph.response.200.nodes.summary_raw`; string, required)
  - `labels` (`get_memory_graph.response.200.nodes.labels`; array<string>, required) — Entity types; never empty.
  - `visibility` (`get_memory_graph.response.200.nodes.visibility`; string, required)
    - one of `"private"`, `"public"`
  - `attributes` (`get_memory_graph.response.200.nodes.attributes`; object, required) — Every other property the entity carries; keys vary by type.
  - `created_at` (`get_memory_graph.response.200.nodes.created_at`; any of, required)
    - any of: `string`, `null`
- `edges` (`get_memory_graph.response.200.edges`; array<object>, required)
  - `id` (`get_memory_graph.response.200.edges.id`; string, required)
  - `source` (`get_memory_graph.response.200.edges.source`; string, required) — Node id the fact starts from.
  - `target` (`get_memory_graph.response.200.edges.target`; string, required) — Node id the fact points to.
  - `label` (`get_memory_graph.response.200.edges.label`; string, required)
  - `fact` (`get_memory_graph.response.200.edges.fact`; string, required)
  - `created_at` (`get_memory_graph.response.200.edges.created_at`; any of, required)
    - any of: `string`, `null`
  - `valid_at` (`get_memory_graph.response.200.edges.valid_at`; any of, required)
    - any of: `string`, `null`
- `next_cursor` (`get_memory_graph.response.200.next_cursor`; any of, required) — Pass back as `cursor` for the next page of edges; null on the last page.
  - any of: `string`, `null`

### 422

Validation Error

#### Example

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
```

- `detail` (`get_memory_graph.response.422.detail`; array<object>, optional)
  - `loc` (`get_memory_graph.response.422.detail.loc`; array<any of>, required)
    - any of: `string`, `integer`
  - `msg` (`get_memory_graph.response.422.detail.msg`; string, required)
  - `type` (`get_memory_graph.response.422.detail.type`; string, required)
  - `input` (`get_memory_graph.response.422.detail.input`; unknown, optional)
  - `ctx` (`get_memory_graph.response.422.detail.ctx`; object, optional)


Source: https://truememory-docs.mvstg.com/api/memories/graph/list/index.md
