---
title: "Warm the user's memory cache"
description: "Warm the user's memory cache before the first chat request.\n\nTIE uses a multi-tier retrieval architecture.  The fastest retrieval\nhappens from a hot in-memory cache.  After several minutes of inactivity\nthe cache expires and the next request falls back to a slower database\nquery while a background job repopulates the cache.\n\nCall this endpoint when the user logs in or opens your app to\nproactively load their knowledge graph into cache so the first\nchat request is fast.\n\nA user token may only warm its own cache; naming another user's id\nreturns 403.  Service principals may name any user, as they do elsewhere."
---

> 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

`POST /memories/graph/{user_id}/warm`

Warm the user's memory cache before the first chat request.

TIE uses a multi-tier retrieval architecture.  The fastest retrieval
happens from a hot in-memory cache.  After several minutes of inactivity
the cache expires and the next request falls back to a slower database
query while a background job repopulates the cache.

Call this endpoint when the user logs in or opens your app to
proactively load their knowledge graph into cache so the first
chat request is fast.

A user token may only warm its own cache; naming another user's id
returns 403.  Service principals may name any user, as they do elsewhere.

## Authentication

- `HTTPBearer`, http, header `Authorization`

## Path parameters

- `user_id` (`warm_user_cache.path.user_id`; string, required)

## Query parameters

- `agent_id` (`warm_user_cache.query.agent_id`; any of, optional)
  - any of: `string`, `null`

## Header parameters

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

## Code samples

### cURL

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

### TypeScript

```typescript
const url = 'https://truememory-api.mvstg.com/memories/graph/<user_id>/warm';
const options = {method: 'POST', 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/<user_id>/warm"

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

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

print(response.text)
```

## Responses

### 200

Successful Response

#### Example

```json
{
  "entities": [
    {
      "name": "string",
      "summary": "string"
    }
  ],
  "facts": [
    "string"
  ]
}
```

- `entities` (`warm_user_cache.response.200.entities`; array<object>, required) — Up to 15 entities.
  - `name` (`warm_user_cache.response.200.entities.name`; string, required)
  - `summary` (`warm_user_cache.response.200.entities.summary`; string, required)
- `facts` (`warm_user_cache.response.200.facts`; array<string>, required) — Up to 15 facts.

### 422

Validation Error

#### Example

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

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


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