Back to Projects

Project case study

ML - Systems · 2025

Fully Local Personal Email RAG System

Privacy-first Retrieval-Augmented Generation system that lets users query personal Gmail data using a fully local LLM with no external APIs or cloud inference.

Highlights

  • End-to-end local RAG pipeline with Gmail, PDF, and DOCX ingestion.
  • Strict per-user vector isolation with zero cross-user leakage.
  • Sub-100ms embedding and retrieval latency in a fully offline setup.

Gallery

What

Built a privacy-first Retrieval-Augmented Generation system that allows users to query their personal Gmail inbox using a fully local LLM.

The system supports attachment-aware search, enabling PDF and DOCX documents to be retrieved, cited, and reasoned over alongside email content.

How

Ingested Gmail inboxes via OAuth and parsed email bodies plus PDF and DOCX attachments.

Embedded content using a local sentence-transformer and stored vectors in per-user ChromaDB collections to enforce strict isolation.

Implemented similarity retrieval, prompt assembly, and answer generation with Qwen-8B running locally via Ollama, with a Streamlit-based UI.

Results

Successfully answered inbox-only and document-specific queries with citation-grounded responses.

Demonstrated zero cross-user leakage, with unauthorized queries reliably triggering refusal behavior.

Achieved sub-100ms embedding and retrieval latency with fully offline, end-to-end execution.