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 pathScopePurpose
POST /memoriesrememberRemember (body: RememberInput)
GET /memories/:idrecallOne entry with full metadata
POST /recallrecallRecall (body: RecallInput)
POST /memories/:id/forgetforgetForget, with an optional reason
GET /subjects/:subject/timelinerecallTimeline of a subject
GET /verify?mode=standard|deep&id=verifyIntegrity report, optionally with a proof
GET /memories/:id/proofverifyInclusion proof against the latest checkpoint
POST /conflicts/resolveresolveResolve a conflict
GET /meanyThe calling agent and its space
GET /healthnoneDatabase, embeddings and storage checks
GET /spaces/:keypublicName, public key, latest checkpoint
GET /spaces/:key/chain?cursor=&limit=publicHeader fields and hashes, paged
GET /spaces/:key/checkpointspublicSigned checkpoint files
GET /spaces/:key/proof/:idpublicInclusion 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

CodeStatusWhen
bad_request400Validation failed
unauthorized401Missing, unknown or revoked key
forbidden403The key lacks the scope
too_large413Text over 2,000 characters: split it into several memories
rate_limited429More than 60 writes per agent per minute
chain_busy503Contention beyond 8 retries: retry with the same idempotency key
embeddings_unavailable503Embedding 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