Axerity Platform

Memories API

Store and retrieve user memories

The Memories API allows you to store and retrieve persistent context for your users across conversations.

Free Usage

The Memories API is free with unlimited usage for all users.

Encrypted Storage

All memories are encrypted at rest using AES-256 encryption.

How It Works

  1. Create: Store memories with a unique user ID
  2. Search: Find relevant memories using semantic search
  3. List: Retrieve all memories for a user
  4. Delete: Remove memories when no longer needed

Endpoints

MethodEndpointDescription
POST/api/v1/memoriesCreate a memory
GET/api/v1/memoriesList user memories
POST/api/v1/memories/searchSearch memories
DELETE/api/v1/memories/:idDelete a memory

Create Memory (POST)

POST https://axerity.com/api/v1/memories

Request Body

Prop

Type

Example

curl -X POST https://axerity.com/api/v1/memories \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "user_id": "user_123",
    "content": "User prefers dark mode and uses TypeScript",
    "metadata": {
      "category": "preferences"
    }
  }'

Response

{
  "id": "mem_abc123",
  "user_id": "user_123",
  "content": "User prefers dark mode and uses TypeScript",
  "metadata": {
    "category": "preferences"
  },
  "created_at": "2025-01-15T10:30:00Z"
}

List Memories (GET)

GET https://axerity.com/api/v1/memories

Query Parameters

Prop

Type

Example

curl "https://axerity.com/api/v1/memories?user_id=user_123&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "memories": [
    {
      "id": "mem_abc123",
      "user_id": "user_123",
      "content": "User prefers dark mode and uses TypeScript",
      "metadata": { "category": "preferences" },
      "created_at": "2025-01-15T10:30:00Z"
    }
  ],
  "total": 1,
  "limit": 10,
  "offset": 0
}

Search Memories (POST)

POST https://axerity.com/api/v1/memories/search

Request Body

Prop

Type

Example

curl -X POST https://axerity.com/api/v1/memories/search \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "user_id": "user_123",
    "query": "programming preferences",
    "limit": 5
  }'

Response

{
  "memories": [
    {
      "id": "mem_abc123",
      "user_id": "user_123",
      "content": "User prefers dark mode and uses TypeScript",
      "metadata": { "category": "preferences" },
      "created_at": "2025-01-15T10:30:00Z",
      "score": 0.92
    }
  ],
  "total": 1
}

Delete Memory (DELETE)

DELETE https://axerity.com/api/v1/memories/:id

Example

curl -X DELETE https://axerity.com/api/v1/memories/mem_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "deleted": true
}

Best Practices

Structure Your Memories

Store memories in a consistent format for better search results:

{
  "content": "User preference: dark mode theme",
  "metadata": {
    "category": "preferences",
    "type": "ui"
  }
}

Use Meaningful Categories

CategoryExample Content
preferencesUI settings, language, timezone
contextProject details, tech stack
historyPast interactions, completed tasks
personalName, role, communication style

Search Before Creating

Avoid duplicate memories by searching first:

// Check if similar memory exists
const existing = await searchMemories({
  user_id: "user_123",
  query: "dark mode preference",
});

if (existing.memories.length === 0) {
  await createMemory({
    user_id: "user_123",
    content: "User prefers dark mode",
  });
}

Pricing

OperationCost
CreateFree
ListFree
SearchFree
DeleteFree

Standalone Service

The Memories API is a standalone service. Use a unique user_id to store and retrieve memories independently from Chat API conversations.

On this page