API Server

March 9, 2026 ยท View on GitHub

Setup

# Set DATABASE_URL in .env
cp .env.example .env

# Run migrations
pnpm run db:migrate

# Start server
pnpm run dev:server

Authentication

All API endpoints (except /health) require authentication via Bearer token:

curl -H "Authorization: Bearer hk_your_api_key" \
     -H "Content-Type: application/json" \
     http://localhost:3737/v1/recall \
     -d '{"orgId":"org","repoId":"repo","query":"test"}'

Endpoints

MethodPathDescription
POST/v1/memoryCreate a memory
POST/v1/recallSearch memories
POST/v1/memory/:id/deprecateDeprecate a memory
POST/v1/memory/:id/supersedeMark as superseded
POST/v1/memory/:id/pinPin a memory
POST/v1/consolidateConsolidate memories
POST/v1/lifecycle/runPreview or run lifecycle maintenance
DELETE/v1/memory/:idDelete a memory
POST/v1/memory/:id/restoreRestore a deleted memory
POST/v1/memories/resetReset all memories for org/repo
POST/v1/api-keysCreate API key
GET/v1/api-keysList API keys
DELETE/v1/api-keys/:idRevoke API key
GET/healthHealth check (no auth required)

Request Examples

POST /v1/memory

{
  "orgId": "uuid",
  "repoId": "my-repo",
  "memoryType": "semantic",
  "text": "Always use UTC timestamps",
  "tags": ["convention"],
  "sourceRefs": { "pr_url": "https://..." },
  "confidence": 0.9
}

POST /v1/recall

{
  "orgId": "uuid",
  "repoId": "my-repo",
  "query": "how do timestamps work",
  "types": ["semantic", "procedural"],
  "tags": ["convention"],
  "k": 10
}