Agentic HR & Payroll Automation
LangGraph-powered agent that parses unstructured payroll emails, queries PostgreSQL, and routes edge cases to humans (HITL) for approval.
- Time saved
- −80% manual
- HITL escalation
- <8% cases
- Throughput
- 1.2k emails/day
Problem & Solution
The Problem
HR teams spend hours each week parsing free-form payroll emails, matching them to internal records, and routing exceptions. Manual work means delays, errors, and a heavy ops load.
The Solution
Built a LangGraph agent that ingests incoming emails, extracts entities with LLMs, queries PostgreSQL for matching records, performs the relevant payroll action, and pauses for human approval on edge cases via a HITL checkpoint.
System Architecture
End-to-end flow from intake to outcome
- 01
Email Ingest
FastAPIInbound payroll emails are fetched and queued for the agent.
- 02
Entity Extraction
LangChainLLM extracts employee, amount, and intent from free-form email text.
- 03
Record Match
PostgreSQLAgent queries PostgreSQL for matching employee and payroll records.
- 04
HITL Checkpoint
LangGraphEdge cases (anomalies, low confidence) are paused for human approval.
- 05
Action & Audit
PostgreSQLApproved actions are executed; all steps are recorded for audit.
Engineering Challenges & Wins
Optimization results and engineering tradeoffs
Optimization Results
- LangGraph state machine for planning, tool use, and HITL checkpoints.
- PostgreSQL-backed record matching for grounded, auditable actions.
- FastAPI service for ingestion, status, and the human approval surface.
Engineering Challenges
- Designing HITL checkpoints that don't block the happy path.
- Keeping the agent auditable for compliance and HR review.
Related Projects
Mail-server gateway (Postfix Milter) that intercepts every inbound message, runs a fine-tuned BERT core (M-BSCE) through an asynchronous inference pipeline (RabbitMQ + Celery), and adds multimodal threat detection (PaddleOCR for Quishing) with SOAP clawbacks to the upstream mail system.
- Quishing detection
- 98%+
- p95 classification
- <400ms
- Async throughput
- 5k msg/min
Autonomous multi-channel AI platform that unifies chat, voice, and email behind microservices and an API gateway, with shared context across channels.
- Channels
- 3 unified
- Tenant onboard
- <1 day
- Cross-channel memory
- 100%