Skip to main content

POST /memory/get_all

Retrieve all memories stored for a specific user. You can optionally filter by memory type to get only specific categories of memories.

Request Body

user_id
string
required
Unique identifier for the user whose memories you want to retrieve.
memory_type
string
Optional filter to retrieve only memories of a specific type. Valid values:
  • LONG_TERM - Permanent personal facts and preferences
  • SHORT_TERM - Temporary states and current activities
  • EPISODIC - Past events with specific time context
  • SEMANTIC - General knowledge and facts
  • PROCEDURAL - How-to knowledge and workflows

Response

success
boolean
Indicates whether the request was successful.
memories
array
Array of all memories for the user.

Example Request

Get all memories for a user:
curl -X POST http://localhost:8000/memory/get_all \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "user_123"
  }'
Get only long-term memories:
curl -X POST http://localhost:8000/memory/get_all \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "user_123",
    "memory_type": "LONG_TERM"
  }'

Example Response

{
  "success": true,
  "memories": [
    {
      "id": "mem_abc123",
      "memory": "User prefers dark mode in code editors",
      "user_id": "user_123",
      "metadata": {
        "memory_type": "LONG_TERM",
        "source": "conversation"
      },
      "created_at": "2025-03-01T10:00:00Z",
      "updated_at": "2025-03-01T10:00:00Z"
    },
    {
      "id": "mem_def456",
      "memory": "User is currently debugging authentication flow",
      "user_id": "user_123",
      "metadata": {
        "memory_type": "SHORT_TERM",
        "source": "screen_capture"
      },
      "created_at": "2025-03-03T14:30:00Z",
      "updated_at": "2025-03-03T14:30:00Z"
    }
  ]
}

Use Cases

Memory Dashboard

Display all stored memories in the Brain Panel UI for user review.

Context Loading

Load all relevant memories when starting a new session or conversation.

Data Export

Export user’s complete memory profile for backup or migration.

Memory Management

Review and manage memories by type for cleanup or organization.

Performance Considerations

This endpoint returns all memories for a user. For large memory sets (100+ memories), consider using paginated search or filtering by memory_type to improve performance.
Source: backend/main.py:246-260

Build docs developers (and LLMs) love