Skip to content

Jyotsana-Sharma/Gmail_Chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📧 Personal Email RAG Chatbot

A secure, multi-user, and local RAG (Retrieval-Augmented Generation) system for your emails. Chat with your Gmail history using high-performance vector search (pgvector) and local LLMs (Ollama).

🚀 Features

  • Strict User Isolation: Multi-user support with encrypted credentials and separate metadata-filtered search.
  • Hybrid Indexing: Optimized with B-Tree (relational) and HNSW (vector) indexes for millisecond retrieval.
  • Real-time Streaming: Token-by-token response rendering for a snappier user experience.
  • Conversation Memory: Remembers the last 6 messages (sliding window) to handle follow-up questions.
  • Privacy First: Everything runs locally on your machine using Ollama and PostgreSQL.

🛠 Project Structure

  • app.py: Streamlit-based web UI.
  • core/: Core application logic.
    • rag.py: RAG Engine with streaming and memory support.
    • database.py: PostgreSQL & pgvector management.
    • sync_emails.py: Email ingestion and vectorization orchestration.
    • config.py: Centralized configuration and path management.
    • utils/: Security and embedding helper utilities.
  • ARCHITECTURE.md: Technical system design and component breakdown.
  • EVALUATION.md: Performance and accuracy assessment.

📦 Setup & Installation

1. Prerequisites

  • Python 3.10+
  • Ollama: Download and run from ollama.com.
  • PostgreSQL: With pgvector extension installed.

2. Environment Setup

pip install -r requirements.txt

3. Database Initialization

Ensure your PostgreSQL server is running, then provide your connection details in credentials.yaml:

dbname: emails_rag
db_user: postgres
db_password: your_password
db_host: localhost
db_port: 5432

4. Pull Models

ollama pull qwen2.5-coder:3b
ollama pull nomic-embed-text

🎮 How to Run

Start the Chatbot:

streamlit run app.py

🧑‍💻 Technical Assessment Deliverables

  • Architecture Document: ARCHITECTURE.md
  • Evaluation Report: EVALUATION.md
  • Codebase: Fully modularized and documented.
  • Bonus: Robust multi-user isolation and HNSW indexing implemented.

About

Chat with your mails.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages