Client Engagement Chat

Provide a private, token-protected chat portal for individual clients with vector-retrieved context.

What you can do#

The client engagement chat provides a private, branded chat portal for individual clients. Each client gets a dedicated endpoint that draws on client-specific knowledge documents, with answers grounded in engagement materials relevant to that client.

CapabilityDescriptionStatus
Per-client portalUnique URL per client slugShipped
Engagement-scoped groundingDocuments sourced from the engagement projection read-modelShipped
Engagement token authBearer-token validation via the engagement projection APIShipped
Streaming chatReal-time SSE streaming responsesShipped
Conversation limitsTurn cap and message length validationShipped
Default-deny visibilityVisibility policy inherited from the engagement projectionShipped

How it works#

Each client portal is accessed via a unique URL:

POST /api/clients/<client-slug>/chat
Authorization: Bearer <engagement-token>

When a user sends a message:

  1. The engagement-scoped token is verified through the engagement projection API (resolveEngagementRequest) — the same auth path external integrations use.
  2. The engagement is loaded with its enabled capabilities and audience scope.
  3. Grounding documents are pulled from the engagement document read-model published by INIT-123, not the legacy filesystem RAG path.
  4. The AI generates a streaming response grounded in the trusted engagement materials returned by the projection.

Knowledge sources#

Grounding documents come from the engagement projection's document read-model. Workspace integrators publish documents to the engagement index; the chat surface inherits the same default-deny visibility the static /clients/{slug} projection applies.

info The legacy filesystem RAG path (docs/clients/<slug>/) and the direct vector lookup against client_knowledge_documents are deprecated behind the engagement read model and only remain as source data for the document indexer.

Configuration#

VariableDescription
SIDEKICK_PUBLIC_API_KEYAPI key for the AI model (required)
Engagement tokenIssued per engagement via the projection API; presented as Authorization: Bearer

Limits#

  • Conversation turns -- maximum 10 turns per session
  • Message length -- 2,000 characters per message
  • Retrieval results -- bounded by the engagement document read model

Security#

  • Engagement-scoped auth -- every request requires a valid engagement token; workspace API keys and shared environment tokens are no longer accepted.
  • Client isolation -- each engagement slug resolves to its own projection scope; visibility policy is enforced by the loader.
  • Default-deny visibility -- the chat surface never sees content the static projection would have redacted.

warning Engagement tokens are per-engagement credentials. Treat them like API keys and rotate via the engagement token management surface if they may have been exposed.