What Priors does
Priors gives your product a long-term memory. You send Priors what happens: messages, notes, and documents. Priors extracts memories from them. Later, you ask a question and Priors answers from those memories (or returns the memories for your own model). You do three things:- Create an agent.
- Send the agent messages or files.
- Ask the agent questions.
Resource hierarchy
Everything in Priors lives inside four nested levels:Organization
Your company: people, credits, and projectsProject
People with roles, service accounts, and API keysAgentMemory boundary
Isolated memory and file storeFiles
Uploaded documents and imagesMemories
Facts learned from turns and filesThreads
Separate conversations, not memoriesTurns
Messages and document piecesThe core v2 calls
Every path is relative tohttps://app.sapientpriors.com/api.
Choosing an answering call
Pick along two axes: who writes the answer and whether the agent learns from the question.
Use
observe-and-respond or respond by default: Priors retrieves memories, writes the answer, and attaches file citations (and supports stream: true for server-sent events). Use observe-and-recall or recall when you already run your own language model and prompt. See Answering.
Calls that finish asynchronously
Two creation/learning calls return202 before their background work finishes. Poll their GET endpoint until the final status arrives:
- After POST
/v2/agents, poll GET/v2/agents/untilstatusisready. - After POST
…/observe, poll GET…/observe/untilstatusiscommitted.
/v2/agents//files/) also returns 202; poll the Location URL until every citing turn is forgotten. See Files.
One agent per trust boundary
If you build a product for your own customers, give each customer their own agent. An agent has its own memory index and file store, so nothing crosses between customers. Keep your own mapping of whichagent_id belongs to which customer.
Inside one agent, send X-SP-End-User with your service-account key to separate each person’s thread list and give each person their own rate-limit window. Memory remains shared across the agent. See How to use.
Where to go next
How to use Priors
14 situation-led setups: what works, what goes wrong, and which calls to pick.
The complete lifecycle
Every v2 call in usage order, with requests, responses, and error tables.
Walkthrough 1: your first agent
Create an agent, teach it two facts, and ask a question in six v2 calls.
Walkthrough 2: bring your own model
Use observe-and-recall and recall to feed memories into your own prompt.
Walkthrough 3: teach from a document
Upload a PDF with multipart observe, poll progress, and get cited answers.
Limits
Rate windows, concurrency caps, 30 MiB file cap, and agent ceilings.
Your data
What Priors stores and what each delete operation actually removes.
Credits
Token pricing, usage reports, and what happens at zero balance.