REST API
Base path /api/v1. JSON in and out. Agent routes need Authorization: Bearer eng_XXXX_.... Errors look like { "error": { "code": "...", "message": "..." } }.
| Method and path | Scope | Purpose |
|---|---|---|
| POST /memories | remember | Remember (body: RememberInput) |
| GET /memories/:id | recall | One entry with full metadata |
| POST /recall | recall | Recall (body: RecallInput) |
| POST /memories/:id/forget | forget | Forget, with an optional reason |
| GET /subjects/:subject/timeline | recall | Timeline of a subject |
| GET /verify?mode=standard|deep&id= | verify | Integrity report, optionally with a proof |
| GET /memories/:id/proof | verify | Inclusion proof against the latest checkpoint |
| POST /conflicts/resolve | resolve | Resolve a conflict |
| GET /me | any | The calling agent and its space |
| GET /health | none | Database, embeddings and storage checks |
| GET /spaces/:key | public | Name, public key, latest checkpoint |
| GET /spaces/:key/chain?cursor=&limit= | public | Header fields and hashes, paged |
| GET /spaces/:key/checkpoints | public | Signed checkpoint files |
| GET /spaces/:key/proof/:id | public | Inclusion proof, hashes only |
Public routes work only for spaces with public verification switched on, and never return memory text. They send open CORS headers.
Error codes
| Code | Status | When |
|---|---|---|
| bad_request | 400 | Validation failed |
| unauthorized | 401 | Missing, unknown or revoked key |
| forbidden | 403 | The key lacks the scope |
| too_large | 413 | Text over 2,000 characters: split it into several memories |
| rate_limited | 429 | More than 60 writes per agent per minute |
| chain_busy | 503 | Contention beyond 8 retries: retry with the same idempotency key |
| embeddings_unavailable | 503 | Embedding quota reached; nothing was written |
SDK
import { Engram } from "engram-sdk";
// publicKey: the checkpoint key you trust, never one the server hands you.
const mem = new Engram({ url: process.env.ENGRAM_URL!, key: process.env.ENGRAM_KEY!, publicKey: process.env.ENGRAM_CP_PUBLIC_KEY });
await mem.remember({ text: "Ada prefers email over phone calls.", subject: "customer:ada", kind: "preference" });
const { memories } = await mem.recall({ query: "How should we contact Ada?", k: 3 });
const then = await mem.recall({ query: "What plan is Ada on?", asOf: "2026-10-20T12:00:00Z" });
const ok = await mem.verifyProof(await mem.proof(memories[0].id)); // checked locally