Skip to main content
The Memory API provides endpoints for managing encrypted user memories. All memory content is automatically encrypted at rest and queued for vector embedding to enable semantic search.

Create Memory

curl -X POST https://api.azen.sh/api/v1/memory \
  -H "azen-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "I love hiking in the mountains"
  }'
Creates a new memory with the provided text content. The content is automatically encrypted and queued for embedding.

Request Body

text
string
required
The text content to store as a memory. Must be at least 1 character long.Example: "I love hiking in the mountains"

Response

status
string
required
Response status indicatorValue: "success"
memoryId
string
required
UUID of the newly created memoryExample: "550e8400-e29b-41d4-a716-446655440000"
createdAt
string
required
ISO 8601 timestamp of memory creationExample: "2024-01-15T10:30:00.000Z"
embedding
string
required
Embedding status (always ‘processing’ for new memories)Value: "processing"
{
  "status": "success",
  "memoryId": "550e8400-e29b-41d4-a716-446655440000",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "embedding": "processing"
}

List Memories

curl -X GET "https://api.azen.sh/api/v1/memory?page=1&per=20" \
  -H "azen-api-key: YOUR_API_KEY"
Retrieves a paginated list of all memories for the authenticated user, ordered by creation date (newest first).

Query Parameters

page
integer
default:"1"
Page number for pagination (starts at 1)Minimum: 1
per
integer
default:"20"
Number of memories per pageMinimum: 1Maximum: 100

Response

status
string
required
Response status indicatorValue: "success"
memories
array
required
Array of memory objects for the current page
page
integer
required
Current page number
per
integer
required
Number of memories per page
total_pages
integer
required
Total number of pages available
total_count
integer
required
Total count of memory objects
{
  "status": "success",
  "memories": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "content": "I love hiking in the mountains",
      "metadata": null,
      "createdAt": "2024-01-15T10:30:00.000Z",
      "embedded": true
    },
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "content": "I enjoy reading sci-fi novels",
      "metadata": null,
      "createdAt": "2024-01-14T15:20:00.000Z",
      "embedded": true
    }
  ],
  "page": 1,
  "per": 20,
  "total_pages": 5,
  "total_count": 100
}

Get Memory

curl -X GET https://api.azen.sh/api/v1/memory/550e8400-e29b-41d4-a716-446655440000 \
  -H "azen-api-key: YOUR_API_KEY"
Retrieves a specific memory using its unique UUID. Returns 404 if the memory doesn’t exist or doesn’t belong to the authenticated user.

Path Parameters

id
string
required
UUID of the memory to retrieveExample: "550e8400-e29b-41d4-a716-446655440000"

Response

status
string
required
Response status indicatorValue: "success"
memory
object
required
The memory object
{
  "status": "success",
  "memory": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "content": "I love hiking in the mountains",
    "metadata": null,
    "createdAt": "2024-01-15T10:30:00.000Z",
    "embedded": true
  }
}

Delete Memory

curl -X DELETE https://api.azen.sh/api/v1/memory/550e8400-e29b-41d4-a716-446655440000 \
  -H "azen-api-key: YOUR_API_KEY"
Permanently deletes a memory and its associated vector embeddings. Returns 404 if the memory doesn’t exist.

Path Parameters

id
string
required
UUID of the memory to deleteExample: "550e8400-e29b-41d4-a716-446655440000"

Response

status
string
required
Response status indicatorValue: "success"
deleted
boolean
required
Indicates successful deletionValue: true
memoryId
string
required
UUID of the deleted memory
message
string
required
Confirmation messageValue: "Memory deleted successfully"
{
  "status": "success",
  "deleted": true,
  "memoryId": "550e8400-e29b-41d4-a716-446655440000",
  "message": "Memory deleted successfully"
}

Build docs developers (and LLMs) love