Add Memory API | OpenMemory

API reference for adding memories to the OpenMemory Backend Server.

Add Memory API

[!NOTE] This reference is for the Backend Server API. If you are using Standalone Mode, use the JavaScript SDK or Python SDK directly.

Add new memories to OpenMemory with full control over content, metadata, and salience parameters.

Endpoint

POST /memory/add

Authentication

Authorization: Bearer your_api_key_here

Request Body

interface AddMemoryRequest {
  content: string;
  tags?: string[];
  metadata?: Record<string, any>;
  user_id?: string;
}

Parameters

ParameterTypeRequiredDefaultDescription
contentstringYes-The memory content to store
tagsstring[]No[]Tags for categorization
metadataobjectNo{}Additional metadata
user_idstringNo-User ID for multi-user isolation

Example

curl -X POST http://localhost:8080/memory/add \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your_api_key" \
  -d '{
    "content": "User prefers dark mode",
    "tags": ["preferences", "ui"],
    "metadata": {
      "source": "settings_page"
    }
  }'

Response

{
  "id": "mem_abc123",
  "primary_sector": "semantic",
  "sectors": ["semantic", "procedural"]
}
© 2025 OpenMemory · MIT License