Skip to content
Maaz Ali
All work

Case study — RAG knowledge platform — 2026

Teamly Q&A

Role-aware RAG knowledge assistant: staff get answers only from documents their role is cleared to read.

Role
Full-stack and AI engineering
Timeline
2026
Cited answer with source chunks, sensitivity levels and relevance scores

6

Roles

5

Departments

4

Sensitivity levels

~3s

Warm answer time

The problem

Staff at a software company needed answers from internal documents in plain English, without anyone seeing content above their clearance.

Overview

Built as an MVP internal knowledge assistant for a software company. Documents go through a file ingestion pipeline into the knowledge base, and every answer cites the chunks it came from.

Access control lives inside the database query, so a CEO and a guest asking the same question get different answers.

Key features

  1. 01File ingestion pipeline into a searchable knowledge base
  2. 02Answers with numbered source citations and relevance scores
  3. 03Access control enforced in the database query across 6 roles, 5 departments and 4 sensitivity levels
  4. 04Guardrails that block prompt injection before retrieval
  5. 05PII redaction based on the user’s role
  6. 06Monitoring for grounding rate, latency, token cost and usage by role

Stack

  • RAG
  • LLMs
  • Role-based access control
  • Vite
  • Vercel

Outcome

  • Warm answers return in about 3 seconds at roughly $0.0002 per query.
Assistant view showing the signed-in role’s access scope
02Assistant view showing the signed-in role’s access scope
Access model: role permissions by department and sensitivity
03Access model: role permissions by department and sensitivity
Guardrail activity and knowledge base breakdown
04Guardrail activity and knowledge base breakdown
Monitoring dashboard: grounding rate, cost and latency
05Monitoring dashboard: grounding rate, cost and latency
A guest asking the same question is denied restricted content
06A guest asking the same question is denied restricted content