Document Management + AI Search Use Cases
Use cases for document upload, tagging, search, and AI-powered policy Q&A
Document Management + AI Search Use Cases
This document describes use cases for uploading and managing HR documents, traditional and AI-powered search, document tagging, and the AI assistant for policy questions.
Actors
| Actor | Description |
|---|---|
| Employee | Uploads personal documents, searches, asks AI questions |
| Manager | Uploads team documents, manages team document access |
| Tenant Admin | Uploads company documents, configures policies, full access |
| AI Assistant | Provides answers using RAG (Retrieval-Augmented Generation) |
UC-DOC-01: Upload Document
Primary Actor: Tenant Admin, Manager, Employee (if permitted)
Preconditions
- Actor is authenticated
- Actor has document upload permission
- Document meets size and type requirements
Main Flow
- Actor navigates to Documents → Upload
- Selects file from local system
- System validates:
- File size (max 10MB)
- File type (PDF, DOCX, DOC, JPG, PNG)
- Enters document metadata:
- Title (auto-filled from filename, editable)
- Description (optional)
- Selects visibility level (default based on role):
- Private: Only uploader can access (default for Employees)
- Manager: Uploader + direct manager
- Team: Uploader's team members
- Department: All department members
- All Managers: All users with Manager role
- All Employees: Everyone in tenant
- Company: Everyone + featured in company docs (default for HR)
- Specific People: Custom list of users/roles/departments
- Adds tags from available options:
- Contract
- Policy
- Onboarding
- Confidential
- Template
- Custom tags
- Clicks Upload
- System:
- Stores file in cloud storage
- Creates metadata record
- Generates RAG embeddings for AI search
- Confirms successful upload
Alternative Flows
A1: File Too Large
- System displays "File exceeds 10MB limit"
- User must compress or split file
A2: Invalid File Type
- System displays "File type not allowed"
- Lists allowed types: PDF, DOCX, DOC, JPG, PNG
A3: Upload Fails
- Network or storage error occurs
- System displays error message
- User can retry upload
Postconditions
- Document stored in cloud storage (Google Cloud Storage)
- Metadata record created in PostgreSQL
- RAG embeddings generated and stored in MongoDB
- Document appears in search results
- Audit log records upload
Business Rules
- Max file size: 10MB
- Allowed types: PDF, DOCX, DOC, JPG, PNG
- No executables (.exe, .sh, .bat)
- Visibility defaults to Private
UC-DOC-02: Search Documents (Traditional)
Primary Actor: All users
Preconditions
- User is authenticated
- Documents exist in tenant
Main Flow
- User navigates to Documents
- Enters search term in search bar
- System searches across:
- Document title
- Description
- Tags
- Content (extracted text)
- Results filtered by user's access level
- Displays matching documents with:
- Title and description
- Tags (color-coded)
- Upload date and owner
- Visibility indicator
- User can filter results:
- By tag
- By visibility level
- By date range
- By uploader
- Clicks document to view/download
Alternative Flows
A1: No Results
- Search returns no matching documents
- System suggests:
- Broadening search terms
- Trying AI-powered search
- Checking access permissions
A2: Access Denied
- Document exists but user lacks access
- Document not shown in results
- (User never knows it exists)
Postconditions
- User sees matching documents they can access
- No access to documents outside permission scope
Search Capabilities
| Search Type | Example |
|---|---|
| Title match | "Employee Handbook" |
| Tag filter | tag:Policy |
| Content search | "parental leave" |
| Combined | "leave policy" tag:HR |
UC-DOC-03: AI-Powered Document Search (RAG)
Primary Actor: All users
Preconditions
- User is authenticated
- AI service is available
- Documents have RAG embeddings
Main Flow
- User navigates to Documents → AI Search (or uses AI assistant)
- Enters natural language question:
- "What is our work from home policy?"
- "How many vacation days do new employees get?"
- System processes query:
- Generates embedding for question
- Searches MongoDB vector store
- Retrieves relevant document chunks
- Filters by user's access permissions
- Displays results:
- AI-generated answer summarizing relevant content
- Source documents with relevant excerpts
- Confidence indicator
- User can click sources to view full documents
Alternative Flows
A1: No Relevant Documents
- AI cannot find matching content
- Responds: "I couldn't find information about that in the company documents."
- Suggests contacting HR directly
A2: Multiple Sources
- Answer draws from multiple documents
- All sources listed with excerpts
- User can explore each source
A3: Low Confidence
- AI finds partial matches but low confidence
- Displays: "I found some related information, but I'm not certain it answers your question."
- Shows best matches with caveats
Postconditions
- User receives AI-generated answer
- Sources are cited for verification
- Query logged for analytics (anonymized)
RAG Architecture
┌──────────────────────────────────────────────────────┐
│ AI Search Flow │
├──────────────────────────────────────────────────────┤
│ │
│ User Query: "What is our parental leave policy?" │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Generate Query │ │
│ │ Embedding │ │
│ └────────┬────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Vector Search │ (MongoDB) │
│ │ + Access Filter │ │
│ └────────┬────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Retrieve Top │ │
│ │ Document Chunks │ │
│ └────────┬────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Generate Answer │ (LLM) │
│ │ with Citations │ │
│ └────────┬────────┘ │
│ │ │
│ ▼ │
│ Answer: "According to the Employee Handbook, │
│ new parents receive 12 weeks paid leave..." │
│ [Source: Employee Handbook, pg 24] │
│ │
└──────────────────────────────────────────────────────┘UC-DOC-04: Ask AI About Policy
Primary Actor: Employee
Preconditions
- Employee is authenticated
- AI service is available
- Policy documents are uploaded with RAG embeddings
Main Flow
- Employee opens AI Assistant (chat interface)
- Types policy question in natural language:
- "How do I request time off?"
- "What's the dress code?"
- "Can I work remotely on Fridays?"
- "What holidays do we get?"
- AI processes question using RAG
- AI responds with:
- Direct answer to the question
- Source document reference
- Link to full document if user wants more detail
- Employee can ask follow-up questions
- Conversation context is maintained within session
Alternative Flows
A1: Question Outside HR Scope
- Employee asks non-HR question
- AI responds: "I can only answer questions about company policies and HR information."
- Suggests rephrasing or contacting appropriate department
A2: AI Cannot Answer
- No relevant documents found
- AI responds: "I don't have information about that. Please contact HR at hr@company.com"
- Optionally creates support ticket
A3: Sensitive Topic
- Employee asks about specific person or salary
- AI declines: "I can't provide information about individual employees."
- Directs to appropriate resource
Postconditions
- Employee receives answer or appropriate redirect
- Interaction logged for quality improvement
- No modification of any data
Example Conversations
Example 1: Policy Question
Employee: How many vacation days do I get per year?
AI: Full-time employees receive 20 vacation days per year,
accrued monthly. Part-time employees receive pro-rated
vacation based on hours worked.
[Source: Employee Handbook, Section 4.2]Example 2: Process Question
Employee: How do I submit an expense report?
AI: To submit an expense report:
1. Navigate to Finance → Expenses
2. Click "New Expense Report"
3. Upload receipts and fill in details
4. Submit for manager approval
[Source: Finance Policy Document]Example 3: Escalation
Employee: I have a complaint about my manager
AI: I'm sorry to hear that. For workplace concerns, please
contact HR directly at hr@company.com or use the
anonymous feedback form. Would you like me to provide
the link to the feedback form?UC-DOC-05: Download/View Document
Primary Actor: Users with access
Preconditions
- User is authenticated
- User has access to the document
- Document exists
Main Flow
- User finds document via search or browse
- Clicks on document title
- System verifies access permission
- For viewable formats (PDF, images):
- Opens inline viewer
- User can zoom, scroll, navigate pages
- Download button available for all formats
- User clicks Download
- File downloads to local system
Alternative Flows
A1: Access Denied
- User somehow reaches document they can't access
- System displays "Access Denied"
- Does not reveal document contents
A2: Document Deleted
- Document was deleted after user found it
- System displays "Document not found"
A3: Large Document
- Document is very large
- Preview shows first pages only
- Full download available
Postconditions
- User views or downloads document
- Access logged in audit trail
- Download count incremented
UC-DOC-06: Delete Document
Primary Actor: Document owner, Tenant Admin
Preconditions
- Actor is authenticated
- Actor owns document or is Tenant Admin
- Document exists
Main Flow
- Actor navigates to document
- Clicks Delete (or selects from menu)
- System displays confirmation:
- Document title
- Warning that deletion is permanent
- Note that RAG embeddings will be removed
- Actor confirms deletion
- System:
- Removes file from cloud storage
- Deletes metadata record
- Removes RAG embeddings from MongoDB
- Document no longer appears in search
Alternative Flows
A1: Bulk Delete
- Actor selects multiple documents
- Bulk delete option available
- Confirmation shows all selected documents
A2: Document Referenced in Workflows
- Document is linked in onboarding task
- System warns about references
- Deletion removes references (with confirmation)
Postconditions
- Document completely removed from system
- RAG embeddings deleted
- Audit log records deletion (but not document content)
Business Rules
- Only owner or Tenant Admin can delete
- Deletion is permanent (no soft delete for files)
- Metadata audit trail preserved
UC-DOC-07: Employee Interacts with AI Chatbot
Primary Actor: Employee
Preconditions
- Employee is authenticated
- AI service is available
Main Flow
- Employee clicks AI Assistant icon (floating button or sidebar)
- Chat interface opens
- Employee types question or selects from suggested topics:
- Time Off
- Benefits
- Policies
- How To...
- AI responds conversationally
- Employee can:
- Ask follow-up questions
- Rate response (helpful/not helpful)
- Request human help if unsatisfied
- Conversation ends when employee closes chat
Alternative Flows
A1: AI Confused
- AI cannot understand question
- Asks for clarification
- Suggests rephrasing
A2: Request Human Help
- Employee clicks "Talk to HR"
- System creates support ticket with conversation context
- Employee receives confirmation
A3: After Hours
- Employee asks time-sensitive question
- AI answers if possible from documents
- For urgent matters, provides emergency contact
Postconditions
- Employee question answered or escalated
- Conversation logged (for improvement)
- Support ticket created if escalated
Suggested Topics
| Category | Example Questions |
|---|---|
| Time Off | "How do I request vacation?" "What's my leave balance?" |
| Benefits | "When is open enrollment?" "What health plans are available?" |
| Policies | "What's the remote work policy?" "Dress code?" |
| How To | "How do I update my address?" "How do I get a parking pass?" |
| General | "Who do I contact about X?" "Where is the office located?" |
UC-DOC-08: Tag Document
Primary Actor: Document owner, Manager, Tenant Admin
Preconditions
- Actor is authenticated
- Actor has permission to tag documents
- Document exists
- Tags are configured for Document asset type
Main Flow
- Actor navigates to document details
- Views current tags on document
- Clicks "Add Tag"
- Selects from available tags:
- Contract
- Policy
- Onboarding
- Confidential
- Template
- Custom tenant-defined tags
- Tag is added with visual indicator
- Saves changes
Alternative Flows
A1: Remove Tag
- Actor clicks 'X' on existing tag
- Tag is removed from document
- Document no longer appears in tag-filtered searches
A2: Create New Tag (if permitted)
- Actor has tag creation permission
- Types new tag name
- System creates tag and applies it
Postconditions
- Document tagged for organization
- Appears in tag-filtered searches
- Audit log records tag changes
Common Document Tags
| Tag | Purpose | Color |
|---|---|---|
| Contract | Employment contracts, agreements | Blue |
| Policy | Company policies and guidelines | Green |
| Onboarding | New hire documents | Yellow |
| Confidential | Restricted access documents | Red |
| Template | Reusable document templates | Purple |
| Expired | Outdated documents (for cleanup) | Gray |
UC-DOC-09: Employee Uploads Personal Document
Primary Actor: Employee
Preconditions
- Employee is authenticated
- Has document upload permission
Main Flow
- Employee navigates to Documents → My Documents → Upload
- Selects file from local system
- System validates file (size, type)
- Enters document metadata (title, description)
- Visibility defaults to PRIVATE
- Employee can optionally change to:
- Manager: Share with direct manager
- Specific People: Select specific colleagues
- Adds optional tags
- Uploads document
Alternative Flows
A1: Share with Manager
- Employee selects "Share with My Manager"
- Document visible to employee + direct manager only
A2: Share with Specific People
- Employee clicks "Share with..."
- Searches and selects specific colleagues
- Each person can view/download
Postconditions
- Document stored with PRIVATE visibility (or as selected)
- Only authorized users can access
- Appears in employee's "My Documents" section
Example Use Cases
- Personal certifications
- Expense receipts
- Performance self-review drafts
- Project proposals to share with manager
UC-DOC-10: Employee Shares Document with Manager
Primary Actor: Employee
Preconditions
- Employee is authenticated
- Document exists and is owned by employee
- Document is currently PRIVATE
Main Flow
- Employee navigates to own document
- Clicks "Share" button
- Selects "Share with My Manager"
- Confirms sharing
- System updates visibility to MANAGER
- Manager receives notification (optional)
Alternative Flows
A1: Expand to Team
- Employee wants broader sharing
- If permitted, can select TEAM visibility
- All team members gain access
A2: Revoke Access
- Employee changes visibility back to PRIVATE
- Manager loses access immediately
- Audit log records change
Postconditions
- Document visibility updated
- Manager can now view/download
- Audit trail records sharing action
Business Rules
- Employee can always share with own manager
- Cannot share with higher visibility levels without permission
- Sharing can be revoked at any time
UC-DOC-11: HR Uploads Company Policy
Primary Actor: Tenant Admin, HR Manager
Preconditions
- Actor is authenticated with HR/Admin role
- Has company document upload permission
Main Flow
- HR navigates to Documents → Company Documents → Upload
- Selects policy file
- System validates file
- Enters metadata:
- Title: "Employee Handbook 2024"
- Description: "Complete guide to company policies"
- Category: Policy
- Visibility defaults to COMPANY (all employees)
- Can optionally restrict to:
- All Employees: Everyone can access
- All Managers: Only managers can access
- Department: Specific department(s)
- Specific People: Selected individuals
- Adds tags (Policy, Handbook, 2024)
- Uploads document
Alternative Flows
A1: Manager-Only Document
- HR uploads sensitive document
- Selects "All Managers" visibility
- Only users with Manager role can access
- Example: Management compensation guidelines
A2: Department-Specific Policy
- HR uploads Engineering-specific policy
- Selects "Department: Engineering"
- Only Engineering employees can access
Postconditions
- Document uploaded with selected visibility
- Appears in Company Documents section
- RAG embeddings created for AI search
- All authorized users can access
Example Documents
- Employee Handbook
- PTO Policy
- Remote Work Guidelines
- Code of Conduct
- Benefits Summary
UC-DOC-12: HR Shares Document with Specific Group
Primary Actor: Tenant Admin, HR Manager
Preconditions
- Actor is authenticated with HR/Admin role
- Document exists (new or existing)
Main Flow
- HR uploads or selects existing document
- Chooses SPECIFIC visibility
- Adds recipients using flexible selector:
- By User: Search and select individuals
- By Role: Select "All Managers", "All HR"
- By Department: Select one or more departments
- By Team: Select specific teams
- For each recipient, sets permission:
- View only
- View + Download
- Optionally sets expiration date
- Saves visibility settings
Alternative Flows
A1: Confidential Executive Document
- HR uploads executive compensation report
- Selects SPECIFIC visibility
- Adds only: CEO, CFO, HR Director
- Sets to expire after 30 days
A2: Cross-Department Sharing
- HR uploads reorg plan
- Shares with: Department Heads + HR Team
- Excludes affected employees until announcement
Postconditions
- Document visible only to specified recipients
- Each recipient type (user/role/dept) can access
- Expiration enforced if set
- Audit trail records all access
Recipient Options
| Recipient Type | Example |
|---|---|
| Individual User | john.doe@company.com |
| Role | All Managers, All HR |
| Department | Engineering, Sales |
| Team | Frontend Team, Sales Team 1 |
UC-DOC-13: Manager Shares Team Document
Primary Actor: Manager
Preconditions
- Manager is authenticated
- Has team document upload permission
- Has direct reports
Main Flow
- Manager navigates to Documents → Team Documents → Upload
- Selects file (meeting notes, project doc)
- Enters metadata
- Visibility defaults to TEAM (direct reports)
- Can expand to:
- Department: Entire department
- All Managers: Other managers
- Specific People: Add individuals
- Adds tags
- Uploads document
Alternative Flows
A1: Cross-Team Collaboration
- Manager working with another team
- Selects SPECIFIC visibility
- Adds own team + collaborating team members
A2: Restrict Within Team
- Manager has sensitive doc for some team members
- Selects SPECIFIC visibility
- Adds only relevant team members
Postconditions
- Document shared with team
- Appears in team's shared documents
- Manager retains ownership
Example Documents
- Team meeting notes
- Project documentation
- Team processes and guidelines
- Training materials
UC-DOC-14: User Views Accessible Documents
Primary Actor: All users
Preconditions
- User is authenticated
- Documents exist in tenant
Main Flow
- User navigates to Documents
- System displays documents organized by section:
- My Documents: Documents user uploaded (PRIVATE)
- Shared with Me: Documents others shared with user
- Team Documents: TEAM visibility docs from user's team
- Company Documents: COMPANY visibility docs
- Each document shows:
- Title and description
- Tags (color-coded)
- Visibility indicator icon
- Upload date and owner
- User can filter by:
- Section (My/Shared/Team/Company)
- Tags
- Date range
- Search term
- Clicks document to view/download
Alternative Flows
A1: No Access to Document
- User searches for document
- If no access, document not shown in results
- User never knows it exists (security by obscurity)
A2: Shared Document Expired
- Document had expiration date
- After expiry, removed from user's view
- Audit log records access revocation
Postconditions
- User sees only authorized documents
- Clear organization by visibility type
- Easy navigation and filtering
Document Sections View
┌────────────────────────────────────────────────────────────┐
│ Documents [+ Upload] │
├────────────────────────────────────────────────────────────┤
│ │
│ 📁 My Documents (5) │
│ └── Personal files only you can see │
│ │
│ 📤 Shared with Me (12) │
│ └── Documents others have shared with you │
│ │
│ 👥 Team Documents (8) │
│ └── Shared by your team members │
│ │
│ 🏢 Company Documents (24) │
│ └── Company-wide policies and resources │
│ │
├────────────────────────────────────────────────────────────┤
│ 🔍 Search documents... [Filter by: Tags ▼] [Date ▼] │
└────────────────────────────────────────────────────────────┘Summary
| Use Case | Primary Actor | Purpose |
|---|---|---|
| UC-DOC-01 | Admin, Manager, Employee | Upload documents with visibility selection |
| UC-DOC-02 | All users | Traditional keyword search |
| UC-DOC-03 | All users | AI-powered semantic search |
| UC-DOC-04 | Employee | Ask AI about company policies |
| UC-DOC-05 | Users with access | View or download documents |
| UC-DOC-06 | Owner, Admin | Delete documents |
| UC-DOC-07 | Employee | Chat with AI assistant |
| UC-DOC-08 | Owner, Manager, Admin | Tag documents for organization |
| UC-DOC-09 | Employee | Upload personal document (default PRIVATE) |
| UC-DOC-10 | Employee | Share document with manager |
| UC-DOC-11 | HR, Admin | Upload company policy (default COMPANY) |
| UC-DOC-12 | HR, Admin | Share document with specific group |
| UC-DOC-13 | Manager | Share team document |
| UC-DOC-14 | All users | View accessible documents by section |
Document Visibility Model
Visibility Levels (Hierarchical)
┌─────────────────────────────────────────────────────────────┐
│ VISIBILITY HIERARCHY │
├─────────────────────────────────────────────────────────────┤
│ │
│ Level 1: PRIVATE (Default for Employees) │
│ └── Only document owner can access │
│ │
│ Level 2: MANAGER │
│ └── Owner + Owner's direct manager │
│ │
│ Level 3: TEAM │
│ └── Owner + All members of owner's team │
│ │
│ Level 4: DEPARTMENT │
│ └── Owner + All members of owner's department │
│ │
│ Level 5: ALL_MANAGERS │
│ └── All users with Manager role │
│ │
│ Level 6: ALL_EMPLOYEES │
│ └── Everyone in the tenant │
│ │
│ Level 7: COMPANY (Default for HR uploads) │
│ └── Everyone + appears in company docs section │
│ │
│ Level 8: SPECIFIC_PEOPLE │
│ └── Custom list of users/roles/departments │
│ │
└─────────────────────────────────────────────────────────────┘Default Visibility by Uploader Role
| Uploader Role | Default Visibility | Can Set |
|---|---|---|
| Employee | PRIVATE | Private, Manager, Specific People |
| Manager | TEAM | Private → Department, All Managers, Specific |
| HR/Admin | COMPANY | Any visibility level |
Visibility Icons
| Level | Icon | Meaning |
|---|---|---|
| Private | 🔒 | Only you |
| Manager | 👤 | You + your manager |
| Team | 👥 | Your team |
| Department | 🏛️ | Your department |
| All Managers | 👔 | All managers |
| All Employees | 👨👩👧👦 | Everyone |
| Company | 🏢 | Company-wide (featured) |
| Specific | 🎯 | Selected people |
Permission Matrix
| Action | Employee | Manager | HR Admin | Tenant Admin |
|---|---|---|---|---|
| Upload personal doc | ✅ | ✅ | ✅ | ✅ |
| Upload company doc | ❌ | ❌ | ✅ | ✅ |
| Set: Private | ✅ | ✅ | ✅ | ✅ |
| Set: Manager | ✅ | ✅ | ✅ | ✅ |
| Set: Team | ❌ | ✅ | ✅ | ✅ |
| Set: Department | ❌ | ❌ | ✅ | ✅ |
| Set: All Managers | ❌ | ❌ | ✅ | ✅ |
| Set: All Employees | ❌ | ❌ | ✅ | ✅ |
| Set: Company | ❌ | ❌ | ✅ | ✅ |
| Set: Specific People | ✅ (limited) | ✅ | ✅ | ✅ |
AI Chat Integration
Documents is a core AI feature. UC-DOC-03 (AI Search), UC-DOC-04 (Policy Q&A), and UC-DOC-07 (AI Chatbot) are the primary AI Chat interactions. See AI Chat Specification for full implementation details.
AI Chat-Enabled Actions
| Use Case | AI Tool | Requires Confirmation |
|---|---|---|
| UC-DOC-02 | document_search | No (read-only) |
| UC-DOC-03 | document_search | No (read-only) |
| UC-DOC-04 | document_ask | No (read-only) |
| UC-DOC-07 | document_ask | No (conversation) |
UC-DOC-03: AI-Powered Document Search via Chat
Example prompts:
- "Find the remote work policy"
- "Search for vacation policy documents"
- "What documents mention parental leave?"
- "Find engineering onboarding materials"
AI Chat Flow:
User: "Find the remote work policy"
AI: Shows Search Results Card
┌─────────────────────────────────────────────┐
│ Document Search Results │
│ Query: "remote work policy" │
│ │
│ Found 3 relevant documents: │
│ │
│ 1. Remote Work Policy 2024 (98% match) │
│ Policy | Updated: Nov 15, 2024 │
│ "Guidelines for remote and hybrid..." │
│ [View Document] │
│ │
│ 2. Employee Handbook (72% match) │
│ Handbook | Section: Remote Work │
│ "Chapter 8 covers remote work..." │
│ [View Document] │
│ │
│ 3. IT Equipment Policy (45% match) │
│ Policy | Section: Home Office Setup │
│ [View Document] │
│ │
│ [Search Again] [Ask About These] │
└─────────────────────────────────────────────┘UC-DOC-04: Policy Q&A via AI Chat
Example prompts:
- "What's our parental leave policy?"
- "How do I submit an expense report?"
- "What are the company holidays this year?"
- "What's the dress code?"
AI Chat Flow:
User: "What's our parental leave policy?"
AI: Shows Answer Card (with sources)
┌─────────────────────────────────────────────┐
│ Answer from Company Documents │
│ │
│ Based on the Employee Handbook (2024): │
│ │
│ Primary caregivers receive 12 weeks of │
│ fully paid parental leave. Secondary │
│ caregivers receive 4 weeks. Leave can be │
│ taken within 12 months of birth/adoption. │
│ │
│ Additional details: │
│ - Can be combined with FMLA │
│ - Part-time return options available │
│ - Benefits continue during leave │
│ │
│ Sources: │
│ - Employee Handbook, Chapter 5 (page 23) │
│ - Parental Leave FAQ (updated Nov 2024) │
│ │
│ [View Full Policy] [Ask Follow-up] │
└─────────────────────────────────────────────┘UC-DOC-07: Interactive AI Chatbot
Example conversation:
Employee: "I'm having a baby, what do I need to do?"
AI: Shows Guided Response
┌─────────────────────────────────────────────┐
│ Congratulations! Here's what you need to │
│ know about parental leave at our company: │
│ │
│ 1. Notify HR at least 30 days before leave │
│ 2. Submit leave request in the system │
│ 3. You're eligible for 12 weeks paid leave │
│ 4. Benefits continue during your leave │
│ │
│ Would you like me to help you with: │
│ • [Submit parental leave request] │
│ • [View full parental leave policy] │
│ • [Calculate my leave dates] │
│ • [Ask another question] │
│ │
│ Or type your follow-up question below. │
└─────────────────────────────────────────────┘
Employee: "Submit parental leave request"
AI: Shows Confirmation Card
┌─────────────────────────────────────────────┐
│ Submit Parental Leave Request │
│ │
│ Type: Parental Leave │
│ Duration: 12 weeks │
│ Expected Start: (please select) │
│ │
│ What's your expected leave start date? │
│ │
│ [Select Date] │
└─────────────────────────────────────────────┘AI Chat Widget Specifications for Documents
Search Results Widget
interface SearchResultWidget {
type: 'search_results'
query: string
results: Array<{
title: string
matchScore: number // 0-100
category: string
excerpt: string
documentId: string
}>
totalResults: number
actions: ['view', 'ask_about']
}Answer Widget (with RAG sources)
interface AnswerWidget {
type: 'answer'
answer: string
confidence: 'high' | 'medium' | 'low'
sources: Array<{
documentTitle: string
section?: string
pageNumber?: number
documentId: string
}>
actions: ['view_sources', 'ask_followup']
}Guided Response Widget
interface GuidedResponseWidget {
type: 'guided_response'
message: string
suggestedActions: Array<{
label: string
action: string // tool to invoke
params?: Record<string, any>
}>
allowFreeformFollowup: boolean
}Business Rules for AI Chat Document Actions
| Rule | Description |
|---|---|
| Access Control | AI only searches/returns documents user has access to |
| RAG Filtering | Vector search includes tenantId + visibility filter |
| Source Attribution | AI always cites source documents |
| Confidence Levels | AI indicates when answer may be incomplete |
| Escalation | AI offers "Talk to HR" for complex questions |