Skip to main content

POST /v1/process

Queues post-turn memory processing and returns immediately.

Request body

{
  "user_id": "user-123",
  "containers": [
    {
      "id": "thread-abc",
      "type": "thread"
    }
  ],
  "scope_policy": {
    "write_user": "auto",
    "write_global": "auto",
    "write_container": true
  },
  "turn": {
    "user_message": "Remember that I prefer pytest over unittest.",
    "assistant_response": "Understood. I'll keep that in mind.",
    "occurred_at": "2026-03-16T10:00:00Z",
    "user_message_id": "msg-u-1",
    "assistant_message_id": "msg-a-1"
  },
  "metadata": {
    "app": "example-host",
    "source": "chat",
    "model": "gpt-4.1-mini",
    "trace_id": "trace-001"
  }
}

Request fields

FieldTypeRequiredNotes
user_idstringYesUser identity for the turn.
containersContainerHint[]NoOptional scope buckets. Missing containers are created automatically.
scope_policyScopePolicyNoWrite policy override block. Defaults are applied if omitted.
turnTurnEnvelopeYesThe completed user and assistant messages.
metadataRequestMetadataNoHost app metadata for tracing and provenance.

ContainerHint

FieldTypeRequiredNotes
idstringYesContainer identifier.
typestring | nullNoInformational container type such as thread or project.

ScopePolicy

FieldTypeRequiredNotes
write_userauto | true | falseNoDefaults to auto.
write_globalauto | true | falseNoDefaults to auto.
write_containerbooleanNoDefaults to true.

TurnEnvelope

FieldTypeRequiredNotes
user_messagestringYesRaw user message for the processed turn.
assistant_responsestringYesAssistant message that followed the user message.
occurred_atdatetime | nullNoOptional source timestamp for the turn.
user_message_idstring | nullNoOptional upstream message id.
assistant_message_idstring | nullNoOptional upstream message id.

RequestMetadata

FieldTypeRequiredNotes
appstring | nullNoHost application name.
sourcestring | nullNoSource channel such as chat.
modelstring | nullNoUpstream model identifier if relevant.
trace_idstring | nullNoTrace or correlation id.

Response

{
  "status": "accepted",
  "job_id": "3d8581a7-f102-4f45-8a77-fdcb16022c50",
  "created_user": true,
  "created_containers": [
    "thread-abc"
  ],
  "accepted_at": "2026-03-16T10:00:00.000000"
}

Behavior

  • creates the user if missing
  • creates missing containers
  • stores a background job
  • returns immediately
The actual turn adjudication happens asynchronously in the Celery worker.