Skip to main content
New to Priors? For architectural setup patterns by use case, start with How to use. Authenticate every request with an API key that belongs to one project: a service-account key for calling Priors from your backend on behalf of your product, or a personal key for calling Priors from your own scripts and tools while you build. See Authentication. Setting up for the first time? Start with Set up your organization.

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:
  1. Create an agent.
  2. Send the agent messages or files.
  3. Ask the agent questions.

Resource hierarchy

Everything in Priors lives inside four nested levels:
Organization
Your company: people, credits, and projects
Project
People with roles, service accounts, and API keys
AgentMemory boundary
Isolated memory and file store
Files
Uploaded documents and images
Memories
Facts learned from turns and files
Threads
Separate conversations, not memories
Turns
Messages and document pieces
Each agent’s memory is its own; everyone who talks to one agent shares what it learns. A fact learned in one thread is available in every thread of the same agent. Threads keep conversations separate; agents keep memories separate.

The core v2 calls

Every path is relative to https://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 return 202 before their background work finishes. Poll their GET endpoint until the final status arrives: File deletion (DELETE/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 which agent_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.