<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Armaan Sharma</title>
    <description>The latest articles on DEV Community by Armaan Sharma (@armaansharma12).</description>
    <link>https://dev.to/armaansharma12</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3349451%2F6472eaa1-c6a0-40b1-8f0f-176fba254b74.jpeg</url>
      <title>DEV Community: Armaan Sharma</title>
      <link>https://dev.to/armaansharma12</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/armaansharma12"/>
    <language>en</language>
    <item>
      <title>Automating My Inbox with AI: A Python Email Assistant using Cohere, Gmail API, and Telegram Alerts</title>
      <dc:creator>Armaan Sharma</dc:creator>
      <pubDate>Sat, 12 Jul 2025 21:16:19 +0000</pubDate>
      <link>https://dev.to/armaansharma12/automating-my-inbox-with-ai-a-python-email-assistant-using-cohere-gmail-api-and-telegram-alerts-k15</link>
      <guid>https://dev.to/armaansharma12/automating-my-inbox-with-ai-a-python-email-assistant-using-cohere-gmail-api-and-telegram-alerts-k15</guid>
      <description>&lt;p&gt;Managing emails can be exhausting — especially when it involves repetitive tasks like sorting, replying, or adding deadlines to a calendar.&lt;/p&gt;

&lt;p&gt;So I built an AI-powered email automation system using Python, Cohere, and Gmail API that does all of this for me — and sends me Telegram alerts for important tasks.&lt;/p&gt;

&lt;p&gt;In this post, I’ll walk you through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How I built it&lt;/li&gt;
&lt;li&gt;The tools I used&lt;/li&gt;
&lt;li&gt;How it works behind the scenes&lt;/li&gt;
&lt;li&gt;My future plans for improvement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Features Overview&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Classifies incoming emails: important, junk, reply needed, deadline, etc.&lt;/li&gt;
&lt;li&gt;Suggests AI-generated replies&lt;/li&gt;
&lt;li&gt;Creates Google Calendar events for deadlines&lt;/li&gt;
&lt;li&gt;Sends Telegram alerts for urgent tasks&lt;/li&gt;
&lt;li&gt;Logs everything to emails.json for tracking&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tech Stack Used&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Python&lt;/li&gt;
&lt;li&gt; Gmail API (for reading/sending/deleting emails)&lt;/li&gt;
&lt;li&gt; Cohere AI (for email classification + reply generation)&lt;/li&gt;
&lt;li&gt; Google Calendar API (for deadline events)&lt;/li&gt;
&lt;li&gt; Telegram Bot API (for alerts)&lt;/li&gt;
&lt;li&gt; Docker + Ngrok (for deployment/exposing locally)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;System Architecture Diagram&lt;br&gt;
Gmail → Cohere (HTTP request) → JSON output → &lt;br&gt;


&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Draft email → Gmail API&lt;/li&gt;
&lt;li&gt;Create event → Calendar API&lt;/li&gt;
&lt;li&gt;Alert → Telegram API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Folder Structure&lt;br&gt;
ai_email_automator/&lt;br&gt;
├── auth/&lt;br&gt;
│   └── gmail_auth.py&lt;br&gt;
├── classification/&lt;br&gt;
│   └── cohere_classifier.py&lt;br&gt;
├── automation/&lt;br&gt;
│   ├── gmail_reader.py&lt;br&gt;
│   └── gmail_actions.py&lt;br&gt;
├── telegram/&lt;br&gt;
│   └── telegram_bot.py&lt;br&gt;
├── calendar/&lt;br&gt;
│   └── google_calendar.py&lt;br&gt;
├── main.py&lt;br&gt;
├── emails.json&lt;br&gt;
└── Dockerfile&lt;/p&gt;

&lt;p&gt;Final Output&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frl0gasskhzczaldmwvab.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frl0gasskhzczaldmwvab.png" alt=" " width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What’s Next / Future Plans&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Frontend dashboard for controlling rules&lt;/li&gt;
&lt;li&gt;Slack or WhatsApp integration&lt;/li&gt;
&lt;li&gt;Visual flow builder&lt;/li&gt;
&lt;li&gt;Google Sheets project tracking&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Conclusion&lt;br&gt;
This project taught me how powerful automation + LLMs can be in boosting productivity. I now spend far less time triaging my inbox, and get instant alerts for anything urgent.&lt;/p&gt;

&lt;p&gt;Feel free to check out the GitHub repo (linked below), suggest improvements, or fork it to make your own version!&lt;/p&gt;

&lt;p&gt;GitHub Repo: github.com/Armaan-Sharma12/AI-Email-AutomationLet me know your thoughts or if you’d like help building something similar.&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>automation</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
