MemLibMemLib

Events (Audit Trail)

GET /memory/events — Query the memory audit trail

Endpoint

GET /v1/memory/events?namespace=my-app&memoryId=uuid&limit=50

Permission: Read


Query Parameters

ParameterTypeRequiredDefaultDescription
namespacestringMemory namespace
memoryIdstring (UUID)Filter events for a specific memory
limitnumberMaximum events to return

Response

[
  {
    "id": "event-uuid",
    "memoryId": "memory-uuid",
    "namespace": "my-app",
    "entity": "user-123",
    "event": "ADD",
    "oldContent": null,
    "newContent": "Prefers dark mode",
    "mergedFromId": null,
    "reason": null,
    "createdAt": "2024-03-20T10:00:00.000Z"
  },
  {
    "id": "event-uuid-2",
    "memoryId": "memory-uuid",
    "namespace": "my-app",
    "entity": "user-123",
    "event": "REPLACE",
    "oldContent": "Uses VS Code",
    "newContent": "Uses Cursor (switched from VS Code)",
    "mergedFromId": "old-memory-uuid",
    "reason": "New preference supersedes old",
    "createdAt": "2024-03-21T10:00:00.000Z"
  }
]

Event Types

EventDescription
ADDNew memory inserted
MERGETwo memories combined
REPLACENew fact superseded old
DELETEMemory deleted or archived
SKIP_DUPLICATENear-duplicate skipped
KEEP_EXISTINGConflict resolved in favor of existing

curl Example

# All events in a namespace
curl "https://mem.anishroy.com/api/v1/memory/events?namespace=my-app&limit=20" \
  -H "Authorization: Bearer sk_your_api_key"

# Events for a specific memory
curl "https://mem.anishroy.com/api/v1/memory/events?namespace=my-app&memoryId=550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer sk_your_api_key"

On this page