Skip to main content
GET
/
user_memory
/
list_user_memories
List User Memories
curl --request GET \
  --url https://api.usecortex.ai/user_memory/list_user_memories \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "user_memories": [
    {
      "memory_id": "memory_1234",
      "memory_content": "I prefer detailed technical explanations and works in the Pacific timezone"
    },
    {
      "memory_id": "memory_4567",
      "memory_content": "I prefer dark mode"
    }
  ]
}
Hit the Try it button to try this API now in our playground. It’s the best way to check the full request and response in one place, customize your parameters, and generate ready-to-use code snippets.

Examples

  • API Request
  • TypeScript
  • Python (Sync)
curl --request GET \
  --url 'https://api.usecortex.ai/user_memory/list_user_memories?tenant_id=tenant_1234&sub_tenant_id=sub_tenant_4567' \
  --header 'Authorization: Bearer YOUR_API_KEY'

Overview

Retrieve all stored memories for a specific user within a tenant/sub-tenant combination to view and manage the user’s complete memory profile.

Functionality

  • Complete Memory Retrieval: Fetches all user memories
  • Tenant-Based Filtering: Returns memories specific to the provided tenant and sub-tenant combination
  • Simplified Response: Provides essential memory information including unique IDs and content
  • User Context Integration: Automatically filters memories based on the authenticated user
  • Memory Management: Enables you to review and manage stored user memories

Use Cases

  • Memory Audit: Review all stored memories for a user to ensure data quality
  • User Profile Overview: Get a complete picture of what the system knows about a user
  • Memory Management: Identify memories that may need updating or deletion
  • Debugging: Troubleshoot issues with user personalization by examining stored memories
  • Data Export: Retrieve all user memories for data analysis or migration

With Optional Sub-tenant

curl -X GET "https://api.cortex.com/user_memory/list_user_memories?tenant_id=company_123" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
Sub-tenant Default: If no sub_tenant_id is provided, the system uses DEFAULT sub-tenant which was created while creating the tenant.

Important Notes

Memory Privacy: This API returns all memories for the authenticated user. Ensure proper access controls are in place to prevent unauthorized access to user memory data.
Memory IDs: Each memory has a unique memory_id that can be used with the Delete User Memory endpoint to remove specific memories.
Pro Tip: Use this API in combination with Retrieve User Memory to first search for relevant memories, then list all memories to get the complete context.

Response Fields

FieldTypeDescription
successbooleanIndicates whether the operation was successful
user_memoriesarrayList of user memory objects
user_memories[].source_idstringUnique identifier for the memory
user_memories[].source_contentstringThe actual content of the memory

Error Responses

All endpoints return consistent error responses following the standard format. For detailed error information, see our Error Responses documentation.

Authorizations

Authorization
string
header
required

Query Parameters

tenant_id
string
required
Example:
sub_tenant_id
string
default:""
Example:

Response

success
boolean
required
Example:
user_memories
UserMemory · object[]
Example: