SUHOB ยท Proof of concept
AI-Powered HR Assistant
Overview
A bilingual (English and Arabic) HR assistant for employees. An employee types or speaks a request in the mobile app, such as booking sick leave, checking this month's attendance or asking about a company policy. An AI agent understands the request and calls the backend to apply the real HR rules, then answers by text or by voice. Policy answers cite the company document and page they came from.
I designed and built the .NET 9 backend: the security and business-rules layer between the Flutter app and the LangChain AI agent. The AI decides what the user is asking for; the backend decides who the user is (from their Microsoft Entra ID token) and whether they are allowed (from the HR rules and roles in the database). The AI agent, the mobile app and the Azure setup were built by teammates, and I integrated with all three.
See it in action
A real-time, speech-to-speech conversation in Arabic. The assistant checks the employee's leave balance, asks for the reason behind a sick-leave request and submits it, then summarizes last week's attendance aloud while showing the report on screen. Turn your sound on to hear it.
App screensThe admin web portal: signing in with Microsoft Entra ID, then working through the leave approval queue. A comment is required on every decision, approvers can't decide their own requests, and decided requests move to the recently decided list. Employee names, emails and comments are blurred for privacy.
What I did
- Implemented Microsoft Entra ID authentication with two separate schemes on one app registration: JWT Bearer for the mobile app and the AI agent, and OpenID Connect with cookies for the admin portal
- Built database-backed role-based access control (Employee, Approver, Admin) checked on every request, so role changes apply immediately and are audit-logged; the agent's tool calls reuse the user's own token, so the AI can never act beyond the user's permissions
- Built a WebSocket chat endpoint that streams the agent's answer token by token by relaying its Server-Sent Events stream, with server-owned, resumable conversations and every message saved
- Built a bidirectional WebSocket voice relay to the AI team's real-time voice service (Azure OpenAI real-time), streaming audio both ways with secrets added server-side, one live session per user, retry with backoff and keep-alive
- Added English/Arabic speech-to-text with Azure AI Speech and Azure Blob Storage, and diagnosed and fixed production failures from server logs
- Implemented concurrency-safe leave management (balances, pending reservations and an approval workflow), with a row-level lock so two simultaneous requests can't both pass the balance check
- Built the attendance API for the agent's tools, with team-based data scoping, per-user rate limiting, audit logging and bilingual fuzzy name search that normalizes Arabic spelling variants
- Integrated the agent's retrieval-augmented generation (RAG) citations: relayed sources to the app in real time, saved them with each answer, issued fresh time-limited links on demand, and built an admin library for the documents the AI answers from
- Wrote 4 automated test suites (~300 checks) with a mock AI agent, plus Postman collections and the API documentation the mobile and AI teams built against