The architecture of The Autonomous HR is not improvised from a technology wish-list. It is derived from business requirements, expressed through the TOGAF Architecture Development Method, and constrained at every layer by the specific realities of the Rathi Textiles deployment context.
| Stakeholder | Primary concern | Architecture response |
|---|---|---|
| Priya Rathi | Cost below ₹2,000/month, Sunday payroll reclaimed | Serverless scale-to-zero. Payroll automation in Phase 3. Total infra: ~₹550/month. |
| Floor workers | Confirmation in their language in < 60 seconds | Whisper STT + NLLB-200 translation. Multi-language response generation via Gemini Flash. |
| CA / Accountant | Accurate payroll data, ESIC/EPF compliance | Immutable Firestore ledger. Monthly export in Tally-compatible format. Statutory register auto-maintained. |
| Labour Inspector | Leave register per Shops Act, evidence of fair treatment | Append-only audit log with policy clause citation on every decision. 7-year retention. |
| Entity | Store | Key fields | Retention |
|---|---|---|---|
| Employee | Firestore /employees/{id} | name, mobile, language_pref, dept, joining_date, leave_balance {casual, sick, earned}, esic_number | Duration + 3 years |
| Leave Request | Firestore /leave_requests/{id} | employee_id, type, dates[], status, policy_clause, rag_confidence, decision_by (AI|HUMAN), timestamp | 5 years (labour law) |
| Policy Document | Supabase pgvector | chunk_text, embedding[1536], source_doc_version, clause_id, page_number | All versions retained |
| Audit Log | Firestore /audit_log/{id} | timestamp, actor, action, entity_id, policy_clause_ids[], rag_confidence, outcome, escalated(bool) | 7 years (tax compliance) |
| HITL Queue | Firestore /hitl_queue/{id} | request_id, context_json, ai_recommendation, owner_notified_at, resolved_at, resolution, timeout_at | 1 year post-resolution |
| Conversation Session | Firestore /sessions/{id} | channel, employee_id, state_machine_node, context, created_at, ttl: 24h | 24 hours (TTL auto-delete) |