Local RAG pipeline that ingests Gmail emails, stores them in a vector database, and supports querying via an open-source LLM. Keeps previous email context for follow-up questions.
python setup.pysource venv/bin/activate- Go to Google Cloud Console
- Search API & Services
- Open Credentials
- Click Create Credentials → OAuth Client ID
- Select Desktop app
- Download the JSON file
- Move it to
src/credentials.json
Enable the Gmail API.
Install the required Mistral model:
ollama pull mistralThe default mistral model uses Q4_K_M quantization (4.4GB size vs 14GB FP32) for optimal performance.
./setup_database.shpython src/main.pypython benchmark.pyImportant
Please follow previous steps to setup the enviornment!
Run demo
python demo.py- Gmail API Quickstart
- Gmail Search Operators
- Gmail API Message Format
- Gmail API attachments Format
- Email Header Specifications
- Refine searches in Gmail
- Installing PostgreSQL + pgvector on Debian
- pypdf docs
- Mime types
- Improving Performance of PostgreSQL queries
- pytesseract project desc
- Vector Similarity Search with PostgreSQL’s pgvector – A Deep Dive
- Introduction: From Distance to Cosine Similarity
- Unlocking the Power of Sentence Embeddings with all-MiniLM-L6-v2
- Mistral-7B
- LangChain