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

# Get Memory

> Get a specific caller memory by ID

Retrieve detailed information about a specific caller's memory, including their call history.

## Request Body

<ParamField body="memory_id" type="string" required>
  UUID of the memory record
</ParamField>

## Response

<ResponseField name="id" type="string">
  UUID of the memory record
</ResponseField>

<ResponseField name="contact_phone" type="string">
  Phone number of the caller
</ResponseField>

<ResponseField name="contacts" type="object">
  Contact information

  * `id` - Contact UUID
  * `name` - Contact name
  * `phone_number` - Phone number
</ResponseField>

<ResponseField name="summary" type="string">
  AI-generated relationship summary
</ResponseField>

<ResponseField name="key_topics" type="array">
  Key topics discussed
</ResponseField>

<ResponseField name="preferences" type="object">
  Caller preferences
</ResponseField>

<ResponseField name="relationship_notes" type="string">
  Additional notes about the relationship
</ResponseField>

<ResponseField name="interaction_count" type="integer">
  Number of voice conversations
</ResponseField>

<ResponseField name="sms_interaction_count" type="integer">
  Number of SMS interactions
</ResponseField>

<ResponseField name="semantic_match_count" type="integer">
  Number of semantic memory matches
</ResponseField>

<ResponseField name="call_history" type="array">
  Recent calls with this contact

  * `id` - Call record UUID
  * `started_at` - Call start time
  * `duration_seconds` - Call duration
  * `call_summary` - AI summary of call
  * `direction` - "inbound" or "outbound"
</ResponseField>

<ResponseField name="last_updated" type="string">
  Last interaction timestamp
</ResponseField>

<ResponseField name="created_at" type="string">
  When memory was first created
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.magpipe.ai/functions/v1/get-memory" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "memory_id": "789e0123-e89b-12d3-a456-426614174000"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "789e0123-e89b-12d3-a456-426614174000",
    "contact_phone": "+14155551234",
    "contacts": {
      "id": "abc12345-e89b-12d3-a456-426614174000",
      "name": "Sarah Johnson",
      "phone_number": "+14155551234"
    },
    "summary": "Regular customer who had delivery issues with order #4521. Issue was resolved with a refund. Prefers email follow-ups.",
    "key_topics": ["orders", "delivery", "refunds"],
    "preferences": {
      "contact_method": "email",
      "best_time": "afternoons"
    },
    "relationship_notes": "VIP customer - escalate issues to manager if needed",
    "interaction_count": 3,
    "sms_interaction_count": 0,
    "semantic_match_count": 1,
    "call_history": [
      {
        "id": "call-001",
        "started_at": "2024-01-15T14:30:00Z",
        "duration_seconds": 245,
        "call_summary": "Customer called to confirm refund was processed. Confirmed and thanked for patience.",
        "direction": "inbound"
      },
      {
        "id": "call-002",
        "started_at": "2024-01-10T11:00:00Z",
        "duration_seconds": 420,
        "call_summary": "Customer reported missing package for order #4521. Initiated refund.",
        "direction": "inbound"
      }
    ],
    "last_updated": "2024-01-15T14:30:00Z",
    "created_at": "2024-01-05T09:00:00Z"
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "not_found",
      "message": "Memory not found"
    }
  }
  ```
</ResponseExample>
