How jaswanthsai14/gmail-automation-tool works
This repository is a Gmail AI assistant: a user submits a request through the Gradio chat interface, a LangGraph workflow routes it to email chat, summaries, drafting, or automation, and the result is formatted for display. The workflow reads and writes ChromaDB memory and uses Gmail services; sending and replying are delegated to Celery tasks. A FastMCP server exposes retrieval, reply, spam-storage, and summarization tools. Internal workflow wiring is only partly excerpted, so documented routes use README evidence; no unshown implementation details are assumed.
Main entry points: agent.py Intent routing · chroma_l.py ChromaDB memory · server.py FastMCP server · auth.py Gmail authentication
Components 21
Assistant workflow
- Gradio chat
agent.py - LangGraph workflow
agent.py - Intent routing
agent.py - Sender summary
agent.py - Email history chat
agent.py - Unread summary
agent.py - Email automation
agent.py - Email drafting
agent.py - Response formatter
agent.py
Gmail operations
- Gmail authentication
auth.py - Celery tasks
messaging.py
MCP tools
- FastMCP server
server.py - Email retriever
server.py - Reply tool
server.py - Spam storage
server.py - Spam log
spam.txt - Ollama summarizer
server.py
Memory and tasks
- ChromaDB memory
chroma_l.py
Other components
- User
- Gmail API
- Redis broker
Connections 31
- User → Gradio chat: submits prompt
README.md - Gradio chat → LangGraph workflow: invokes workflow
agent.py - LangGraph workflow → Intent routing: routes request
README.md - Intent routing → Sender summary: routes to
README.md - Intent routing → Email history chat: routes to
README.md - Intent routing → Unread summary: routes to
README.md - Intent routing → Email drafting: routes to
README.md - Intent routing → Email automation: routes to
README.md - Sender summary → Gmail authentication: reads messages
agent.py - Sender summary → ChromaDB memory: stores summary
agent.py - Email history chat → ChromaDB memory: retrieves history
agent.py - Unread summary → Gmail authentication: reads messages
agent.py - Unread summary → ChromaDB memory: stores email content
agent.py - Email automation → Gmail authentication: reads messages
agent.py - Email automation → ChromaDB memory: stores results
agent.py - Email drafting → ChromaDB memory: retrieves context
agent.py - Email drafting → Celery tasks: queues send
agent.py - LangGraph workflow → Response formatter: formats response
README.md - Response formatter → Gradio chat: returns response
README.md - Gmail authentication → Gmail API: builds service
auth.py - Celery tasks → Redis broker: uses broker
messaging.py - Celery tasks → Gmail authentication: sends message
messaging.py - LangGraph workflow → FastMCP server: uses tools
README.md - FastMCP server → Email retriever: registers tool
server.py - FastMCP server → Reply tool: registers tool
server.py - FastMCP server → Spam storage: registers tool
server.py - FastMCP server → Ollama summarizer: registers tool
server.py - Email retriever → ChromaDB memory: retrieves documents
server.py - Reply tool → Celery tasks: queues reply
server.py - Spam storage → Spam log: appends records
server.py - Ollama summarizer → ChromaDB memory: uses embeddings
server.py