> ## Documentation Index
> Fetch the complete documentation index at: https://www.sapientpriors.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Teach from many documents

> Load a library of handbooks, manuals, or specs within upload and concurrency limits

## Example use case

You are launching an inbound support line with 25 product manuals, troubleshooting guides, and policy PDFs, or onboarding a team assistant with a folder of runbooks and architecture docs before opening access.

## Setup

Open a dedicated ingestion thread on the agent and upload files via multipart [POST`/v2/agents/{agent_id}/threads/{thread_id}/observe`](https://www.sapientpriors.com/docs/api-reference/v2/threads/learn-messages-or-files), one file per request:

* Keep each file under **30 MiB** and **20,000 pieces**.
* Respect arrival limits: at most **1 upload per 10 seconds per subject** and **6 uploads per 10 seconds per organization**.
* Respect concurrency: Priors reads **1 file at a time per agent** (additional uploads queue on the server and report `status` as `queued` when polled) and up to **3 files at once across your organization**.
* Send a unique `Idempotency-Key` header per file and poll [GET`.../observe/{observation_id}`](https://www.sapientpriors.com/docs/api-reference/v2/threads/get-learning-status) until `status` reaches `committed`.

## Benefit with Priors

* **Multi-format parsing:** converts PDFs, Office docs, OpenDocument, Markdown, CSV, plain text, code, and images automatically, including embedded figures.
* **Server-side queueing per agent:** subsequent uploads on one agent queue automatically and start once the active file commits.
* **Immediate availability across threads:** once committed, every thread on that agent can retrieve and cite the library.

## What goes wrong

> [!WARNING]
>
> Exceeding 1 upload per 10 seconds per subject triggers `429 rate_limit_exceeded`, and running more than 3 concurrent uploads across an organization returns `429` with `Retry-After: 90`. If a service restart occurs while a file is still `queued` or `converting`, that upload stops as `failed` and must be uploaded again (files already in `processing` resume automatically). Querying before `committed` yields incomplete answers.

## Recommendation

Run a sequential queue per agent (or up to 3 parallel workers across separate agents), attach an `Idempotency-Key` to every upload, and poll each `observation_id` to `committed` before going live. If a file stops partway with `failed`, finish only the remaining pieces with [POST`/v2/agents/{agent_id}/files/{file_id}/resume`](https://www.sapientpriors.com/docs/api-reference/v2/files/resume-a-file).

## Calls used

* Guides: [Learning](https://www.sapientpriors.com/docs/concepts/learning.md), [Files](https://www.sapientpriors.com/docs/concepts/files.md), [Limits](https://www.sapientpriors.com/docs/limits.md), [Walkthrough 3: teach from a document](https://www.sapientpriors.com/docs/walkthroughs/teach-from-a-document.md)
* API reference: [Learn messages or a file](https://www.sapientpriors.com/docs/api-reference/v2/threads/learn-messages-or-files.md), [Get learning status](https://www.sapientpriors.com/docs/api-reference/v2/threads/get-learning-status.md), [Resume a file](https://www.sapientpriors.com/docs/api-reference/v2/files/resume-a-file.md), [List files](https://www.sapientpriors.com/docs/api-reference/v2/files/list-files.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.