Overview
The Get Memory API retrieves the most recent thread memory summary for a specified external user. This endpoint provides access to conversation context and summaries that have been stored by Melodi’s intelligence system.Authentication
This endpoint requires a Private API Key. The API key can be passed as a header or query parameter:- Header:
Authorization: Bearer YOUR_API_KEY
- Query Parameter:
?apiKey=YOUR_API_KEY
Request Parameters
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
userExternalId | string | Yes | The external identifier for the user whose memory should be retrieved |
Response
Success Response (200)
The API returns the memory summary from the most recent thread for the specified user.userExternalId
- The external identifier for the userthreadId
- Internal thread identifier (number)threadExternalId
- External thread identifier (can be null if not provided when thread was created)summary
- The AI-generated memory summary content from the most recent threadcreatedAt
- ISO 8601 timestamp when the thread was created
Error Responses
Status Code | Description | Response Body |
---|---|---|
400 | Missing required parameter | {"error": "Missing required parameter: userExternalId"} |
401 | Invalid or missing API key | {"error": "Unauthorized - Invalid or missing API key"} |
404 | User not found or no memory available | {"error": "No user or no memory found"} |
Usage Examples
cURL
Python
TypeScript/JavaScript
Example Response
Use Cases
- Context Retrieval: Get conversation context when a user returns to continue a previous conversation
- Personalization: Use memory summaries to personalize user experiences
- Integration: Incorporate user memory into external systems or applications
- Analysis: Access stored conversation context for analysis or reporting
Related APIs
- Create Thread - Create new threads that generate memory summaries
- Get Threads - Retrieve multiple threads for a user
- Create User - Create users who can have memory summaries