HR Chat

AI-Powered HR Assistant for Banking

Version 1.5 January 26, 2026 Draft

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

Adoption Rate 70%

Active within 3 months

Answer Accuracy 85%

Rated helpful by users

Response Time < 3s

P95 latency

HR Time Saved 50%

Reduction in repetitive questions

3. User Roles & Permissions

3.1 Four-Layer Access Control

graph TB subgraph "Layer 1: Global" G1[Company Policies] G2[Benefits Info] G3[Holiday Calendar] end subgraph "Layer 2: Department" D1[IT Policies] D2[Finance Policies] D3[Branch Procedures] end subgraph "Layer 3: Role" R1[Manager Docs] R2[Staff Docs] end subgraph "Layer 4: Location" L1[HQ Docs] L2[Regional Docs] L3[Branch Docs] end User([Employee]) --> G1 User --> G2 User --> G3 User -.->|If IT Dept| D1 User -.->|If Manager| R1 User -.->|If HQ| L1 style G1 fill:#86efac style G2 fill:#86efac style G3 fill:#86efac style D1 fill:#93c5fd style R1 fill:#c4b5fd style L1 fill:#fcd34d

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

P0 Login (via bank SSO)
P0 View/Search Documents
P0 Ask Questions (AI Q&A)
P0 Source Citations
P0 Multi-turn Conversations (Thread)
P0 Escalate to HR (Email)
P1 Conversation History
P1 Related Documents
P1 Report Incorrect Answers

4.2 HR Admin Features

50-100 users

P0 Upload Documents (PDF/DOCX)
P0 Tag Documents
P0 Set Permissions
P0 Document Dashboard
P0 Unanswered Questions Dashboard
P1 Version History
P1 Expiration Dates
P1 Review Reported Issues
P1 Analytics & Top Questions
P2 Audit Reports (CSV/PDF)

5.1 Employee Flows

5.1.1 Navigation Overview

flowchart TB Login[Login] --> FirstTime{First time?} FirstTime -->|Yes| Onboarding[Onboarding Guide] FirstTime -->|No| Dashboard[Dashboard] Onboarding --> Dashboard Dashboard --> AskHR[Ask HR Chat] Dashboard --> DocLib[Document Library] Dashboard --> History[Conversation History] Dashboard --> Search[Search] style Dashboard fill:#86efac style Onboarding fill:#fcd34d

5.1.2 Login & Authentication

flowchart LR A[Open App] --> B[Login Screen] B --> C[Click SSO] C --> D[Bank Auth] D --> E{Success?} E -->|Yes| F[Fetch LDAP Permissions] E -->|No| G[Show Error] G --> B F --> H{First Time?} H -->|Yes| I[Onboarding] H -->|No| J[Dashboard] I --> J style J fill:#86efac style I fill:#fcd34d

Output: User session created with LDAP groups (department, role, level). Permission tags loaded for document access filtering.

5.1.4 Ask Question - Happy Path

sequenceDiagram participant U as Employee participant UI as Chat UI participant API as Backend participant VDB as Vector DB participant AI as GPT-4o mini U->>UI: Type question UI->>API: Send question + user context API->>VDB: Search (filtered by permissions) VDB-->>API: Top 5 relevant chunks API->>AI: Question + Context + Chunks AI-->>API: Answer with source refs API-->>UI: Display answer UI-->>U: Show answer + citations

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

flowchart TD A[User asks question] --> B[AI searches documents] B --> C{Found relevant docs?} C -->|Yes| D[Generate answer] C -->|No| E[Show: I don't have info] E --> F[Show Email HR button] F --> G{User clicks?} G -->|Cancel| H[Return to chat] G -->|Send Email| I[Log escalation event] I --> J[Open mailto: with context] J --> K[User sends email] style E fill:#fcd34d style I fill:#93c5fd style K fill:#86efac

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

flowchart LR A[AI gives answer] --> B[User notices error] B --> C[Click ⋯ menu] C --> D[Select Report Issue] D --> E[Choose category] E --> F[Add context optional] F --> G[Submit] G --> H[Log report] H --> I[Show confirmation] style D fill:#fca5a5 style H fill:#93c5fd style I fill:#86efac
Incorrect info
Outdated
Doesn't answer
Missing details

5.1.7 Follow-Up Question (Multi-Turn)

sequenceDiagram participant U as User participant AI as AI Assistant U->>AI: How many annual leave days do I have? AI-->>U: You are entitled to 12 days per year... Note over AI: 📄 Source: Benefits Policy 2024 U->>AI: Can I carry them over? Note over AI: Context: "them" = annual leave days AI-->>U: Yes, you can carry over up to 5 unused days... Note over AI: 📄 Source: Benefits Policy Section 3.2

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

flowchart TD A[User idle X min] --> B[Warning Modal
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

flowchart TB Login[Login] --> AdminPanel[Admin Panel Dashboard] AdminPanel --> Documents[Documents Management] AdminPanel --> Unanswered[Unanswered Questions] AdminPanel --> Reported[Reported Issues] AdminPanel --> Analytics[Analytics] AdminPanel --> Settings[Settings] Documents --> Upload[Upload Document] Documents --> Edit[Edit Document] Documents --> Archive[Archive Document] Documents --> Delete[Delete Document] style AdminPanel fill:#c4b5fd

5.2.2 Upload Document

flowchart LR A[Click Upload] --> B[Select File] B --> C[Enter Details] C --> D[Set Permissions] D --> E[Set Expiration] E --> F[Confirm] F --> G[Processing] G --> H[Extract Text] H --> I[Chunk Document] I --> J[Generate Embeddings] J --> K[Store in Vector DB] K --> L[Success!] style F fill:#fcd34d style G fill:#93c5fd style L fill:#86efac
1

Select File

PDF, DOCX

2

Details

Title, Category

3

Permissions

Dept, Role, Location

4

Confirm

Review & Upload

5.2.4 Review Unanswered Questions

flowchart TD A[View Dashboard] --> B[See unanswered questions] B --> C[Sorted by frequency] C --> D{Action?} D -->|View Details| E[See related conversations] D -->|Create Doc| F[Pre-filled upload form] E --> G[Understand context] G --> F F --> H[Upload new document] H --> I[Question now answerable] style B fill:#fcd34d style F fill:#93c5fd style I fill:#86efac

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

flowchart LR subgraph Employee A[Ask Question] --> B{AI Answers?} B -->|No| C[Escalate to HR] B -->|Yes but Wrong| D[Report Issue] B -->|Yes, Correct| E[Happy!] end subgraph HR Admin Dashboard F[Unanswered Questions] G[Reported Issues] H[Escalation Count] end subgraph Action I[Create/Update Documents] J[AI Gets Smarter] end C --> F D --> G C --> H F --> I G --> I I --> J J --> E style C fill:#fcd34d style D fill:#fca5a5 style E fill:#86efac style J fill:#c4b5fd
Unanswered

Questions AI couldn't answer → content gaps identified

Reported

Wrong answers flagged → quality issues found

Escalated

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

flowchart TB subgraph Clients W[Web App
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

flowchart LR A[PDF/DOCX
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
1. Upload to S3
2. Extract text
3. Chunk (512-1024)
4. Generate embeddings
5. Store with metadata

7.2 RAG (Retrieval-Augmented Generation) Pipeline

flowchart LR A[User Question] --> B[Generate
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
PDF 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

Audit trails for all document access and queries
Data retention policies for chat history
Document versioning for compliance documentation
Role-based access enforced at API level

11. Sprint Plan & User Stories

11.1 Sprint Overview (12 weeks)

gantt title HR Chat Development Timeline (12 weeks) dateFormat YYYY-MM-DD section Sprint 1-2 Document Management :2026-01-27, 4w section Sprint 3-4 AI Q&A Engine :2026-02-24, 4w section Sprint 5-6 Mobile + Admin :2026-03-24, 4w

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 Impact

Bank's LDAP structure may be complex with edge cases

Mitigation: Start with test LDAP environment early in Sprint 1

Q&A Quality Inconsistent

High Impact

AI may give incorrect or unhelpful answers

Mitigation: Extensive prompt testing, user feedback loop, report issue mechanism

Performance at Scale

Medium Impact

10K concurrent users may stress the system

Mitigation: Redis caching, CDN, read replicas, load testing in Sprint 4

OpenAI API Dependency

Medium Impact

External dependency, potential outages or rate limits

Mitigation: Graceful fallbacks, response caching, consider Azure OpenAI for enterprise SLA