How amitvaranasi/rag-email-sorting works
Project type and purpose
• This is a four-phase RAG (Retrieval-Augmented Generation) pipeline, implemented as a sequence of Python scripts, whose goal is to ingest your daily Gmail messages, index them with vector embeddings, generate a concise Markdown report via the Gemini API, and then email that report back to you each morning.
Relationships and data flow
• cron_job.sh invokes all four scripts sequentially, scheduled nightly by launchd
Architectural patterns and design principles
• Pipeline pattern: clear sequential phases (Ingest → Index → Generate → Deliver)
• Separation of concerns: each script handles one job
• Externalized configuration: credentials.json, token.json, environment variables for API keys
• Local persistence for durability: SQLite for raw data, ChromaDB for embeddings, file system for outputs
Technologies, frameworks, libraries
• Python 3.10+
• sqlite3 (standard library)
• ChromaDB (vector database)
• Google’s Gmail API (via google-auth, google-api-python-client)
• Google Gemini API (via HTTP/web client)
• macOS launchd (scheduler)