Skip to main content

Example use case

Your product team publishes a new integration guide for the inbound support line, or a prospect emails a technical specification to your sales agent. The agent should learn the new file while live conversations keep running.

Setup

Upload the file via multipart POST/v2/agents//threads//observe on an existing thread or a dedicated ingestion thread:
  • Store the returned observation_id and file_id for tracking and future replacement.
  • Poll GET…/observe/ until status reaches committed.
  • If the agent is already reading another file, Priors queues the new upload automatically (polled status reads queued) and starts it next.
  • Answering calls (respond, observe-and-respond, recall, observe-and-recall) continue running normally while the upload is processed.

Benefit with Priors

  • Zero downtime: new documents merge into the agent’s live index without re-indexing existing files.
  • Immediate citations: once committed, every thread on the agent can retrieve facts from the file and cite it with a download link.
  • Safe deduplication: re-uploading identical bytes in the same thread returns duplicate as true and bills nothing.

What goes wrong

Assuming a file is searchable as soon as observe returns 202 produces answers that miss the new document because learning runs asynchronously. Uploading identical bytes into a different thread of the same agent returns 409 document_already_ingested unless allow_duplicate is set, which creates duplicate memories that compete during retrieval.

Recommendation

Upload documents to one dedicated ingestion thread per agent, record each file_id in your own database for updates or removal, and poll until committed before surfacing the document as live.

Calls used