Client
The client shares one budget across candidate signals. It owns:- candidate admission through probability and cost gates;
- concurrency, queue bounds, priority, deduplication, deadlines, and cancellation;
- activity-aware scheduling and direct-intent escalation;
- optional browser visibility and connection gates;
- lifecycle events and in-memory reuse accounting; and
- a typed client for the language-neutral backend protocol.
Backend protocol
The optional protocol batches approved reads and returns them as they finish:capabilitiesdescribes supported transports, representations, and limits;predictionsevaluates a bounded batch and returns lifecycle events; andoutcomesrecords whether resolved work was reused.
products.page prevent the browser from inventing work. Version 1 supports
buffered JSON and NDJSON; any backend language may implement the wire contract.
Host application
The host continues to own:- authentication, authorization, tenancy, and request context;
- the route graph and which destinations are safe to predict;
- resource registration and every read implementation;
- cache identity, freshness, invalidation, and representation reuse;
- the source and calibration of candidate probabilities;
- foreground activity and browser policy signals;
- telemetry storage and rollout decisions; and
- all mutations and external side effects.
Authorization
Authenticate before a Cogni handler and apply foreground authorization inside each resolver. Keep authorization ahead of data access and cache population; Cogni payloads never carry credentials.Cache and reuse
Stable, tenant-aware cache keys enable deduplication and reuse. Reportreused only when the
foreground path consumes the predicted representation; otherwise report missed or expired.
Cancellation
Cogni usesAbortSignal for host cancellation and deadlines. Host I/O must honor it, while the
foreground request remains available.
Portability
Portability comes from protocol version 1 and its conformance fixtures. Non-Node backends implement the lifecycle defined in the backend contract.Continue
- How Cogni works explains the design behind these boundaries.
- Client quickstart creates a first reusable prediction.
- Node server quickstart registers and resolves a read-only resource.
- Backend contract specifies the language-neutral operations.