TMCRA MEMORY API / v0.2.0
Persistent memory for production AI agents.
Turn ordered conversation events into tenant-isolated, temporal, prompt-ready evidence. TMCRA owns memory; your application keeps control of the agent runtime and final answer model.
- Protocol
- HTTPS / JSON
- Authentication
- Bearer token
- Write model
- Asynchronous jobs
- Recall output
- Evidence, not answers
Quickstart
Write once, then recall with read-your-writes.
- 1
Keep credentials on your server
Use the root key only in trusted infrastructure. Issue scoped tokens for integrations.
- 2
Choose a stable scope
Map a tenant user, persona, or workspace to one durable opaque scope_name.
- 3
Ingest idempotently
Send ordered messages with stable message IDs and an Idempotency-Key.
- 4
Recall before the model call
Pass prompt_evidence.content to the answer model together with recent conversation context.
curl -X POST "$TMCRA_BASE_URL/v1/scopes/user_123/ingest" \
-H "Authorization: Bearer $TMCRA_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: ingest-session-42-v1" \
-d '{
"session_id": "session_42",
"consistency": "read_your_writes",
"slow_policy": "auto",
"messages": [{
"message_id": "msg_001",
"role": "user",
"content": "I prefer concise answers.",
"timestamp": "2026-07-16T08:00:00Z"
}]
}'Identity and isolation
Tenant, scope, and session are different boundaries.
tenantThe billing, credential, and administrative boundary identified by a root API key.
scope_nameThe durable memory isolation boundary for one user, persona, or workspace.
session_idOne ordered conversation inside a scope. It is not inferred from message text.
Consistency
Successful messages commit once; later stages are recoverable.
| Mode | Use when | Behavior |
|---|---|---|
eventual | The next turn does not depend on this write. | Returns an async job immediately. |
read_your_writes | The next recall must include committed data. | Wait for the job, then pass wait_for_job_id to recall. |
A successful committed message is not replayed because graph evolution, indexing, webhook delivery, or a caller-owned answer operation later fails.
Webhooks
Signed lifecycle notifications with content-safe payloads.
Webhook delivery is at least once. Verify the HMAC-SHA256 signature, deduplicate by event ID, and return a successful response quickly. Payloads contain sanitized job and scope metadata, never prompts, messages, evidence, or credentials.
job.succeededjob.failedjob.cancelledingest.completedconsolidation.completedindex.completedexport.readyscope.deletedErrors and retries
Retry by operation semantics, not by status alone.
| Status | Caller action |
|---|---|
400 / 422 | Fix validation or request semantics before retrying. |
401 / 403 | Replace or re-scope the credential; do not retry unchanged. |
404 | The resource does not exist or is outside this credential boundary. |
409 | Inspect lifecycle, idempotency, or consistency conflict details. |
429 | Honor Retry-After and reuse the same idempotency key. |
5xx | Retry only GETs and idempotent writes with bounded backoff. |
SDKs and adapters
Use the stable contract directly; evaluate packages by release status.
PREVIEW · tmcra-clientTyped sync and async clients available for pilot evaluation.
PREVIEW · @tmcra/typescriptA testable fetch client whose package surface may still change.
PREVIEW · stdioA local compatibility bridge for approved test deployments.
PILOT SOURCE · TMCRALangGraphMemoryValidated source adapter; no generally published package is promised.
PILOT SOURCE · TMCRAAgentsMemoryValidated source adapter available through approved pilots.
PILOT SOURCE · LanguageModelV3MiddlewareValidated source middleware available through approved pilots.
PILOT SOURCE · TmcraAIContextProviderValidated source provider available through approved pilots.
API reference
32 documented API operations.
Credentials
Issue, inspect, and revoke least-privilege access tokens.
05GET/v1/sessionGet authenticated session+
Returns the authenticated tenant, credential identity, permissions, and allowed memory scopes for the current Token.
Inspect OpenAPI schemaGET/v1/access-tokensList access tokens+
Returns token metadata for the current tenant. This listing never includes token secrets.
Inspect OpenAPI schemaPOST/v1/access-tokensIssue an access token+
Creates an expiring token with explicit permissions and a scope allowlist.
Inspect OpenAPI schemaPOST/v1/access-tokens/{token_id}/confirmConfirm provisional token delivery+
Idempotently activates the full lifetime of a provisionally delivered Token.
Inspect OpenAPI schemaDELETE/v1/access-tokens/{token_id}Revoke an access token+
Revokes one tenant-owned token immediately.
Inspect OpenAPI schemaMemory
Ingest conversation events, recall evidence, and trigger slow-memory evolution.
06POST/v1/scopes/{scope_name}/ingestIngest memory events+
Commits one session of ordered messages through the durable asynchronous writer chain.
Inspect OpenAPI schemaPOST/v1/scopes/{scope_name}/ingest/batchBulk ingest+
Atomically reserves capacity and idempotency for up to 100 independent ingest items.
Inspect OpenAPI schemaPOST/v1/scopes/{scope_name}/recallRecall memory+
Returns structured evidence and bounded prompt_evidence for the caller's answer model.
Inspect OpenAPI schemaPOST/v1/scopes/{scope_name}/consolidateConsolidate slow memory+
Queues policy-gated slow-memory evolution for a scope.
Inspect OpenAPI schemaGET/v1/scopesList memory scopes+
Lists the scopes visible to the current credential, optionally filtered by an allowed prefix.
Inspect OpenAPI schemaGET/v1/scopes/{scope_name}/summaryGet scope summary+
Returns server-recorded ingest, recall, message, and session activity for one scope.
Inspect OpenAPI schemaJobs
Observe and control asynchronous work without replaying successful writes.
03GET/v1/jobs/{job_id}Get job+
Returns the current state, result, or typed error for an asynchronous job.
Inspect OpenAPI schemaPOST/v1/jobs/{job_id}/cancelCancel job+
Requests cancellation for work that has not reached a terminal state.
Inspect OpenAPI schemaPOST/v1/jobs/{job_id}/retryRetry failed job+
Creates a new bounded retry for an eligible failed job.
Inspect OpenAPI schemaMemory graph
Inspect slow memory first, then expand Fast and Source evidence lazily.
04GET/v1/scopes/{scope_name}/memory-graphGet graph overview+
Returns a paginated slow-memory-first graph overview and layer counts.
Inspect OpenAPI schemaGET/v1/scopes/{scope_name}/memory-graph/nodes/{memory_id}/neighborsExpand graph neighbors+
Lazily expands related Slow, Fast, and Source nodes around one memory.
Inspect OpenAPI schemaGET/v1/scopes/{scope_name}/memory-graph/nodes/{memory_id}/evidenceRead source evidence+
Returns explicitly requested verbatim Source evidence and provenance.
Inspect OpenAPI schemaPOST/v1/scopes/{scope_name}/memory-graph/traceTrace recall+
Runs the production recall planner and returns routing diagnostics without an answer-model call.
Inspect OpenAPI schemaGovernance
Export, retain, delete, reopen, and evaluate memory scopes.
07POST/v1/scopes/{scope_name}/exportsCreate scope export+
Queues a consistent portable export of scope-owned memory data.
Inspect OpenAPI schemaGET/v1/scopes/{scope_name}/exports/{export_id}Download scope export+
Downloads a completed export from the same tenant and scope boundary.
Inspect OpenAPI schemaGET/v1/scopes/{scope_name}/retentionGet retention policy+
Returns the effective inactivity retention policy for a scope.
Inspect OpenAPI schemaPUT/v1/scopes/{scope_name}/retentionSet retention policy+
Enables, disables, or changes inactivity-based retention from 1 to 3650 days.
Inspect OpenAPI schemaPOST/v1/scopes/{scope_name}/feedbackSubmit recall feedback+
Records helpful, incorrect, stale, unsafe, or missing evidence feedback.
Inspect OpenAPI schemaDELETE/v1/scopes/{scope_name}Delete scope+
Queues physical artifact deletion while preserving lifecycle and audit tombstones.
Inspect OpenAPI schemaPOST/v1/scopes/{scope_name}/reopenReopen deleted scope+
Returns an eligible tombstoned scope to active without restoring deleted artifacts.
Inspect OpenAPI schemaWebhooks
Receive signed lifecycle events without exposing memory content.
03GET/v1/webhooksList webhooks+
Lists endpoint metadata and subscribed events without revealing signing secrets.
Inspect OpenAPI schemaPOST/v1/webhooksCreate webhook+
Registers an HTTPS endpoint and returns its HMAC signing secret once.
Inspect OpenAPI schemaDELETE/v1/webhooks/{endpoint_id}Disable webhook+
Disables one tenant-owned delivery endpoint.
Inspect OpenAPI schemaUsage
Read tenant-level usage and cost ledger data.
04PUT/v1/usage/entitlements/{subject}Set subject entitlements+
Sets authoritative ingest-token and recall-request limits for one subject.
Inspect OpenAPI schemaGET/v1/usage/quotaGet quota+
Returns server-authoritative usage, limits, and remaining quota for the authenticated principal or an authorized subject.
Inspect OpenAPI schemaPUT/v1/usage/quotaSet quota entitlement+
Updates authoritative quota limits for an explicitly selected subject.
Inspect OpenAPI schemaGET/v1/usage/costsGet usage costs+
Returns the tenant cost ledger for operational accounting and limits.
Inspect OpenAPI schema