I automated my Gmail Inbox with AI Agents (#crewai tutorial)

7 Mar 2025 · 46 min
46:24

In this tutorial, Tony Kipkemboi demonstrates how to build an AI‑driven workflow that cleans, categorizes, labels, drafts replies, notifies via Slack, and empties the trash of a Gmail inbox using CrewAI. He walks through the overall architecture (terminal UI, main entry point, crew orchestration), the five specialized agents (email categorizer, organizer, response generator, Slack notifier, email cleaner), and the supporting tools (IMAP email fetcher, date utility, Gmail and Slack APIs). He explains the pre‑kickoff function that fetches a user‑specified number of unread emails, stores them locally, and computes email age. Each agent receives a clear role, goal, backstory, and task description, and uses tools such as read‑file, Gmail label/apply, draft creation, and Slack webhook. The categorizer assigns categories (newsletter, promotion, personal, YouTube, etc.) and priority levels (high, medium, low) based on custom rules, while the organizer applies Gmail labels and stars. The response generator drafts replies for high‑priority emails (saved to drafts when storage permits). The notifier sends concise Slack alerts for urgent items. The cleaner deletes low‑priority or aged emails and empties the trash. Tony also discusses model selection (OpenAI GPT‑4‑mini, Gemini, Llama‑3 via Groq, Ollama) and the trade‑offs of privacy versus performance. He shows how to obtain Gmail app passwords and Slack webhooks, run the project locally, and optionally deploy on CrewAI Enterprise with a cron job. Finally, he mentions extending the system with vector‑store search, a chat UI, or integrating with the MCP protocol for tool‑driven interactions, and invites viewers to contribute or request UI enhancements.

Chapters

More from Tony

4:21
youtube.com

What Is LoRA? AI Fine-Tuning Explained With Glasses

1mo ago
3:07
youtube.com

i bought NVIDIA’s DGX Spark (unboxing a desktop AI Supercomputer)

1mo ago
2:59
youtube.com

Rekody: A Private Dictation App That Runs Entirely on Your Mac for Free!

3mo ago
11:49
youtube.com

Own Your LLM: Deploy + Build an App on It (Modal Auto Endpoints)

3mo ago
9:30
youtube.com

How to Setup Claude Code's NEW Remote Control Feature (Step-by-Step)

7mo ago
4:58
youtube.com

Faxes are Still a Thing? Here’s How I Automated Them for $1

7mo ago
15:04
youtube.com

CrewAI Flows Made Super Easy

1y ago
5:15
youtube.com

Summarize Videos and Research Companies with CrewAI + Gemini Models [Quickstart Guide]

1y ago
4:10
youtube.com

NotebookLM Video Overviews in 4 Minutes

1y ago
22:47
youtube.com

How I Made 3 AI Agents Work Together for Smarter Reports!

1y ago
8:36
youtube.com

How to Make Your AI Agents More Reliable with CrewAI Task Guardrails (Step-by-Step Tutorial)

1y ago
See all content