← Back to portfolio

City of Brampton HR AI Mentor – RAG PoC

Retrieval-Augmented HR policy assistant that answers employee questions from official HR documents only. A government-flavored proof that an AI assistant can be trusted to stay inside approved sources, cite them, and say “I don’t know” when the source does not support an answer.

Supporting Case Study RAG Prototype HR Policy Domain
Role: Solo Engineer
Tech: Python · LangChain · FAISS · Gemini API · Streamlit
One-Page Summary (PDF)

1. Context & Goal

This proof-of-concept was built around the City of Brampton’s HR modernization roadmap: could an “AI Mentor” safely answer employee HR questions by citing only official policy documents, without inventing rules or leaking sensitive information?

The notebook demonstrates an end-to-end RAG prototype that ingests curated HR policies, indexes them into a vector store, and exposes a chat interface where every answer is grounded in policy text and accompanied by citations.

2. Business Problem

HR leadership wanted to explore generative AI, but with strict constraints:

The PoC’s success criteria were qualitative: show that a small, well-designed RAG system can respect policy boundaries, surface clear citations, and refuse out-of-scope questions.

3. Data & RAG Design

The PoC used a curated set of official Brampton HR policy documents, including:

  • Respectful Workplace Policy (HRM-150)
  • Recruiting and Retaining Top Talent (HRM-160)
  • Salary Administration Policy (HRM-210)

Documents were loaded from PDF, cleaned, and split into overlapping text chunks with HR-aware chunking (e.g., preserving section headings and policy numbers as metadata).

The RAG stack combines vector similarity search with strict filtering:

  • Embeddings: Google Generative AI embeddings via LangChain.
  • Vector store: FAISS index persisted for fast local search.
  • Metadata: policy ID, section heading, and page number for traceability.

All answers are built only from the retrieved chunks – no “open internet” retrieval.

4. Application Flow & Guardrails

4.1 Conversation Flow

  • Employee types a natural-language question into a Streamlit UI (“Can I carry over vacation days?”).
  • The app creates a retrieval-augmented prompt using the top-K policy chunks from FAISS.
  • The Gemini chat model generates a concise answer plus citations to specific policy sections.

4.2 Protection-by-Design Guardrails

  • Scope enforcement: If no relevant chunk meets a similarity threshold, the model responds with a polite “I don’t know” and suggests contacting HR.
  • Policy-only answers: System prompt explicitly forbids inventing new rules or referencing unapproved sources.
  • Citations required: The model is instructed to always quote or cite the underlying policy text.

5. Outcomes & What This Demonstrates

5.1 Prototype Outcomes

  • Working “AI Mentor” that can answer common HR questions directly from official policy text.
  • Consistent behavior when faced with out-of-scope questions: the system declines to answer rather than hallucinate.
  • Clear, traceable responses with inline citations, which HR leadership can audit and refine.

5.2 Why It Matters

This PoC is intentionally small but opinionated:

  • Shows how to start safely with generative AI in a regulated domain.
  • Demonstrates a pattern that can be expanded to broader HR self-service and L&D use cases.
  • Provides a template for other municipal or enterprise HR teams evaluating RAG.

6. My Role & Skills Demonstrated

6.1 Responsibilities

  • Defined PoC scope with HR policy focus and safety constraints.
  • Ingested and pre-processed policy PDFs into a structured RAG-ready corpus.
  • Implemented the LangChain pipeline (embeddings, FAISS, Gemini chat model).
  • Built a Streamlit front-end with a simple, HR-friendly chat interface.
  • Designed and tested guardrails to avoid hallucinations and enforce policy-only responses.

6.2 Skills Highlighted

RAG System Design LangChain & FAISS Google Gemini API PDF Ingestion & Chunking Prompt & Guardrail Design Stakeholder-Friendly Prototyping

7. Assets & Notebook

For reviewers who want to see the implementation details (data ingestion, FAISS index creation, LangChain RAG chain, and Streamlit integration), the full notebook is available here:

➜ Brampton HR AI Mentor – Full Colab Notebook (HTML export)