PAIPAI

Concepts

The product concepts behind PAI applications.

PAI apps are easiest to understand in this order:

  1. An agent defines behavior and a typed contract.
  2. A server binds that agent to storage, auth, and routes.
  3. A client creates or opens durable threads.
  4. A thread stores messages, queued items, run lifecycle records, active run lease state, pending actions derived from tool parts, and status.
  5. The message format is the canonical transcript shape that PAI projects into model input and client state.
  6. A run tracks one execution of model and tool work.
  7. Clients receive live updates through snapshots, watch streams, polling, or transport streams.
  8. Tools and pending actions let agents call backend code, client capabilities, or humans.
  9. Scope and access keep durable state isolated by user, workspace, or tenant.

The concepts are intentionally state-first. A PAI app should continue working even when no client is watching.

After these concepts, use the guides for implementation: