MemLibMemLib

API Overview

Authentication, base URL, and permission levels for the MemLib REST API

Base URL

https://mem.anishroy.com/api/v1

All endpoints are prefixed with /v1.


Authentication

Every request requires an API key in the Authorization header:

Authorization: Bearer sk_your_api_key

API keys are created from the project dashboard and are scoped to a single project.


Permission Levels

Each API key has a permission level that controls which endpoints it can access:

LevelNameOperations
1Readlist, recall, prepare, diff, events, health
2Read & WriteAll Read + store, batchStore
3AdminAll Read & Write + delete, consolidate, migrate

If a request uses an API key without the required permission, the API returns 403 Forbidden.


Request Format

  • Content-Type: application/json for all POST/PUT requests
  • Query parameters for GET requests
  • Path parameters for resource-specific endpoints (e.g., /memory/{memoryId})

Response Format

All responses return JSON. Successful responses return the resource data directly. Error responses follow this format:

{
  "error": "Human-readable error message"
}

Error Codes

StatusMeaning
200Success
400Bad Request — invalid or missing fields
401Unauthorized — invalid or missing API key
403Forbidden — insufficient permission level
404Not Found — resource doesn't exist
500Internal Server Error

Endpoints Summary

MethodPathPermissionDescription
POST/memoryRead & WriteStore a memory
POST/memory/recallReadSemantic search
POST/memory/prepareReadContext synthesis
POST/memory/diffReadMemory changelog
GET/memoryReadList memories
POST/memory/batchRead & WriteBatch store
DELETE/memory/{memoryId}AdminDelete a memory
GET/memory/eventsReadAudit trail
POST/memory/consolidateAdminConsolidate old memories
GET/healthNone (public)Basic health check
GET/memory/healthReadMemory service health check

On this page