Five agents.
One orchestrator.
The Intent Router is the entry point for every interaction. It classifies the incoming message and hands off to the appropriate specialist agent. Each specialist owns exactly one domain — no agent crosses its boundary without an explicit A2A handoff.
Orchestrator
Intent Router
Gemini 1.5 Flash · Vertex AI · Stateless
Receives every inbound message. Classifies intent across 6 categories. Extracts entities (employee ID, leave type, dates, language). Routes to the appropriate specialist agent via Pub/Sub event. The only agent that touches every interaction.
Autonomy boundary
Classify and route only. Never decide. Never write state. Never notify. If classification confidence < 0.70 → return clarification prompt to worker.
classify_intent
extract_entities
detect_language
publish_event
Specialist · Phase 1
Leave Agent
LangGraph + Gemini 1.5 Flash · Stateful
Owns the full leave lifecycle: application, balance query, approval, denial, and cancellation. Queries Firestore for employee balance and team headcount. Queries Policy RAG for governing clause. Decides autonomously when confidence ≥ 0.80. Triggers HITL when below threshold.
Autonomy boundary
Approve or deny when: policy confidence ≥ 0.80, balance sufficient, coverage maintained. Escalate to HITL on any failure of these conditions.
get_leave_balance
check_team_coverage
query_policy_rag
write_leave_record
write_audit_log
trigger_hitl
send_notification
Specialist · Phase 1
Policy Q&A Agent
Gemini 1.5 Flash + pgvector RAG · Stateless
Answers any question a worker asks about HR policy — entitlements, notice periods, leave types, payslip timing. Retrieves the governing clause from the Policy RAG store and responds in the worker's detected language. Every answer cites its source clause.
Autonomy boundary
Answer read-only policy questions. Never interpret ambiguous clauses as decisions. If RAG confidence < 0.75 → acknowledge uncertainty, suggest worker contact owner directly.
query_policy_rag
translate_response
send_notification
Specialist · Phase 2
Onboarding Agent
LangGraph + Gemini 1.5 Flash · Stateful
Guides new joinee through document collection via WhatsApp conversation. Collects Aadhaar, PAN, bank details, emergency contact, and photo. Validates document formats. Triggers ESIC/EPF registration workflow. Delivers digital offer letter. Maintains session state across a multi-turn conversation spanning hours or days.
Autonomy boundary
Collect and validate documents autonomously. Never finalise onboarding without Priya's explicit confirmation. Statutory registration trigger requires owner approval.
create_employee_record
validate_document
store_document
trigger_esic_registration
send_offer_letter
Specialist · Phase 4
Grievance Agent
LangGraph + Gemini 1.5 Flash · Stateful
Receives and logs grievances raised by workers via voice or text. Classifies grievance type (wage, conduct, safety, discrimination). Maintains statutory grievance register. Routes to Priya for resolution. Tracks status. Generates labour inspection export on demand.
Autonomy boundary
Log and classify autonomously. Never resolve a grievance without owner action. All wage-related and discrimination grievances require mandatory HITL — no autonomous resolution regardless of confidence.
log_grievance
classify_grievance
update_grievance_register
trigger_hitl
generate_statutory_report
Cross-cutting · All phases
HITL Manager
LangGraph + Cloud Functions · Stateful
Manages every human-in-the-loop escalation. Receives escalation events from any specialist agent. Composes the owner brief (context, AI recommendation, policy clause, confidence score). Sends WhatsApp notification. Waits for resolution via webhook. Times out after 4 hours and re-escalates. Writes resolution to audit log.
Autonomy boundary
Compose and deliver briefs autonomously. Never resolve an escalation without explicit owner action. 4-hour timeout triggers re-escalation, not auto-resolution.
compose_hitl_brief
send_owner_alert
register_resolution_webhook
write_hitl_resolution
re_escalate