Skip to content

Latest commit

 

History

History
268 lines (203 loc) · 7.19 KB

File metadata and controls

268 lines (203 loc) · 7.19 KB

AI Features Implementation Guide

Overview

This document describes the AI-powered features added to the Employee Management System for promotion prediction, performance tracking, and work-from-home management.

New Features

1. AI Promotion Recommendations

Location: /promotion-recommendations

What it does:

  • Uses machine learning algorithm to predict which employees are eligible for promotion
  • Analyzes multiple parameters to generate a promotion score (0-100)
  • Employees with a score of 70+ are marked as "Eligible for Promotion"

Algorithm Factors:

  • Performance Rating (35 points): Employee's performance rating out of 5
  • Tenure/Years of Service (25 points): Time with company (max 5 years for full score)
  • Projects Completed (20 points): Number of completed projects (max 10 for full score)
  • Attendance (15 points): Attendance percentage (max 100%)
  • Work-Life Balance Bonus (5 points): Bonus if employee works from home

Features:

  • View all employees sorted by promotion score
  • Filter by: All Employees, Eligible for Promotion, Not Yet Eligible
  • Sort by: Promotion Score, Name, Tenure
  • Visual progress bars showing breakdown of each score component
  • Color-coded badges (Green=85+, Blue=70-84, Yellow=<70)

Backend Routes:

  • GET /api/ai/promotion-recommendations - Get all employees with promotion scores

2. Performance Tracking

Location: /performance-tracking

What it does:

  • Comprehensive performance analytics for individual employees
  • Team-wide performance metrics and trends
  • Department comparison analysis

Three View Modes:

a) Team Overview

  • Average team performance rating
  • Team attendance statistics
  • Average projects completed per person
  • Number of promotions ready employees
  • Monthly performance trends
  • Projects completion trends

b) Individual Performance

  • Select any employee to view detailed metrics
  • Performance rating and components
  • Attendance details (current month and overall)
  • Years of service calculation
  • Promotion eligibility status
  • Radar chart showing performance profile
  • Historical attendance patterns

c) Department Comparison

  • Performance metrics by department
  • Attendance comparison across departments
  • Identify high-performing departments

Key Metrics Tracked:

  • Performance Rating (1-5 scale)
  • Projects Completed
  • Attendance Percentage
  • Tenure/Years of Service
  • Promotion Score
  • Work-from-home status

Backend Routes:

  • GET /api/ai/performance/:employeeId - Get individual performance metrics
  • PUT /api/ai/performance/:employeeId - Update performance details

3. Work From Home Tracking

Location: /work-from-home

What it does:

  • Monitor and track employees working from home
  • Analyze work arrangement impact on performance
  • Department-wise work arrangement distribution

Features:

  • Statistics dashboard showing:

    • Total employees
    • WFH employees and percentage
    • Office-based employees and percentage
    • Performance comparison
  • Visual representations:

    • Pie chart of work arrangement distribution
    • Stacked bar chart by department
    • Performance comparison metrics
    • Attendance comparison
  • Two view modes:

    • Grid View: Cards showing each employee
    • List View: Compact list format
  • Filtering options:

    • All Employees
    • Work From Home Only
    • Office Based Only

Performance Insights:

  • Average performance rating: WFH vs Office
  • Attendance comparison
  • Department-wise distribution

Backend Routes:

  • GET /api/ai/work-from-home - Get WFH statistics and employee list

Database Model Updates

Employee Schema Additions

{
  performanceRating: {
    type: Number,
    min: 1,
    max: 5,
    default: 3,
  },
  workFromHome: {
    type: Boolean,
    default: false,
  },
  projectsCompleted: {
    type: Number,
    default: 0,
  },
  attendancePercentage: {
    type: Number,
    min: 0,
    max: 100,
    default: 100,
  },
  promotionEligible: {
    type: Boolean,
    default: false,
  },
  promotionScore: {
    type: Number,
    default: 0,
  },
}

API Endpoints Summary

AI Routes (/api/ai)

Method Endpoint Purpose
GET /promotion-recommendations Get promotion recommendations for all employees
GET /performance/:employeeId Get detailed performance metrics for an employee
GET /work-from-home Get work-from-home statistics
PUT /performance/:employeeId Update employee performance metrics

How to Update Employee Performance Data

To update an employee's performance metrics, you can use the API:

PUT /api/ai/performance/{employeeId}

Body:
{
  "performanceRating": 4.5,
  "projectsCompleted": 12,
  "workFromHome": true,
  "attendancePercentage": 95
}

Promotion Score Calculation

The AI engine calculates promotion score using the weighted formula:

Promotion Score = (Performance Rating / 5 × 35) 
                + (Years of Service / 5 × 25) [capped at 25]
                + (Projects / 10 × 20) [capped at 20]
                + (Attendance % / 100 × 15)
                + (WFH Bonus: 5 if true, else 0)

Eligible if Score ≥ 70


Frontend Navigation

The new features are accessible via the sidebar:

  • Promotions - AI Promotion Recommendations
  • Performance - Performance Tracking Dashboard
  • Work From Home - WFH Status & Analytics

Key Metrics Definitions

  • Performance Rating: Manager's rating of employee (1-5 scale)
  • Tenure: Time employee has been with company
  • Projects Completed: Number of projects completed by employee
  • Attendance Percentage: Percentage of working days present
  • Promotion Score: AI-calculated score for promotion likelihood (0-100)
  • Promotion Eligible: Boolean indicating if score ≥ 70

Future Enhancements

  1. Machine Learning Integration: Replace current algorithm with ML models
  2. Skill-Based Matching: Match employee skills with promotion positions
  3. Salary Prediction: Predict appropriate salary for promotions
  4. Goal Tracking: Track employee goals and objectives
  5. Real-time Notifications: Alert managers when employees become promotion-eligible
  6. Historical Trends: Track how scores change over time
  7. Export Reports: Generate PDF reports for HR decision-making
  8. Bias Analysis: Ensure fairness in promotion recommendations

Data Privacy & Security

  • All performance data is stored securely in MongoDB
  • Employee information is protected
  • Access control should be implemented at the API level
  • Consider adding role-based access (e.g., only HR can view promotions)

Testing the Features

Test Data Included:

Mock data is included in the frontend components for testing. To test with real data:

  1. Update employee records with performance data
  2. Set performanceRating, projectsCompleted, workFromHome to actual values
  3. Navigate to each feature page to see AI recommendations

Example Test Scenarios:

  • Create an employee with 4-5 years tenure, 4.5+ rating, 15+ projects
  • Expected: Promotion score 80-90, eligible for promotion
  • Create an employee with <2 years tenure, 3.0 rating, 5 projects
  • Expected: Promotion score <70, not yet eligible