AI HR Operations Platform
Independently deployable open-source HR microservice automating employee onboarding, RAG policy Q&A, leave accruals, and performance reviews.
01. Problem & Context
Growing teams often juggle disconnected recruiting trackers, static PDF handbooks, manual PTO spreadsheets, and fragile review tools—while risking employee PII exposure whenever staff paste HR questions into consumer AI chats.
02. Engineering Solution
Engineered a standalone FastAPI + PostgreSQL (pgvector) microservice paired with a React 18 / TypeScript SPA. Automates candidate-to-employee onboarding via signed HMAC-SHA256 webhooks from ai-recruiter, grounds policy answers in cited pgvector RAG retrieval behind a pre-inference PII scrubber, and orchestrates leave accruals and 360-degree OKR cycles via Celery Beat.
03. System Architecture
Deployed via Docker Compose across FastAPI, Celery workers/Beat, PostgreSQL 16 with pgvector, Redis 7, local Ollama inference, and a React/Vite frontend. Multi-tenant RBAC and active JWT revocation isolate employee records while asynchronous workers process leave accruals, onboarding checklists, and review synthesis.
Core Architectural Components
Signed AI Recruiter Offer-to-Onboarding Handoff
Consumes HMAC-SHA256 signed offer-accepted webhooks from ai-recruiter with idempotent event handling to automatically provision employee records and onboarding task checklists.
Policy Enforcement & pgvector RAG Knowledge Base
Ingests employee handbooks, compliance policies, and SOPs into PostgreSQL pgvector embeddings, grounding employee Q&A responses with direct policy section citations.
Multi-Tier Leave & Attendance Accrual Engine
Schedules Celery Beat accrual jobs across PTO, sick, parental, and bereavement tiers with rollover caps, team calendar conflict detection, and managerial approval queues.
Performance Management, OKRs & Anti-Bias Review Synthesis
Coordinates goal/OKR progress tracking and 360-degree feedback cycles (self, manager, peer, direct report) with structured anti-bias guardrails during feedback summarization.
Multi-Tenant RBAC, PII Scrubber & Active JWT Revocation
Enforces tenant isolation across four role tiers (SUPER_ADMIN, HR_ADMIN, PEOPLE_MANAGER, EMPLOYEE), scrubs sensitive PII prior to LLM inference, and enforces active JWT logout revocation with immutable audit logs.
04. Notable Engineering Decisions
Standalone Microservice Coupled via HMAC-SHA256 Webhooks
Keeping HR operations independent from recruiting avoids monolithic coupling while allowing seamless candidate-to-employee handoff over signed, verifiable webhook contracts.
Pre-Inference PII Scrubbing with Local Ollama Models
HR data contains SSNs, compensation, and personal contact info. Scrubbing PII before inference and defaulting to local Ollama models (Llama 3.1 8B, Qwen 2.5 7B, nomic-embed-text) protects confidential employee records.
Security-Hardened Dependency & Session Hygiene in v2.0.1
Upgraded Vite to 6.4.6 to eliminate high-severity CVEs (0 frontend vulnerabilities in npm audit), fixed cross-module API dependency exports, and added active JWT revocation with anti-replay checks.
05. Engineering Challenges & Solutions
Challenge: Preventing sensitive employee identifiers (SSNs, phone numbers, personal emails) from reaching LLM context windows.
Engineering Solution: Implemented a pre-inference pattern and regex PII scrubber in the service layer alongside local Ollama model routing and immutable compliance audit logging.
Challenge: Managing multi-tier PTO rollover rules and preventing simultaneous team coverage gaps during leave approvals.
Engineering Solution: Built scheduled Celery Beat accrual recalculation jobs paired with real-time team calendar conflict detection inside the managerial approval workflow.
06. Implementation Highlights
- FastAPI + async SQLAlchemy 2.0 backend with Alembic migrations, PostgreSQL 16 pgvector, and Redis 7
- HMAC-SHA256 verified candidate.offer_accepted webhook integration with ai-recruiter and simulator CLI
- Pre-inference PII scrubber, local Ollama RAG embeddings, and immutable compliance audit logging
- Celery Beat multi-tier leave accrual engine, rollover caps, and concurrent team calendar conflict checks
- React 18 + Vite 6.4.6 + TypeScript + TanStack Query frontend with 0 npm audit vulnerabilities
- GitHub Actions CI running backend pytest suites against live pgvector/Redis and frontend builds