Skip to content

GaneshSDM/MindCare-AI-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MindCare AI โ€“ HR Copilot for Decision Minds

Python 3.10+ Streamlit 1.28+ Ollama Local LLM

Predict attrition, personalize growth, and answer HR queries โ€” with generative AI utilizing Gemini 2.5 Pro and alternatively locally with Ollama

MindCare AI is an offline-first HR analytics platform that combines predictive modeling with local Large Language Models to help organizations retain talent, identify growth opportunities, and streamline HR operations without compromising data privacy.

๐ŸŽฏ Key Features

  • ๐Ÿšจ Attrition Risk Radar: Predict attrition with explainable insights
  • ๐Ÿ“ˆ Sentiment & Theme Mining: Analyze feedback with local NLP
  • ๐ŸŽ“ Career Pathing & Upskilling: AI-powered development recommendations
  • ๐Ÿค– HR Policy Copilot: RAG-powered chatbot for instant policy Q&A
  • ๐Ÿ”’ Privacy-First: 100% local processing, no external API calls

๐Ÿ—๏ธ Architecture


โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚           HR Data Sources (local)      โ”‚
โ”‚  โ€ข Pulse surveys (CSV)                 โ”‚
โ”‚  โ€ข HRIS exports (CSV/Parquet)          โ”‚
โ”‚  โ€ข PTO & timesheets                    โ”‚
โ”‚  โ€ข L\&D catalog (CSV/Docs)              โ”‚
โ”‚  โ€ข HR policy PDFs/Docs                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚  (local file share)
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   Data & Feature Layer (offline)                         โ”‚
โ”‚  โ€ข Ingestion: Python + DuckDB / SQLite                                   โ”‚
โ”‚  โ€ข Cleansing & Anonymization: PII masking, hashing                       โ”‚
โ”‚  โ€ข Features: survey\_sentiment, workload\_ratio, skill\_gap\_score,          โ”‚
โ”‚              manager\_1on1\_cadence, tenure\_weeks, internal\_moves          โ”‚
โ”‚  โ€ข Embeddings store for RAG: local (FAISS/Chroma on disk)                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Ollama (LLMs local)     โ”‚     โ”‚   Classical Models (local, Python)      โ”‚
โ”‚  โ€ข mistral / llama3      โ”‚     โ”‚  โ€ข Sentiment: VADER/TextBlob/spaCy      โ”‚
โ”‚  โ€ข codellama for prompts โ”‚     โ”‚  โ€ข Attrition: XGBoost/LogReg (sklearn)  โ”‚
โ”‚  โ€ข RAG over HR docs      โ”‚     โ”‚  โ€ข Recommender: rules + similarity      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚     Streamlit/Gradio UI (local)   โ”‚
โ”‚  โ€ข Risk dashboard & drilldowns     โ”‚
โ”‚  โ€ข HR Copilot chat (RAG+LLM)       โ”‚
โ”‚  โ€ข Career paths & export (CSV/JSON)โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜


๐Ÿš€ Quick Start

Prerequisites

  • Python 3.10+
  • Google AI Studio's Gemini 2.5 Pro
  • Ollama installed locally
  • 8GB+ RAM (recommended), 10GB+ free disk space

Installation

  1. Clone the repository
git clone https://github.com/yourusername/mindcare-ai.git
cd mindcare-ai
  1. Set up Python environment
python -m venv .venv
# macOS/Linux
source .venv/bin/activate
# Windows (PowerShell)
.\.venv\Scripts\Activate.ps1

pip install -r requirements.txt
  1. Install and verify Ollama
# Follow install steps at https://ollama.ai
ollama pull mistral
ollama pull llama3

# Quick check
ollama run mistral "Hello, test message"
  1. Prepare sample data (optional)
python scripts/generate_sample_data.py
  1. Launch the app
streamlit run app/ui_app.py
  1. Open the dashboard at http://localhost:8501

๐Ÿ“ Project Structure

mindcare/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ ui_app.py           # Main Streamlit application
โ”‚   โ”œโ”€โ”€ rag.py              # RAG pipeline for HR Copilot
โ”‚   โ”œโ”€โ”€ attrition.py        # Attrition prediction models
โ”‚   โ”œโ”€โ”€ features.py         # Feature engineering utilities
โ”‚   โ”œโ”€โ”€ recommender.py      # Career pathing recommendations
โ”‚   โ””โ”€โ”€ storage.py          # Data management utilities
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ employees.csv       # Employee master data
โ”‚   โ”œโ”€โ”€ surveys.csv         # Pulse survey responses
โ”‚   โ”œโ”€โ”€ timesheets.csv      # Work hours tracking
โ”‚   โ”œโ”€โ”€ skills.csv          # Employee skills matrix
โ”‚   โ””โ”€โ”€ policies/           # HR policy documents
โ”œโ”€โ”€ models/
โ”‚   โ”œโ”€โ”€ vector_index/       # FAISS/Chroma embeddings
โ”‚   โ””โ”€โ”€ attrition_lr.joblib # Trained attrition model
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ generate_sample_data.py
โ”‚   โ””โ”€โ”€ data_pipeline.py
โ”œโ”€โ”€ tests/
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ README.md

๐ŸŽฎ Usage Guide

1) Risk Radar Dashboard

  • Org-wide attrition risk heatmap
  • Drilldowns by practice/team/individual
  • Top risk drivers (explainable AI)
  • Export as CSV

2) Career Pathing

  • Personalized development plans
  • Course/mentor recommendations
  • Project rotation suggestions
  • Track skill progression

3) HR Policy Copilot

  • Natural-language Q&A over policy docs
  • Source citations with RAG
  • Handles complex scenarios
  • Maintains conversation context

4) Sample Queries

Risk Analysis

  • โ€œShow me teams with highest attrition riskโ€
  • โ€œWhat are the top drivers for the Cloud practice?โ€

Career Development

  • โ€œRecommend growth plan for employee E_1042โ€
  • โ€œWhat skills are most in demand for Data Engineers?โ€

Policy Questions

  • โ€œWhat is our parental leave policy?โ€
  • โ€œHow many vacation days do I get?โ€
  • โ€œWhatโ€™s the process for requesting sabbatical?โ€

๐Ÿ”ง Configuration

Environment Variables

Create a .env file in the repo root:

# Ollama Configuration
OLLAMA_HOST=localhost
OLLAMA_PORT=11434
OLLAMA_MODEL=mistral

# Data Configuration
DATA_PATH=./data
VECTOR_INDEX_PATH=./models/vector_index

# Privacy Settings
ENABLE_PII_MASKING=true
ANONYMIZATION_LEVEL=high

Model Configuration

Edit config/models.yaml:

attrition:
  model_type: "logistic_regression"
  features:
    - "tenure_weeks"
    - "survey_sentiment"
    - "workload_ratio"
    - "manager_1on1_cadence"
  threshold: 0.3

rag:
  chunk_size: 512
  chunk_overlap: 50
  top_k: 4
  embedding_model: "sentence-transformers/all-MiniLM-L6-v2"

๐Ÿ“Š Sample Outputs

Attrition Risk Export (attrition_risk_by_team.csv)

team avg_risk top_driver_1 top_driver_2 top_driver_3
Cloud 0.31 workload_ratio low_1on1 low_sentiment
Data 0.27 low_growth workload_ratio pto_spike
AI 0.22 low_recognition low_1on1 tenure_transition

Career Plan JSON (career_plan_E_1042.json)

{
  "employee_id": "E_1042",
  "current_role": "Data Engineer",
  "target_role": "Senior Data Engineer",
  "skill_gaps": ["Snowflake perf tuning", "dbt testing"],
  "courses": ["Snowflake Performance Deep Dive", "Advanced dbt: Testing & CI"],
  "mentor": "M_309 (Senior DE, Bengaluru)",
  "project_rotation": "FinTech ETL Revamp (4 weeks)"
}

Note: Sample outputs and benchmarks are illustrativeโ€”update with your own measurements.


๐Ÿ›ก๏ธ Privacy & Security

  • Local-only processing: No data leaves your infrastructure
  • PII masking: Automatic anonymization of sensitive fields
  • Role-based access: Configurable permissions
  • Audit logging: Track system interactions
  • Encryption: Optional at-rest encryption

๐Ÿ“ˆ Performance Benchmarks (demo numbers)

Model Dataset Size Training Time Accuracy Inference Time
Attrition (LogReg) 10K employees 2.3s 0.76 AUC 15ms
Sentiment (VADER) 50K responses N/A 0.82 F1 5ms
RAG Pipeline 500 documents 45s indexing ~90% hit@k <2s

๐Ÿงช Testing

# Unit tests
pytest tests/unit/

# Integration tests
pytest tests/integration/

# End-to-end tests
pytest tests/e2e/

# Performance tests
pytest tests/performance/ --benchmark

๐Ÿค Contributing

We welcome contributions!

  1. Fork the repo
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit: git commit -m "Add amazing feature"
  4. Push: git push origin feature/amazing-feature
  5. Open a Pull Request

๐Ÿ—บ๏ธ Roadmap

Phase 1 (Current)

  • โœ… Basic attrition prediction
  • โœ… HR policy RAG system
  • โœ… Streamlit dashboard
  • โœ… Local deployment

Phase 2

  • ๐Ÿ”„ Advanced ML models (XGBoost, Neural Networks)
  • ๐Ÿ”„ What-if scenario simulation
  • ๐Ÿ”„ HRIS integrations
  • ๐Ÿ”„ Mobile-responsive UI

Phase 3

  • ๐Ÿ“‹ Fine-tuned domain-specific LLMs
  • ๐Ÿ“‹ Real-time alerting
  • ๐Ÿ“‹ Advanced analytics dashboard
  • ๐Ÿ“‹ Multi-tenant support

๐ŸŽฏ Project Goals

  • Privacy-First AI: Enterprise-grade AI without data leakage
  • Practical Implementation: Actionable HR insights with accessible tech
  • Open Innovation: Contribute to the open-source HR analytics ecosystem
  • Local-First Architecture: Prove powerful AI can run fully offline

๐Ÿ“š Research & Papers

  • Predictive HR Analytics
  • Local Language Model Deployment
  • Privacy-Preserving ML
  • Explainable AI in HR Context

๐Ÿ‘ฅ Team

  • Ganesh Sundaresan
  • Shashank A
  • Simran Singh
  • Asma Khanum

Made with โค๏ธ by the MindCare AI Team

About

For Hackathon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages