HR Chat
AI-Powered HR Assistant for Banking
Table of Contents
1. Overview
1.1 Problem Statement
The HR department of the bank receives a high volume of employee questions daily, consuming significant time and resources. Employees need quick answers to HR-related inquiries, but HR staff are overwhelmed with repetitive questions.
1.2 Solution
An AI-powered HR chatbot that:
Document Management
HR uploads and manages documents with access control
AI-Powered Q&A
GPT-4o mini answers questions from authorized documents
LDAP Integration
Department/role-based access control via existing auth
Multi-Platform
Web and mobile interfaces for all employees
1.3 Target Users
| Role | Count | Description |
|---|---|---|
| Employee | 10,000+ | Bank staff asking HR questions |
| HR Admin | 50-100 | HR staff managing documents and Q&A |
2. Goals & Success Criteria
2.1 Primary Goals
- Reduce HR workload by automating 60% of repetitive questions
- Improve employee experience with 24/7 instant answers
- Ensure compliance through proper document access control
- Scale to 10,000+ users with responsive performance
2.2 Success Metrics
Active within 3 months
Rated helpful by users
P95 latency
Reduction in repetitive questions
3. User Roles & Permissions
3.1 Four-Layer Access Control
Layer 1: Global
All employees can access
Layer 2: Department
Based on LDAP group
Layer 3: Role
Manager vs Staff
Layer 4: Location
HQ, Regional, Branch
3.2 Permission Model
Documents are tagged with attributes that map to LDAP groups:
department:*
Matches LDAP department groups
role:*
Matches LDAP role groups
level:*
Matches LDAP OU location
A user can access a document if ANY of their LDAP groups match the document's tags.
4. Features by Role
4.1 Employee Features
10,000+ users
4.2 HR Admin Features
50-100 users
5.1 Employee Flows
5.1.1 Navigation Overview
5.1.2 Login & Authentication
Output: User session created with LDAP groups (department, role, level). Permission tags loaded for document access filtering.
5.1.4 Ask Question - Happy Path
Key: Vector search is filtered by user's permission tags, ensuring employees only see answers from documents they have access to.
5.1.5 AI Cannot Answer → Escalation
Design decision: Uses mailto: for simplicity (no backend ticket system needed for v1). Escalation events are logged for analytics.
5.1.6 Report Incorrect Answer
5.1.7 Follow-Up Question (Multi-Turn)
Context window: System maintains last N messages (configurable, default: 10). Older messages summarized if thread is long. Thread title auto-generated from first question.
5.1.10 Session Timeout
2 min before timeout] B --> C{User action?} C -->|Stay Logged In| D[Reset timer
Continue session] C -->|Log Out/Timeout| E[Save draft if any] E --> F[Clear session] F --> G[Redirect to Login] G --> H[After re-login:
Restore draft] style B fill:#fcd34d style H fill:#86efac
Banking apps have strict security requirements. Session timeout is configurable (e.g., 15 minutes).
5.2 HR Admin Flows
5.2.1 Navigation Overview
5.2.2 Upload Document
Select File
PDF, DOCX
Details
Title, Category
Permissions
Dept, Role, Location
Confirm
Review & Upload
5.2.4 Review Unanswered Questions
Data-driven content creation: HR sees exactly which questions employees are asking that can't be answered, with frequency counts and department breakdowns.
5.2.6 View Analytics
1,247
Questions Asked
+23% from last month
89%
Answer Rate
+5% from last month
47
Unanswered
-12% from last month
Analytics include: top questions, usage by department, most cited documents, reported issues, and escalation counts.
5.3 Feedback Loop
Questions AI couldn't answer → content gaps identified
Wrong answers flagged → quality issues found
Emails to HR → complex topics identified
Feedback Loop Summary
| Source | What It Captures | HR Admin Action |
|---|---|---|
| Unanswered Questions | Questions AI couldn't answer | Create missing documents |
| Reported Issues | Answers flagged as incorrect | Update/correct documents |
| Escalations | Questions sent to HR via email | Identify complex topics |
6. Architecture
6.1 High-Level Architecture
React] M[Mobile App
React Native] end subgraph API Gateway G[Rate Limiting
SSL / Load Balancing] end subgraph Backend Services Auth[Auth Module
LDAP Integration] Doc[Document Service
Upload/Search] Chat[Chat Service
RAG Pipeline] Admin[Admin Service
Analytics] end subgraph Data Layer PG[(PostgreSQL)] Redis[(Redis Cache)] S3[(S3/Blob Storage)] VDB[(Pinecone
Vector DB)] end subgraph External OpenAI[OpenAI API
GPT-4o mini] end W --> G M --> G G --> Auth G --> Doc G --> Chat G --> Admin Auth --> PG Doc --> PG Doc --> S3 Doc --> VDB Chat --> VDB Chat --> OpenAI Chat --> Redis Admin --> PG style W fill:#93c5fd style M fill:#93c5fd style VDB fill:#c4b5fd style OpenAI fill:#fcd34d
6.2 Component Description
| Component | Responsibility |
|---|---|
| Auth Module | Integrates with existing bank authentication (LDAP) |
| Document Service | Handles upload, storage, versioning, search |
| Chat Service | RAG pipeline, OpenAI integration, conversation management |
| Admin Service | HR admin features, analytics, audit reports |
| Vector Store | Stores document embeddings for semantic search |
| PostgreSQL | Relational data: users, documents, permissions, audit logs |
| Redis | Session cache, API response cache |
| S3/Blob | Encrypted document file storage |
7. Data Flow
7.1 Document Processing Pipeline
Upload] --> B[Extract Text
PyMuPDF] B --> C[Clean &
Normalize] C --> D[Chunk
512-1024 tokens] D --> E[Generate
Embeddings] E --> F[Store in
Pinecone] F --> G[Ready for
Search] style A fill:#fcd34d style F fill:#c4b5fd style G fill:#86efac
7.2 RAG (Retrieval-Augmented Generation) Pipeline
Embedding] B --> C[Vector Search
+ Permission Filter] C --> D[Top 5
Chunks] D --> E[Build Prompt
System + Context + Q] E --> F[GPT-4o mini] F --> G[Answer +
Source Refs] style C fill:#c4b5fd style F fill:#fcd34d style G fill:#86efac
Why RAG?
- • No model training needed - uses GPT-4o mini out of the box
- • Always up-to-date - searches documents in real-time
- • Source citations - every answer links to source documents
- • Permission-aware - respects document access control
8. AI Data Integration
8.1 Supported Document Types
| Format | Priority | Notes |
|---|---|---|
| P0 | Primary format - full support | |
| DOCX | P0 | Microsoft Word documents |
| DOC | P2 | Legacy Word format - convert to DOCX |
| Scanned PDF | P2 | Requires OCR (Tesseract/AWS Textract) |
8.2 Chunking Strategy
| Parameter | Value | Rationale |
|---|---|---|
| Chunk size | 512-1024 tokens | Balance context vs noise |
| Overlap | 50 tokens | Prevent context cutting |
| Min chunk size | 100 tokens | Avoid too-small chunks |
| Max chunks per doc | 100 | Prevent huge documents |
8.3 Embedding Model
| Model | Cost | Status |
|---|---|---|
| text-embedding-3-small | $0.02/1M tokens | SELECTED |
| text-embedding-3-large | $0.13/1M tokens | Overkill |
| text-embedding-ada-002 | $0.10/1M tokens | Legacy |
8.4 AI Model Configuration
| Parameter | Value |
|---|---|
| Primary Model | GPT-4o mini |
| Temperature | 0.3 (focused, consistent) |
| Max tokens | 1000 |
| Fallback | "I don't have information..." |
9. Tech Stack
9.1 Recommended Stack
Web Frontend
React + Vite
Large talent pool, fast development
Mobile Frontend
React Native (Expo)
Code sharing with web
Backend
Node.js + TypeScript
Same language, good OpenAI SDK
Database
PostgreSQL
Enterprise standard
Cache
Redis
Session, response caching
File Storage
AWS S3
Scalable, encrypted at rest
Vector DB
Pinecone
Managed, scales to 10K users
AI Model
GPT-4o mini
Cost-effective, good performance
Embeddings
text-embedding-3-small
Best value
10. Security
10.1 Security Layers
| Layer | Implementation |
|---|---|
| Authentication | Integration with existing bank LDAP |
| Encryption | TLS 1.3 in transit, AES-256 at rest |
| API Security | Rate limiting (100 req/min/user) |
| Audit Log | Every query logged with user, question, sources |
| Data Residency | All data within Vietnam (configurable) |
| Document Access | Permission tags enforced at query time |
10.2 Compliance Considerations
11. Sprint Plan & User Stories
11.1 Sprint Overview (12 weeks)
Sprint 1-2 (17 pts)
Document Management + Web UI
Weeks 1-4
Sprint 3-4 (18 pts)
AI Q&A Engine + Chat
Weeks 5-8
Sprint 5-6 (17 pts)
Mobile + Admin + Polish
Weeks 9-12
11.2 User Stories - Document Management (Sprint 1-2)
| ID | User Story | Points | Priority |
|---|---|---|---|
| US-2.1 | As HR Admin, I want to upload PDF/DOCX documents | 3 | P0 |
| US-2.2 | As HR Admin, I want to tag documents by dept/role/level | 5 | P0 |
| US-2.3 | As HR Admin, I want to see document version history | 3 | P1 |
| US-2.4 | As HR Admin, I want to set document expiration dates | 3 | P1 |
11.3 User Stories - AI Q&A Engine (Sprint 3-5)
| ID | User Story | Points | Priority |
|---|---|---|---|
| US-3.1 | As employee, I want to ask questions in natural language | 8 | P0 |
| US-3.2 | As employee, I want to see source documents for each answer | 5 | P0 |
| US-3.3 | As employee, I want AI to say "I don't know" when unsure | 3 | P1 |
| US-3.4 | As employee, I want to ask follow-up questions (context) | 5 | P1 |
| US-3.5 | As employee, I want to view my past conversations | 3 | P1 |
| US-3.6 | As employee, I want to email HR when AI can't answer | 2 | P0 |
| US-3.7 | As employee, I want to report incorrect AI answers | 3 | P1 |
11.4 User Stories - Admin & Analytics (Sprint 5-6)
| ID | User Story | Points | Priority |
|---|---|---|---|
| US-6.1 | As HR Admin, I want a document management dashboard | 5 | P0 |
| US-6.2 | As HR Admin, I want to see most asked questions | 3 | P1 |
| US-6.3 | As HR Admin, I want to see unanswered questions | 3 | P0 |
| US-6.4 | As HR Admin, I want to review reported issues | 3 | P1 |
12. Milestones
| Milestone | Target Date | Description |
|---|---|---|
| M1: Sprint 1 Complete | Week 2 | Document upload + tagging working |
| M2: Sprint 2 Complete | Week 4 | Full document management + web UI |
| M3: Sprint 3 Complete | Week 6 | Basic Q&A engine functional |
| M4: Sprint 4 Complete | Week 8 | Web chat polished, mobile started |
| M5: Sprint 5 Complete | Week 10 | Mobile chat + admin features |
| M6: Release | Week 12 | Production deployment |
13. Risks & Mitigations
LDAP Integration Complexity
High ImpactBank's LDAP structure may be complex with edge cases
Mitigation: Start with test LDAP environment early in Sprint 1
Q&A Quality Inconsistent
High ImpactAI may give incorrect or unhelpful answers
Mitigation: Extensive prompt testing, user feedback loop, report issue mechanism
Performance at Scale
Medium Impact10K concurrent users may stress the system
Mitigation: Redis caching, CDN, read replicas, load testing in Sprint 4
OpenAI API Dependency
Medium ImpactExternal dependency, potential outages or rate limits
Mitigation: Graceful fallbacks, response caching, consider Azure OpenAI for enterprise SLA