> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bland.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Memory Context

> Retrieve the full memory context for a contact scoped to a persona or agent number. Returns everything the agent sees at the start of a conversation: summary, facts, recent messages, entities, and open items.

### Headers

**authorization** `string` *required*

Your API key for authentication.

### Query Parameters

**contact\_id** `string` *required*

The unique identifier of the contact.

**persona\_id** `string`

The persona ID for memory scoping. Either `persona_id` or `agent_number` is required.

**agent\_number** `string`

The agent phone number for memory scoping. Either `persona_id` or `agent_number` is required.

### Response

**data** `object`

The memory context object.

**data.contact\_id** `string`

The contact ID this memory belongs to.

**data.recentMessages** `array`

Array of recent messages from the sliding window (cross-channel).

**data.recentMessages\[].role** `string`

Message role: "user" or "assistant".

**data.recentMessages\[].content** `string`

Message content.

**data.recentMessages\[].channel** `string`

Channel the message came from: "call" or "sms".

**data.recentMessages\[].timestamp** `string`

ISO timestamp when the message was recorded.

**data.summary** `string`

Rolling summary of interactions with this contact.

**data.contactFacts** `object`

Structured facts about the contact (key-value pairs).

**data.entities** `array`

Array of extracted entities associated with this contact.

**data.openItems** `array`

Array of open items or pending tasks for this contact.

**errors** `null`

Error array (null on success).

```json Response theme={null}
{
  "data": {
    "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
    "recentMessages": [
      {
        "role": "user",
        "content": "Has my order shipped yet?",
        "channel": "sms",
        "timestamp": "2025-07-23T09:10:00.000Z"
      },
      {
        "role": "assistant",
        "content": "Yes, order #8821 shipped this morning. Expected delivery is Friday July 25.",
        "channel": "sms",
        "timestamp": "2025-07-23T09:10:05.000Z"
      }
    ],
    "summary": "Customer called about order #8821 which was delayed. Follow-up confirmed the order shipped and is now in transit. Expected delivery July 25.",
    "contactFacts": {
      "name": "Sarah Chen",
      "phone": "+14155550192",
      "preferred_contact": "sms",
      "timezone": "America/Los_Angeles"
    },
    "entities": [
      {
        "entity_type": "order",
        "entity_id": "order-8821",
        "facts": {
          "order_number": "#8821",
          "status": "in_transit",
          "carrier": "UPS",
          "expected_delivery": "2025-07-25"
        },
        "status": "in_transit",
        "last_discussed_at": "2025-07-23T09:10:00.000Z",
        "notes": null
      }
    ],
    "openItems": [
      {
        "type": "follow_up",
        "description": "Confirm delivery of order #8821 on July 25",
        "created_at": "2025-07-23T09:10:00.000Z",
        "priority": "medium",
        "related_to": {
          "entity_type": "order",
          "entity_id": "order-8821"
        }
      }
    ]
  },
  "errors": null
}
```

```json No Memory Yet theme={null}
{
  "data": {
    "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
    "recentMessages": [],
    "summary": null,
    "contactFacts": {},
    "entities": [],
    "openItems": []
  },
  "errors": null
}
```

```json Error Response theme={null}
{
  "data": null,
  "errors": [
    {
      "error": "BAD_REQUEST",
      "message": "persona_id or agent_number is required"
    }
  ]
}
```

***

Docs for agents: [llms.txt](https://docs.bland.ai/llms.txt)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.