An intelligent, privacy-first, locally-hosted HR Assistant macOS application built with SwiftUI and powered by Ollama. HR-Bot is designed to streamline HR operations, from answering policy questions via conversational AI to analyzing resumes against structured Job Descriptions—all while ensuring sensitive employee data never leaves your machine.
HR-Bot: Privacy-First On-Device AI for Enterprise HR Automation
[🧠 Problem Solving] Modern HR departments are overwhelmed by repetitive employee queries, manual onboarding workflows, and IT ticketing, creating massive operational bottlenecks. While Generative AI can solve this, traditional cloud-based LLM solutions are not viable for HR due to severe risks regarding Data Privacy and PII Compliance. Enterprises face a critical problem: they need to automate Employee Self-Service and support scaling without ever exposing sensitive employee data to external cloud servers.
[⚡ Innovation & ✨ Creativity] HR-Bot is an innovative, Desktop-First enterprise chatbot built natively for macOS using Swift 6 and SwiftUI. The creative breakthrough of this project is processing advanced Generative AI entirely locally. By leveraging On-Device AI, Ollama, and the neural engine of Apple Silicon, we have created an assistant that requires zero cloud connectivity for its core AI tasks.
[🤝 Team Collaboration & 🚀 Functional Working Prototype] Through agile team collaboration, we successfully built and delivered a Functional Working Prototype. The app utilizes local RAG (Retrieval-Augmented Generation) to ingest internal company guidelines and provide highly accurate answers. It features strict Role-Based Access, ensuring employees only see what they are authorized to see. The result is a fully Sandboxed App that safely handles HR Automation, Onboarding Automation, and Ticketing Automation while guaranteeing absolute 100% data privacy.
Our system architecture is designed from the ground up for enterprise security and native performance:
- Presentation Layer (macOS & SwiftUI): A native, sandboxed desktop interface built with Swift 6, providing a seamless and highly responsive employee experience.
- Local AI Engine (Ollama & Apple Silicon): The core LLM runs entirely on-device. This guarantees zero data exfiltration, ensuring strict PII Compliance and Data Privacy.
- Context Engine (RAG & Role-Based Access): Employee queries are intercepted and enriched using a local RAG pipeline. It retrieves relevant HR policies and documents based on the user's specific role before passing the prompt to the local LLM.
- Task Execution (HR & Ticketing Automation): The AI parses user intents to trigger automated workflows, seamlessly managing onboarding sequences and automatically generating IT/HR tickets without human intervention.
- Enterprise Distribution: The entire stack is packaged securely as an enterprise-ready app, optimized for seamless MDM Deployment via Apple Business Manager.
- Conversational AI Assistant: Real-time streaming chat powered by local LLMs (Llama 3 / 3.1) with context-aware responses.
- Role-Based Interaction: Switch between specialized HR personas: Generalist, Compliance, Employee Relations, Analytics, and Operations.
- Privacy First (PII Scrubbing): Automatically redacts Personally Identifiable Information (SSN, emails, salary data) before processing text through the LLM.
- Intelligent Resume Analysis: Upload resumes (PDF/TXT/DOCX) and compare them against Job Descriptions to generate instant match scores and skill matrices.
- Job Description (JD) Management: Create, edit, and manage structured JDs with intuitive drag-and-drop support.
- Local Document Context: Drop policy documents directly into the chat to seamlessly expand the AI's knowledge base.
- Fully Offline: Operates 100% locally using Ollama, ensuring zero data leakage to external cloud providers.
HR-Bot utilizes a modular Swift architecture centered around a main state coordinator, feeding data to the LLM while enforcing strict privacy rules.
graph TD
A["HRBotApp (SwiftUI App)"] --> B["MainChatView (Navigation Router)"]
B --> C["Chat View"]
B --> D["Resume Analysis View"]
B --> E["JD Management View"]
A --> F["SettingsView"]
B --> G["HRBotSessionCoordinator (State Hub)"]
G --> H["OllamaClient (Local LLM API)"]
G --> I["RACEngine (Role & Context Management)"]
G --> J["PIIScrubber (Privacy Enforcement)"]
G --> K["DataSyncManager (Local Storage)"]
style G fill:#4CAF50,color:#fff
style H fill:#2196F3,color:#fff
style J fill:#FF9800,color:#fff
- macOS 13.0 or later.
- Xcode 15 or later.
- Ollama installed on your Mac (Download Ollama).
-
Clone the Repository
git clone https://github.com/anupamthackar/HRBot.git cd HRBot -
Start Ollama and Pull the Model Ensure Ollama is running in your terminal, then download the required model (the app defaults to
llama3.1:8borllama3).ollama serve ollama run llama3.1:8b
-
Build the macOS App
- Open the project directory and open the Xcode project file (e.g.,
src/HRBot/HRBot.xcodeproj). - Select your Mac as the build destination.
- Press
Cmd + Rto build and run the application. - Alternatively, you can run the app directly from your terminal after building:
open ~/Library/Developer/Xcode/DerivedData/HRBot-*/Build/Products/Debug/HRBot.app
- Open the project directory and open the Xcode project file (e.g.,
- Initial Setup: On first launch, open Settings (
Cmd + ,) and ensure the Model Name matches your installed Ollama model (e.g.,llama3.1:8b). Click "Check Connection" to verify the app can communicate with the local LLM. - Chatting: Use the main chat interface to ask HR-related questions. You can drag and drop
.txt,.csv, or.pdffiles directly into the window to give the AI temporary context for your query. - Switching Roles: Use the role selector in the chat view to change the AI's behavior (e.g., switch to "Compliance" for strict policy adherence).
- Managing JDs: Navigate to JD Management (
Cmd + 3) to create a new Job Description manually or drag and drop an existing document to parse it. - Analyzing Resumes: Navigate to Resume Analysis (
Cmd + 2), select an active JD from the dropdown menu, and drop a candidate's resume to generate a match score, feature analysis, and a filtered list of requirements.
The conversational AI assistant is the core of HR-Bot. It allows you to interact with your HR data seamlessly while ensuring privacy through PII scrubbing.
Things You Can Do:
- Ask Policy Questions: Query standard HR policies, leave balances, or compliance rules.
- Draft Communications: Ask the bot to write offer letters, rejection emails, or company-wide announcements.
- Analyze Context: Drag and drop policy documents into the chat to ask specific questions about them.
- Roleplay Scenarios: Practice difficult employee conversations or interview techniques by switching personas.
Example Prompts:
- "Draft a professional email to notify employees about the upcoming public holiday on Friday."
- "Based on standard labor laws, what is the required notice period for a probationary employee?"
- (With a policy PDF dropped in) "Summarize the key changes to the remote work policy outlined in this document."
- (Using the 'Employee Relations' persona) "How should I handle a conflict between two team members regarding project responsibilities?"
- Swift / SwiftUI: Modern, declarative UI framework for native macOS applications.
- Ollama: Local, open-source large language model runner.
- Llama 3.1 (8B): The primary open-weights language model for natural language understanding and inference.
- Combine / Swift Concurrency: Used for reactive state management (
@Published) and asynchronous streaming (AsyncThrowingStream).
We welcome contributions to make HR-Bot even better!
- Fork the repository.
- Create a new branch for your feature (
git checkout -b feature/amazing-feature). - Ensure your code follows standard Swift API design guidelines.
- Test your changes locally to ensure PII scrubbing and LLM streaming remain performant and intact.
- Commit your changes (
git commit -m 'Add some amazing feature'). - Push to the branch (
git push origin feature/amazing-feature). - Open a Pull Request.
See docs/CONTRIBUTING.md for more detailed guidelines.
This project is licensed under the MIT License. See the LICENSE file for more details.
- Data Persistence: Migrate in-memory sessions, messages, and JDs to SwiftData or JSON-backed disk storage for persistent data across app restarts.
- Advanced Vector Search: Implement local vector embeddings (RAG) using Ollama to index and retrieve specific paragraphs from large policy handbooks.
- Export Capabilities: Add functionality to export resume analysis results and match matrices to CSV or PDF formats.
- Enhanced PDF Extraction: Improve text extraction to better handle complex resume formatting and multi-column layouts.
- Ollama "404 Not Found" Errors: If the app fails to generate a response, verify that the model configured in HR-Bot Settings exactly matches the model you have pulled in Ollama (e.g.,
llama3vsllama3.1:8b). - Connection Refused: Ensure
ollama serveis actively running in your terminal before launching the app. - Privacy Shield Warnings: If certain data isn't reaching the AI, check the PII scrubber logic; it may be correctly preventing sensitive data (like SSNs or emails) from being processed.