Requirements & Constraints
Job-scoped context is mandatory; no cross-tenant retrieval.
Offline-friendly UX and low latency at the edge.
Structured data is authoritative; unstructured is supportive.
Accuracy thresholds differ by content type and risk.
Latency & Offline Constraints
- P95 response time under 2.5 seconds for typical queries.
- First response should succeed even with limited connectivity by using cached context.
- Mobile-friendly streaming responses for long answers.
Tradeoff
We accept slightly less context if it keeps the first answer under the latency budget.
Accuracy Requirements by Content Type
- Procedures: must be backed by explicit evidence or refuse.
- Part numbers: require exact keyword matches.
- Error codes: must cite source notes or manuals.
- Wiring diagrams: never interpret without a linked manual reference.
Risk
High-risk procedures (electrical, gas, refrigerant) require evidence plus safety reminders.
Data Sources & Trust Levels
Authoritative: job records, equipment inventory, and structured events in D1.
Supporting: technician notes, office notes, call logs in Vectorize.
External: manuals and attachments stored in R2; only referenced with citations.
Decision
Structured facts always lead; retrieval is additive and never overrides system-of-record data.
Permissions & Tenancy
- Auth Worker issues first-party JWTs.
- API Worker validates JWTs via JWKS and enforces tenant scope.
- Retrieval filters always include tenant and job identifiers.