Skip to main content
Use https://convex.memorycrystal.ai as the hosted base URL. Send a Bearer API key and Content-Type: application/json for JSON requests. Account ownership comes from authentication, not a request-body userId. Start with authentication. Separate references cover knowledge bases, assets, research, and MCP setup. HTTP JSON below describes the handlers; hosted and stdio MCP may reshape it.

Endpoint map

Paths in this table are relative to /api/mcp.

Retrieval

Recall memory entries use memoryId and ranking metadata. Read retrieval and diagnostics for returned counts, message scan coverage, filters, and timing; there is no supported debugRecallOutput=true query switch. The recall page explains bounded and degraded retrieval. Transcript search is lexical, not vector search. Recent messages default to chronological order; order: "newest" is supported. Message records use content, not a universal text field, and grouped turns are separate. For search, follow pagination.nextOffset while hasMore is true within the offset bound. The HTTP window fields are fromMs and toMs. Use scopeToSession: true with a sessionKey when you want session-restricted durable recall. Omitting scope does not expose all private transcripts. IDs hidden by visibility checks return 404.

Writes and continuity

Send this to /capture for a durable memory. It schedules embedding/salience work; it does not return an embedding vector or creation metadata as a universal response. Update corrects a record in place. Supersede atomically archives and links a predecessor to its successor. scopeChannel authorizes the old scope; channel changes stored scope. Both reject protected placeholder writes with 409 redacted_content_write unless deliberately overridden. Checkpoint creation requires an explicit user request. Its result contains ok, id, checkpointId, memoryCount, allowance, retainedCount, snapshotCap, snapshotByteLimit, and tier. It is a bounded backup, not a full export. Trace returns a source snapshot with messages, messageCount, omittedCount, createdAt, and reason. Above 20 messages, it returns the first ten and last ten. An unavailable snapshot is null with a reason; it is not a complete transcript guarantee.

Completed turns and sessions

/turn requires sessionKey, channel, turnId, and nonempty assistantMessage; send userMessage when available. Optional platform, agent, metadata, and project/repository fields preserve attribution. Retrying the same account/turn ID is idempotent. No embedding or durable extraction runs in the turn request; distillation is separate. /session accepts recentLimit (default 12, clamped 1–50; limit is an alias) and optional sinceMs. It returns a summary plus the selected recent messages and grouped turns.

Export

GET /api/memories exports the authenticated owner’s active memories, newest first. It is an owner export, not a scoped recall endpoint. The response is memories plus pagination containing pageSize, cursor, and isDone. Continue until isDone; preserve the same filters across pages. Raw messages remain until deletion on every tier. See rate limits for route-specific responses and errors for validation and visibility failures.

Request and response examples

The following examples show raw HTTP JSON. Replace placeholder IDs and scope values with your own returned values. Larger response examples show selected fields; the endpoint map lists the additional envelope fields.

POST /api/mcp/recall

Request body:
HTTP response (selected fields):

POST /api/mcp/capture

Request body:
HTTP response:

POST /api/mcp/search-messages

Request body:
HTTP response:

POST /api/mcp/turn

Request body:
HTTP response:

POST /api/mcp/recent-messages

Request body:
HTTP response:

Full-turn workflow

  1. Call /wake at session start if you need an opening briefing.
  2. Call /recall with the current question and intended scope; query named KBs separately.
  3. After the assistant completes a response, send the transcript pair to /turn using a stable turn ID.
  4. Save an explicit durable outcome through /capture when needed. Do not equate this with transcript capture.
  5. Create a checkpoint only when the user requests a backup.

Errors and common mistakes

On reads, check both HTTP status and retrieval diagnostics. On writes, save the returned ID before looking for the record through recall. Do not blindly retry a durable capture after a timeout: it is not the idempotent completed-turn endpoint. Investigate whether it was saved first. For ID-based reads or writes, preserve the relevant identity and visibility scope. Use scopeChannel on update/supersede to authorize the existing record without moving it; use channel only for an intended move. A 404 can conceal a scope mismatch. Follow Retry-After handling on 429 responses.