Skip to main content
POST
Learn and recall

Authorizations

Authorization
string
header
required

An API key, shaped spk_<key_id>_<secret><checksum>, sent as Authorization: Bearer spk_.... Each key belongs to one project and reaches only that project: an id from another project answers 404.

  • A service account's key runs your product. It acts as the service account, with the role the service account holds in the project, and keeps working when people leave. It reaches the project's public agents, never a private one. Only this key may send X-SP-End-User.
  • A personal key acts as the person who created it, with their role in the project. It is for building and testing: every response carries X-SP-Warning: personal API key, not for production, and X-SP-End-User is refused with 400.

Keys are created and revoked on the API keys page of the Priors application. No API endpoint creates or revokes a service account's key. A personal key lasts 30, 90, or 365 days (90 by default), and a person can hold 10 live personal keys in an organization. A service account's key lasts 90 or 365 days (365 by default), and a service account can hold 5 live keys. The secret is shown once, at creation, and cannot be recovered.

A personal key made before projects (spu_...) keeps working until it expires, in its organization's Default project.

Keep keys on your server: a request with a Sec-Fetch-Site header is refused with 400, and Priors sends no CORS headers.

Headers

Idempotency-Key
string | null

A key you choose so a retry is safe: a retry with the same key and body gets the first response back instead of running again. Reusing a key for a different request, or while the first is still running, returns 409 conflict, with details idempotency_key_reused (use a new key) or idempotency_key_in_flight (wait, then retry).

Required string length: 1 - 255

Path Parameters

agent_id
string
required

The agent's identifier.

Pattern: ^agent_[0-9A-HJKMNP-TV-Z]{26}$
thread_id
string
required

The thread's identifier, scoped to the agent.

Pattern: ^thread_[0-9A-HJKMNP-TV-Z]{26}$

Body

application/json

One message to find memories for. Only observe-and-recall learns it.

content
string
required

The message to find memories for.

Required string length: 1 - 2000000
speaker_id
string | null

Your own id for the speaker. Kept on the turn and returned with it.

Required string length: 1 - 200
timestamp
string<date-time> | null

When the message was said, used to date its memories. Defaults to when the server receives it.

metadata
TurnMetadata · object | null

Where the message came from, kept on the turn and returned with it.

speaker
string | null

Who said the message, such as a person's name. Required with an API key.

Required string length: 1 - 200
limit
integer
default:20

The most memories to return.

Required range: 1 <= x <= 100

Response

Successful Response

The memories one message needs.

memories
RecalledMemory · object[]
required

The memories the agent used for this message, in the order its search found them.

observation_id
string | null
required

Server-generated observation identifier.

Pattern: ^obs_[0-9A-HJKMNP-TV-Z]{26}$