Internal AI Assistant for Employees
Design an authorization-aware conversational assistant that uses approved internal context and produces durable compliance evidence.
Problem statement
For this exercise, assume an enterprise offers a conversational AI assistant to authenticated employees. On each turn, existing identity and policy services determine which approved internal knowledge sources the employee may use.
The assistant retrieves permitted context, generates a response with source references, maintains bounded conversation context for the employee, and records an immutable decision record for compliance review.
A response must never contain or cite context the caller cannot access when the response is committed; permission uncertainty fails closed. Access revocations must affect new turns within 60 seconds.
User-visible conversation data is retained for 30 days, while access-controlled compliance records are retained for one year. At 100,000 employees, the design must control retrieval and model-serving cost while preserving the authorization and latency guarantees.
Design the user and context storage, authorization, retrieval, generation, streaming, audit, cost-control, and recovery paths. Exclude model training, public users, autonomous actions in business systems, employment decisions, and arbitrary web search.
What to build
- An authenticated employee can start or continue a conversation, submit one idempotent turn, and receive an ordered streamed response with stable source references.
- The assistant retrieves and supplies to the model only approved context that the employee is currently authorized to read.
- The service stores ordered conversation turns and a bounded context summary so later turns can continue coherently without treating stale or unauthorized text as authority.
- An authorized reviewer can locate an immutable audit decision for a turn and determine who asked, which policy and source versions were evaluated, what outcome was returned, and whether any control failed closed.
At scale
- Assume 100,000 employees and a peak of 2,000 conversation turns per second, with traffic skewed toward a few popular knowledge sources.
- Under normal load, begin streaming a response within 2 seconds at p95 and complete an ordinary response within 10 seconds at p95.
- No fixed dollar budget is supplied. Make retrieval, token, and model-serving cost measurable per tenant and per turn, and explain how the system bounds that cost without weakening authorization or silently dropping supported evidence.
- Apply an access revocation to new retrievals and response commits within 60 seconds without waiting for a full search-index rebuild.
- Retain employee-visible conversations for 30 days and immutable compliance decision records for one year; survive one availability-zone loss without losing an acknowledged turn or its terminal audit outcome.