Skip to content

AnamShergill/Hackathon_0-Bronze-Tier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– AI Employee Vault - Bronze Tier

Personal AI Employee Hackathon 0 โ€“ Building Autonomous FTEs in 2026

An autonomous email processing system that monitors Gmail, applies intelligent priority scoring, extracts tasks, creates action plans, and flags sensitive operations for human approval using the Ralph Wiggum pattern (ACT โ†’ INFORM โ†’ WAIT).

Python 3.13+ License: MIT Status: Bronze Tier Complete


๐ŸŽฏ What It Does

The AI Employee Vault autonomously:

  • ๐Ÿ“ง Monitors your Gmail inbox for important/starred emails
  • ๐ŸŽฏ Scores priority (HIGH/MEDIUM/LOW/IGNORE) based on keywords
  • ๐Ÿ“ Extracts tasks, deadlines, and people mentioned
  • ๐Ÿ“‹ Creates actionable plans with checklists
  • โœ๏ธ Drafts professional reply emails
  • โš ๏ธ Flags financial transactions for human approval
  • ๐Ÿ“Š Updates a live dashboard with activity logs
  • โœ… Follows strict rules defined in Company Handbook

No emails are sent automatically - all replies require human approval (Bronze Tier safety feature).


๐Ÿ—๏ธ Architecture

graph TB
    A[Gmail Inbox] -->|OAuth| B[Gmail Watcher]
    B -->|Poll every 5 min| C{New Email?}
    C -->|Yes| D[Needs_Action/]
    D --> E[AI Agent]
    E --> F[Priority Scorer]
    F --> G[Task Extractor]
    G --> H[Reply Drafter]
    H --> I{Financial?}
    I -->|Yes| J[Flag HITL]
    I -->|No| K[Create Plan]
    J --> K
    K --> L[Update Dashboard]
    L --> M[Move to Done/]
    M --> N[Human Reviews]
Loading

โœจ Features

Bronze Tier Achievements โœ…

  • โœ… Gmail Watcher - OAuth authentication, polls every 5 minutes
  • โœ… Priority Scoring - Keyword-based urgency detection
  • โœ… Task Extraction - Automatic action item identification
  • โœ… Reply Drafting - Professional email responses
  • โœ… HITL Protection - Financial operations require approval
  • โœ… Dashboard - Live system status and activity logs
  • โœ… Ralph Wiggum Loop - ACT โ†’ INFORM โ†’ WAIT autonomy pattern
  • โœ… Folder Workflow - Needs_Action โ†’ Plans โ†’ Done pipeline

Security & Privacy

  • ๐Ÿ”’ OAuth 2.0 authentication (no password storage)
  • ๐Ÿ”’ Local data storage only (no external APIs except Gmail)
  • ๐Ÿ”’ Read-only Gmail scope (cannot send emails)
  • ๐Ÿ”’ Automatic HITL flags for financial keywords
  • ๐Ÿ”’ All sensitive files in .gitignore

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.13+
  • Gmail account
  • Google Cloud Project with Gmail API enabled

Installation

  1. Clone the repository:
git clone https://github.com/AnamShergill/Hackathon_0-Bronze-Tier.git
cd Hackathon_0-Bronze-Tier
  1. Install dependencies:
pip install google-api-python-client google-auth-oauthlib google-auth-httplib2 watchdog python-dotenv playwright pyyaml
  1. Set up Gmail API:

    • Go to Google Cloud Console
    • Create a new project
    • Enable Gmail API
    • Create OAuth 2.0 credentials
    • Download as credentials.json and place in project root
  2. Start the Gmail Watcher:

python Watchers/gmail_watcher.py
  • Browser opens for OAuth (first run only)
  • Polls Gmail every 5 minutes
  • Creates .md files in Needs_Action/
  1. Process emails:
python Skills/email_processor.py
  • Applies priority scoring
  • Extracts tasks and deadlines
  • Creates plans in Plans/
  • Drafts replies (requires approval)
  • Moves processed emails to Done/
  1. Check the dashboard:
cat Dashboard.md

๐Ÿ“ Project Structure

AI_Employee_Vault/
โ”œโ”€โ”€ Needs_Action/          # Incoming emails from watcher
โ”œโ”€โ”€ Plans/                 # Action plans and draft replies
โ”œโ”€โ”€ Done/                  # Processed emails with <COMPLETE> markers
โ”œโ”€โ”€ Pending_Approval/      # Items awaiting human approval
โ”œโ”€โ”€ Approved/              # Human-approved items
โ”œโ”€โ”€ Skills/                # Agent skill definitions
โ”‚   โ”œโ”€โ”€ 01_EMAIL_PROCESSOR.md
โ”‚   โ”œโ”€โ”€ 02_EMAIL_REPLY_DRAFTER.md
โ”‚   โ”œโ”€โ”€ 03_TASK_EXTRACTOR.md
โ”‚   โ”œโ”€โ”€ 04_PRIORITY_SCORER.md
โ”‚   โ”œโ”€โ”€ 05_DASHBOARD_UPDATER.md
โ”‚   โ”œโ”€โ”€ 06_ARCHIVE_CLEANER.md
โ”‚   โ””โ”€โ”€ email_processor.py
โ”œโ”€โ”€ Watchers/              # External system monitors
โ”‚   โ”œโ”€โ”€ gmail_watcher.py
โ”‚   โ””โ”€โ”€ base_watcher.py
โ”œโ”€โ”€ Dashboard.md           # Live system status
โ”œโ”€โ”€ Company_Handbook.md    # Rules of engagement
โ”œโ”€โ”€ CLAUDE.md              # AI agent system prompt
โ”œโ”€โ”€ demo_guide.md          # Comprehensive demo guide
โ”œโ”€โ”€ TROUBLESHOOTING.md     # Debug guide
โ””โ”€โ”€ orchestrator.py        # Main coordination script

๐Ÿงช Testing

Send a Test Email

  1. Send email to yourself with:

    • Subject: URGENT: Payment Due $500
    • Body: Please process this payment by tomorrow.
  2. In Gmail:

    • DON'T open it (keep unread)
    • Click the star icon โญ
  3. Wait up to 5 minutes for watcher to detect

  4. Run processor:

python Skills/email_processor.py
  1. Check results:
ls Plans/          # Action plan created
ls Done/           # Email moved here
cat Dashboard.md   # Updated with activity

๐Ÿ“Š Priority Scoring

The system automatically assigns priorities:

Priority Triggers Example
HIGH Urgent keywords + $ amounts + deadlines "URGENT: Invoice $500 due tomorrow"
MEDIUM Questions, requests, updates "Can you send me the report?"
LOW Informational, confirmations "Your order has shipped"
IGNORE Promotional, no-reply senders "Newsletter: Weekly deals"

๐Ÿ›ก๏ธ HITL (Human-In-The-Loop) Protection

Per Company_Handbook.md, these operations require human approval:

โœ… Auto-approve:

  • Reading emails
  • Creating plans
  • Updating dashboard

โš ๏ธ Require approval:

  • Financial transactions ($, โ‚ฌ, ยฃ, payment, invoice)
  • Sending emails with attachments
  • Adding new recipients (CC/BCC)

Example HITL flag:

requires_hitl: true
hitl_reason: "Financial transaction ($500) requires human approval"

๐Ÿ”ง Troubleshooting

Watcher Not Finding Emails?

Check:

  1. Email is unread (bold in Gmail)
  2. Email is starred (yellow star icon)
  3. Email is in Inbox (not Sent/Spam)
  4. Email is recent (last 24 hours)

Debug:

python debug_gmail.py

See TROUBLESHOOTING.md for detailed guide.


๐Ÿ“š Documentation


๐ŸŽ“ Lessons Learned

What Worked Well โœ…

  • Structured markdown files with YAML frontmatter
  • Ralph Wiggum pattern for clear autonomy boundaries
  • Keyword-based priority scoring (no ML needed)
  • Folder-based workflow (simple and debuggable)
  • HITL flags for financial operations

Challenges โš ๏ธ

  • HTML email content extraction
  • Gmail's 24-hour query limitation
  • No automatic email sending (by design)
  • Manual loop execution required

Key Insights ๐Ÿ’ก

  • Autonomy requires constraints (HITL approval builds trust)
  • Transparency is critical (dashboard + activity logs)
  • Simple > Complex (files easier than database)
  • Security first (limited OAuth scopes)

๐Ÿš€ Future Roadmap

Silver Tier (Next)

  • ๐Ÿ“ฑ WhatsApp Business API watcher
  • ๐Ÿ“ง MCP email sender with approval workflow
  • ๐Ÿ”„ Automatic loop trigger on new files
  • ๐Ÿงต Conversation threading

Gold Tier (Future)

  • ๐ŸŒ Multi-channel (Slack, Discord, Telegram)
  • ๐Ÿง  Advanced NLP (sentiment, entity extraction)
  • ๐Ÿ“… Calendar integration
  • ๐Ÿ’ณ Payment processing with HITL

Platinum Tier (Vision)

  • ๐Ÿค Team collaboration
  • ๐Ÿ“ฑ Mobile app
  • ๐ŸŽค Voice interface
  • ๐Ÿ”ฎ Proactive suggestions

๐Ÿค Contributing

This is a hackathon project demonstrating Bronze Tier capabilities. Contributions welcome!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

MIT License - See LICENSE file for details


๐Ÿ™ Acknowledgments

Built for Personal AI Employee Hackathon 0 โ€“ Building Autonomous FTEs in 2026

Special thanks to:

  • Google Gmail API team
  • Python community
  • Claude AI for development assistance

๐Ÿ“ž Contact

Anam Shergill


๐Ÿ† Achievement Unlocked

Bronze Tier Complete โœ…

  • Folder structure โœ“
  • Core markdown files โœ“
  • Python project + dependencies โœ“
  • Gmail Watcher running โœ“
  • Agent skills created โœ“
  • Ralph Wiggum loop functional โœ“

Ready for Silver Tier! ๐Ÿš€


Last Updated: March 18, 2026
Version: Bronze Tier v1.0
Status: Production Ready

About

๐Ÿค– Autonomous AI Employee for Gmail - Monitors inbox, scores priority, extracts tasks, drafts replies, and flags financial ops for human approval. Built with Python + Gmail API. Features: Priority scoring, task extraction, HITL protection, live dashboard. Bronze Tier complete! ๐Ÿ†

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors