Back to projects
Applied AI / RAGWorking Prototype

HRagentAssistant

HR assistant that answers from company documents, cites its sources and abstains when evidence is insufficient.

  • Python
  • Streamlit
  • Qdrant
  • LangChain
  • SQLite
  • Groq
  • Jina embeddings
  • pytest

Problem

Employees ask HR the same policy questions repeatedly, while a generic chatbot can invent answers, ignore document versions or expose restricted documents.

Solution

A document-grounded assistant: it retrieves passages from the HR documents actually loaded, answers with verified citations, abstains when the evidence is not enough, reports conflicts between document versions and enforces role-based document access in the backend. It also guides a leave request (summary, explicit confirmation, HR decision) and lets an employee forward an unanswered question to HR.

My contribution

Personal project built as a local prototype on synthetic data: retrieval pipeline, guardrails, authorization model, workflows, Streamlit interface, test suite and documentation (architecture, security, roadmap).

Key features

  • Answers carry citations that are checked against the retrieved passages; the assistant abstains instead of guessing
  • Detects conflicting active versions of the same document and reports the conflict
  • Role-based access (employee, HR manager) enforced in the retrieval filter and the backend, not in the prompt
  • Document content is treated as untrusted: prompt-injection attempts are neutralised
  • Works fully offline by default (extractive answers, local embeddings, embedded Qdrant); an LLM and semantic embeddings are optional
  • Leave-request workflow with explicit confirmation and HR approval, and escalation of questions to HR (no notification is sent)

Architecture

Streamlit interface
HR assistant pipeline
Authentication and roles
Answer engine and guardrails
Qdrant index with access filter
SQLite (users, documents, requests)

Engineering decisions

  • Abstain rather than answer: a lexical coverage gate refuses questions the documents do not cover.
  • Access control is applied at retrieval time through a Qdrant filter, so restricted passages are never retrieved for the wrong role.
  • No document text or question is written to the logs; all data stays local under data/runtime.

Validation and tests

  • Offline pytest suite split into unit, integration and security tests (access control, prompt injection and data leakage, workflow authorization).
  • Two small business evaluation sets (36 and 15 cases). The repository itself notes these results are not a quality measure because the corpus is synthetic.

Status and limitations

  • Prototype on synthetic data only: not suitable for real HR data until the points listed in docs/SECURITY.md are addressed.
  • The abstention gate is lexical, so distant paraphrases (for example « travail à distance » for « télétravail ») are refused: safe, but sometimes unhelpful. Making it semantic is the first roadmap item.
  • No SSO, notifications, OCR for scanned PDFs or leave-balance integration; authentication is local only.

More projects