---
title: "Warm the user's memory cache"
description: "Prefetch the user's memory into cache so the next chat turn skips the\nlookup.\n\n**Deprecated** — use ``POST /memories/graph/{user_id}/warm``, which does\nthe same work and is scoped to the user rather than an agent."
---

> 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.

> **Deprecated.**

Path: AI Gateway API › Memory

`POST /context/{agent_id}`

Prefetch the user's memory into cache so the next chat turn skips the
lookup.

**Deprecated** — use ``POST /memories/graph/{user_id}/warm``, which does
the same work and is scoped to the user rather than an agent.

## Authentication

- `HTTPBearer`, http, header `Authorization`

## Path parameters

- `agent_id` (`prefetch_context.path.agent_id`; string, required)

## Header parameters

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

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://truememory-api.mvstg.com/context/<agent_id>' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://truememory-api.mvstg.com/context/<agent_id>';
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/context/<agent_id>"

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` (`prefetch_context.response.200.entities`; array<object>, required) — Up to 15 entities.
  - `name` (`prefetch_context.response.200.entities.name`; string, required)
  - `summary` (`prefetch_context.response.200.entities.summary`; string, required)
- `facts` (`prefetch_context.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` (`prefetch_context.response.422.detail`; array<object>, optional)
  - `loc` (`prefetch_context.response.422.detail.loc`; array<any of>, required)
    - any of: `string`, `integer`
  - `msg` (`prefetch_context.response.422.detail.msg`; string, required)
  - `type` (`prefetch_context.response.422.detail.type`; string, required)
  - `input` (`prefetch_context.response.422.detail.input`; unknown, optional)
  - `ctx` (`prefetch_context.response.422.detail.ctx`; object, optional)


Source: https://truememory-docs.mvstg.com/api/context/create/index.md
