Skip to main content

Base URL

The CEMS REST API runs on port 8765 by default:
http://localhost:8765
For production deployments, use your configured domain:
https://cems.example.com

Authentication

All API endpoints (except /health and /api/config/setup) require authentication via Bearer token. See Authentication for details.

API Endpoints

Memory Operations

MethodEndpointDescription
POST/api/memory/addStore a new memory
POST/api/memory/add_batchStore multiple memories at once
POST/api/memory/searchSearch memories using semantic search
POST/api/memory/forgetDelete or archive a memory
POST/api/memory/updateUpdate existing memory content
POST/api/memory/log-shownLog when memories are shown to user
POST/api/memory/maintenanceTrigger maintenance jobs
POST/api/memory/conflict/resolveResolve conflicting memories
GET/api/memory/getRetrieve full document by ID
GET/api/memory/listList all memories
GET/api/memory/statusGet system status
GET/api/memory/foundationGet foundation guidelines
GET/api/memory/gate-rulesGet gate rules by project
GET/api/memory/profileGet session profile context
GET/api/memory/summary/personalGet personal memory summary
GET/api/memory/summary/sharedGet shared/team memory summary

Index Operations

MethodEndpointDescription
POST/api/index/repoIndex a git repository
POST/api/index/pathIndex a local directory
GET/api/index/patternsList available index patterns

Session Operations

MethodEndpointDescription
POST/api/session/summarizeProduce and store session summaries

Tool Operations

MethodEndpointDescription
POST/api/tool/learningExtract tool learning from usage

Health & Setup

MethodEndpointDescription
GET/pingSimple ping endpoint
GET/healthHealth check (no auth required)
GET/api/config/setupSetup discovery (no auth required)

Example Request

curl -X POST https://cems.example.com/api/memory/add \
  -H "Authorization: Bearer cems_ak_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "content": "I prefer Python for backend development",
    "category": "preference"
  }'

Response Format

All endpoints return JSON responses. Success responses typically include:
{
  "status": "success",
  "data": { ... }
}
Error responses include:
{
  "error": "Error message description"
}

Rate Limiting

CEMS does not currently implement rate limiting, but it’s recommended to batch operations when possible using endpoints like /api/memory/add_batch.

Admin API

Admin endpoints are available at /admin/* and require CEMS_ADMIN_KEY authentication. These endpoints are used for user and team management. See the Admin API documentation for user management and Teams for team management.

Build docs developers (and LLMs) love