Skip to content

S-Farhan05/Agentic-Autonomous-Employee

Repository files navigation

AI Employee - Silver Tier Implementation

A local-first Personal AI Employee built with Qwen Code and Obsidian

This Silver Tier implementation provides autonomous email and social media automation with human-in-the-loop approval workflow.

๐ŸŽฏ Tier Status

Tier Status Description
๐Ÿฅ‰ Bronze โœ… Complete Foundation, file watcher, task processing
๐Ÿฅˆ Silver โœ… Complete Gmail automation, LinkedIn posting, approval workflow
๐Ÿฅ‡ Gold โณ Pending Odoo integration, multi-domain automation
๐Ÿ’Ž Platinum โณ Pending Cloud deployment, always-on operation

โœจ What's Working

๐Ÿ“ง Gmail Automation

  • โœ… Gmail Watcher detects new emails (2-min intervals)
  • โœ… Filters promotional/security emails automatically
  • โœ… Creates tasks in Needs_Action/ folder
  • โœ… Qwen Code processes and creates approval requests
  • โœ… Human-in-the-loop approval workflow
  • โœ… Sends emails via Gmail API (OAuth2 authenticated)

๐Ÿ’ผ LinkedIn Automation

  • โœ… Auto-posts to LinkedIn about business topics
  • โœ… Professional content generation
  • โœ… Approval workflow before posting

๐Ÿค– Autonomous Processing

  • โœ… Continuous Processor runs every 2 minutes
  • โœ… Qwen Code as the reasoning engine
  • โœ… Company Handbook rules for decision-making
  • โœ… Dashboard updates automatically

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    EXTERNAL SOURCES                             โ”‚
โ”‚         Gmail                    LinkedIn          File Drops   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ”‚                        โ”‚                  โ”‚
           โ–ผ                        โ–ผ                  โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    PERCEPTION LAYER (Watchers)                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”‚
โ”‚  โ”‚ Gmail Watcherโ”‚  โ”‚LinkedIn Posterโ”‚ โ”‚File Watcher  โ”‚          โ”‚
โ”‚  โ”‚  (2 min)     โ”‚  โ”‚  (on demand)  โ”‚ โ”‚  (on event)  โ”‚          โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
          โ”‚                                    โ”‚
          โ–ผ                                    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    OBSIDIAN VAULT (Local Memory)                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ /Needs_Action/  โ†’  /Pending_Approval/  โ†’  /Approved/     โ”‚  โ”‚
โ”‚  โ”‚ /Done/  โ”‚  /Plans/  โ”‚  /Logs/  โ”‚  Dashboard.md           โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                                 โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    REASONING LAYER (Qwen Code)                  โ”‚
โ”‚   Continuous Processor (every 2 min) invokes Qwen Code          โ”‚
โ”‚   Read โ†’ Think โ†’ Plan โ†’ Create Approvals โ†’ Update Dashboard     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                                 โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    ACTION LAYER                                 โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”‚
โ”‚  โ”‚Gmail API     โ”‚  โ”‚LinkedIn API  โ”‚  โ”‚File System   โ”‚          โ”‚
โ”‚  โ”‚(send email)  โ”‚  โ”‚(post update) โ”‚  โ”‚(move files)  โ”‚          โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ Project Structure

Agentic-Autonomous-Employee/
โ”œโ”€โ”€ AI_Employee_Vault/          # Obsidian vault (memory)
โ”‚   โ”œโ”€โ”€ Inbox/                  # File drop zone
โ”‚   โ”œโ”€โ”€ Needs_Action/           # Tasks waiting for processing
โ”‚   โ”œโ”€โ”€ Pending_Approval/       # Awaiting human approval
โ”‚   โ”œโ”€โ”€ Approved/               # Ready to execute
โ”‚   โ”œโ”€โ”€ Done/                   # Completed tasks
โ”‚   โ”œโ”€โ”€ Dashboard.md            # Real-time status
โ”‚   โ””โ”€โ”€ Company_Handbook.md     # AI behavior rules
โ”œโ”€โ”€ watchers/                   # Perception layer
โ”‚   โ”œโ”€โ”€ gmail_watcher.py        # Gmail monitoring
โ”‚   โ”œโ”€โ”€ filesystem_watcher.py   # File drop monitoring
โ”‚   โ””โ”€โ”€ base_watcher.py         # Base class
โ”œโ”€โ”€ scripts/                    # Core logic
โ”‚   โ”œโ”€โ”€ continuous_processor.py # Invokes Qwen every 2 min
โ”‚   โ”œโ”€โ”€ create_email_approval.py # Creates approval requests
โ”‚   โ”œโ”€โ”€ send_approved_email.py  # Sends emails via Gmail API
โ”‚   โ”œโ”€โ”€ linkedin_poster.py      # LinkedIn posting
โ”‚   โ””โ”€โ”€ gmail_auth.py           # OAuth authentication
โ”œโ”€โ”€ mcp-servers/                # Future: MCP integration
โ”œโ”€โ”€ credentials/                # OAuth tokens (gitignored)
โ”œโ”€โ”€ docs/                       # Documentation archive
โ”œโ”€โ”€ .qwen/                      # Qwen skills & config
โ”œโ”€โ”€ README.md                   # This file
โ””โ”€โ”€ requirements.txt            # Python dependencies

๐Ÿš€ Quick Start

Prerequisites

  • Python: 3.13 or higher
  • Qwen Code: Installed and configured
  • Obsidian: Optional (for GUI viewing)
  • Gmail API: OAuth credentials in credentials/

Installation

cd E:\Farhan-work\Hackathon\Agentic-Autonomous-Employee
pip install -r requirements.txt

Start Automation

Terminal 1 - Gmail Watcher:

python watchers/gmail_watcher.py

Terminal 2 - Continuous Processor:

python scripts/continuous_processor.py

Test the System

  1. Send a test email to your Gmail address
  2. Wait 2 minutes - Gmail Watcher detects it
  3. Wait 2 more minutes - Continuous Processor invokes Qwen
  4. Check Pending_Approval/ - Approval request created
  5. Move to Approved/ - You approve the action
  6. Wait 2 minutes - Email sent via Gmail API
  7. Check Done/ - Task completed

๐Ÿ“Š Workflow Example

Email Processing Flow

1. Email arrives โ†’ Gmail Watcher (2 min)
                      โ†“
2. Task created โ†’ Needs_Action/EMAIL_*.md
                      โ†“
3. Continuous Processor (2 min) โ†’ Invokes Qwen Code
                      โ†“
4. Qwen reads Company_Handbook.md โ†’ Creates approval request
                      โ†“
5. Approval in Pending_Approval/ โ†’ Waits for human
                      โ†“
6. You move to Approved/ โ†’ Human approval
                      โ†“
7. Next cycle โ†’ Qwen executes send_approved_email.py
                      โ†“
8. Email sent via Gmail API โ†’ Moved to Done/

โš™๏ธ Configuration

Processing Interval

Default: 120 seconds (2 minutes)

# Custom interval (in seconds)
python scripts/continuous_processor.py <vault_path> <interval_seconds>

# Example: 5 minute intervals
python scripts/continuous_processor.py AI_Employee_Vault 300

Gmail Filtering

Edit watchers/gmail_watcher.py to customize:

# Emails to ignore
ignore_senders = ['noreply', 'security', 'linkedin', 'amazon']
ignore_subjects = ['PIN', 'verification', 'promo', 'newsletter']

AI Behavior Rules

Edit AI_Employee_Vault/Company_Handbook.md:

  • Add new decision rules
  • Change approval thresholds
  • Modify priority levels
  • Define working hours

๐Ÿ› ๏ธ Commands

Monitor Folders

# Check pending tasks
dir AI_Employee_Vault\Needs_Action\*.md

# Check approvals waiting
dir AI_Employee_Vault\Pending_Approval\*.md

# Check ready to execute
dir AI_Employee_Vault\Approved\*.md

View Logs

# Gmail Watcher logs
type AI_Employee_Vault\Logs\gmail_watcher.log

# Continuous Processor logs
type AI_Employee_Vault\Logs\continuous_processor.log

# Email actions log
type AI_Employee_Vault\Logs\email_actions.json

Dashboard

# View current status
type AI_Employee_Vault\Dashboard.md

๐Ÿ“š Documentation

Full documentation is in the docs/ folder:

Document Description
docs/SILVER_TIER_COMPLETE.md Silver tier implementation details
docs/GMAIL_TESTING_GUIDE.md Gmail setup and testing guide
docs/EMAIL_WORKFLOW_COMPLETE.md Email workflow documentation
docs/QUICKSTART.md Quick start guide
docs/PROJECT_SUMMARY.md Project overview

๐Ÿ”’ Security

  • โœ… All data stays local in Obsidian vault
  • โœ… OAuth2 authentication for Gmail API
  • โœ… Credentials stored in credentials/ (gitignored)
  • โœ… Human approval required for all external actions
  • โœ… Audit logs in Logs/ folder
  • โœ… .gitignore prevents sensitive data commits

๐ŸŽฏ Silver Tier Deliverables

From the hackathon requirements:

Requirement Status Implementation
All Bronze requirements โœ… Complete foundation
2+ Watcher scripts โœ… Gmail + File System
LinkedIn auto-posting โœ… linkedin_poster.py
Qwen reasoning loop โœ… continuous_processor.py
MCP server for actions โš ๏ธ Using direct API (MCP reserved for Gold)
Human-in-the-loop โœ… Pending_Approval/ workflow
Scheduling โœ… 2-minute intervals
Agent Skills โœ… Qwen skills in .qwen/skills/

๐Ÿ”ฎ Next Steps (Gold Tier)

  • Odoo ERP integration via MCP
  • WhatsApp watcher for message monitoring
  • Weekly business audit with CEO briefing
  • Multiple MCP servers for different actions
  • Error recovery and graceful degradation

๐Ÿš€ Platinum Tier (Future)

  • Cloud VM deployment (24/7 operation)
  • Local/Cloud separation (Cloud drafts, Local approves)
  • Vault sync via Git
  • A2A agent communication
  • Facebook/Instagram/Twitter integration

Built with Qwen Code | Silver Tier Complete | Local-First AI Employee

About

Agentic AI system for building Digital FTEs ( Full-Time-Equivalent ). Uses watchers, Claude-based reasoning, and MCP integrations to monitor Gmail, WhatsApp, and LinkedIn. Generates tasks, plans workflows, drafts actions, and routes approvals via human-in-the-loop. Local-first architecture enabling scalable, 24/7 automation for business operations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors