Skip to main content
An agent learns in two ways:
  1. Explicitly with POST/v2/agents//threads//observe: learns messages (JSON) or a file (multipart/form-data) asynchronously in the background without writing an answer.
  2. During conversation with observe-and-respond or observe-and-recall: answers or recalls immediately, then learns from the turn. See Answering.

Unified observe endpoint

In v2, one endpoint handles both messages and documents based on Content-Type:
  • application/json: one message or a batch of up to 100 messages.
  • multipart/form-data: one file (up to 30 MiB and 20,000 pieces).
Both forms accept an optional Idempotency-Key header (retained 24 hours) so safe retries replay the original 202 without duplicating work or billing.

Learn messages (JSON observe)

Send a single message (or a list of up to 100 messages in chronological order):
Success (202):
The Location header points directly to GET/v2/agents//threads//observe/.

Learn a document (multipart observe)

Upload files with multipart/form-data: one file part per document, repeated to send several in one request, within the upload limits in Limits. Supported formats include PDF, Word (.doc, .docx), PowerPoint (.ppt, .pptx, .pps, .ppsx), Excel (.xls, .xlsx, .xlsb), OpenDocument (.odt, .ods, .odp), CSV, RTF, EPUB, Markdown, plain text, source files, and images (PNG, JPEG, GIF, WebP read as one-page documents). Priors inspects file bytes, not just the filename. SVG is not accepted.
Success (202): observation_id is null. files lists each file in the order sent, with its file_id, its own observation_id, duplicate, and error (null when the file was accepted). Poll each file’s observation_id. Note that the v2 202 response does not have a top-level queued field. When the agent is already reading another file, Priors accepts the upload with 202 and queues it on the server; polling GET…/observe/ reports "status": "queued" until it starts.

Upload limits and concurrency

  • File cap: 30 MiB per file; 20,000 pieces per file.
  • Upload arrival rate: 1 per 10 s per subject; 6 per 10 s per organization.
  • Concurrent reads: 1 file at a time per agent (additional uploads queue on the server); 3 files at once per organization (429 with Retry-After: 90 when exceeded).
  • Answering while uploading: observe-and-respond, respond, observe-and-recall, and recall all run normally while a file is being learned.

Poll learning status

Call GET/v2/agents//threads//observe/ until a terminal status arrives. Honor the Retry-After header while the job is running.
Service restarts during upload: files already in processing resume automatically after a restart with no double charge. Files still queued or converting at the moment of a restart cannot be resumed automatically; they transition to failed and must be uploaded again.

Errors on observe

Request and file errors (fix before retrying)

State and transient errors