Skip to content

Eng-Muhammad-Affan/digital-fte

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Digital FTE - Personal AI Employee (Silver Tier)

Your life and business on autopilot. Local-first, agent-driven, human-in-the-loop.

Digital FTE (Full-Time Equivalent) is a personal AI employee system that autonomously manages personal and business affairs 24/7. It uses Qwen Code as the reasoning engine and Obsidian as the knowledge dashboard, with lightweight Python "Watcher" scripts monitoring inputs (Gmail, WhatsApp, filesystems) and FastMCP servers handling external actions.

πŸ† Hackathon Status: Silver Tier

This repository implements the Silver Tier with all Bronze features plus:

βœ… Silver Tier Deliverables

  • All Bronze requirements (vault, watchers, Qwen integration)
  • Two or more Watcher scripts (Gmail + WhatsApp + Filesystem)
  • Automatically Post on LinkedIn (via MCP server with approval workflow)
  • Qwen reasoning loop that creates Plan.md files
  • Working MCP servers built using FastMCP (Email + LinkedIn)
  • Human-in-the-loop approval workflow for sensitive actions
  • Basic scheduling via Task Scheduler integration
  • All AI functionality as Agent Skills

πŸ“‹ Prerequisites

Software Version Purpose
Qwen Code Latest Reasoning engine
Obsidian v1.10.6+ Knowledge dashboard
Python 3.13+ Watcher scripts & MCP servers
UV Latest Python package manager
Node.js v24+ LTS MCP servers (optional)

πŸš€ Quick Start

1. Clone and Setup

cd G:\digital-fte

# Activate virtual environment (Windows)
.venv\Scripts\activate

# Sync UV environment
uv sync

# Install Playwright browsers
uv run playwright install chromium

2. Configure Environment

# Copy environment template
copy .env.example .env

# Edit .env with your settings
# IMPORTANT: Set DRY_RUN=false for production use

3. Setup Gmail API (Optional)

# Download credentials.json from Google Cloud Console
# Place in ~/.gmail_watcher/credentials.json

# First run will auto-authenticate
uv run python -m GmailWatcher.main --vault ./vault

4. Open Vault in Obsidian

File β†’ Open Vault β†’ Select G:\digital-fte\vault

5. Start Silver Tier

# Activate virtual environment
.venv\Scripts\activate

# Check system status
uv run python -m Orchestrator.main status

# Start all watchers
uv run python -m Orchestrator.main start

# Process files with Qwen (interactive mode - requires approval)
uv run python -m Orchestrator.main process

# Process files with Qwen (autonomous mode - auto-approves actions)
uv run python -m Orchestrator.main process --yolo

πŸ“ Project Structure

G:\digital-fte\
β”œβ”€β”€ README.md                     # This file
β”œβ”€β”€ doc.md                        # Full architectural blueprint
β”œβ”€β”€ pyproject.toml                # UV project configuration
β”œβ”€β”€ .env.example                  # Environment variables template
β”œβ”€β”€ .agents/
β”‚   └── skills/
β”‚       └── fastmcp/
β”‚           └── templates/        # FastMCP server templates
β”œβ”€β”€ mcp-servers/
β”‚   β”œβ”€β”€ email/
β”‚   β”‚   └── server.py             # Email MCP server (FastMCP)
β”‚   └── linkedin/
β”‚       └── server.py             # LinkedIn MCP server (FastMCP)
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ base_watcher.py           # Base class for all watchers
β”‚   β”œβ”€β”€ gmail_watcher.py          # Gmail monitoring
β”‚   β”œβ”€β”€ filesystem_watcher.py     # File drop monitoring
β”‚   β”œβ”€β”€ WhatsappWatcher           # WhatsApp Web monitoring
β”‚   β”œβ”€β”€ orchestrator.py           # Main coordinator + Ralph loop
β”‚   └── mcp-client.py             # MCP client helper
└── vault/                        # Obsidian vault
    β”œβ”€β”€ Dashboard.md              # Real-time status
    β”œβ”€β”€ Company_Handbook.md       # Rules of engagement
    β”œβ”€β”€ Business_Goals.md         # Objectives & metrics
    β”œβ”€β”€ Inbox/
    β”‚   └── Drop/                 # Drop files here for processing
    β”œβ”€β”€ Needs_Action/             # Items requiring processing
    β”œβ”€β”€ In_Progress/              # Claimed tasks
    β”œβ”€β”€ Pending_Approval/         # Human-in-the-loop approvals
    β”œβ”€β”€ Approved/                 # User-approved actions
    β”œβ”€β”€ Done/                     # Completed tasks
    β”œβ”€β”€ Plans/                    # Generated plans
    β”œβ”€β”€ Briefings/                # CEO briefing reports
    β”œβ”€β”€ Accounting/               # Transaction logs
    └── Logs/                     # System logs

πŸ”§ Configuration

Environment Variables

Create a .env file in the project root:

# ===========================================
# VAULT CONFIGURATION
# ===========================================
VAULT_PATH=./vault

# ===========================================
# OPERATION MODE
# ===========================================

# Dry Run Mode: Set to 'true' to test without real actions
# Set to 'false' for production use
DRY_RUN=false

# ===========================================
# GMAIL WATCHER (Optional)
# ===========================================

# Path to Gmail OAuth credentials (downloaded from Google Cloud Console)
# Get credentials from: https://developers.google.com/gmail/api/quickstart/python
GMAIL_CREDENTIALS_PATH=~/.gmail_watcher/credentials.json

# Path to Gmail OAuth token (auto-generated after first auth)
GMAIL_TOKEN_PATH=~/.gmail_watcher/token.json

# ===========================================
# WHATSAPP WATCHER
# ===========================================
WHATSAPP_SESSION_PATH=~/.digital_fte/sessions/whatsapp
CHECK_INTERVAL=30
WHATSAPP_KEYWORDS=urgent,asap,invoice,payment,help

# ===========================================
# LINKEDIN POSTING
# ===========================================
LINKEDIN_EMAIL=your.email@example.com
LINKEDIN_PASSWORD=your_password
PLAYWRIGHT_HEADLESS=true

# ===========================================
# ORCHESTRATOR
# ===========================================
MAX_ITERATIONS=10

πŸ“– Usage

Start Watchers

# Activate virtual environment first
.venv\Scripts\activate

# Start all watchers (runs in background)
uv run python -m Orchestrator.main start

# Start specific watchers
uv run python -m Orchestrator.main start --watchers filesystem whatsapp

# Start Gmail watcher (if configured)
uv run python -m GmailWatcher.main --vault ./vault

# Start filesystem watcher (monitors vault/Inbox/Drop)
uv run python -m FilesystemWatcher.main --vault ./vault

Start MCP Servers

# Start Email MCP server (stdio transport for Qwen Code)
uv run python mcp-servers/email/server.py

# Start LinkedIn MCP server (stdio transport for Qwen Code)
uv run python mcp-servers/linkedin/server.py

# Or with HTTP transport (for external access)
uv run python mcp-servers/email/server.py --transport http --port 8801
uv run python mcp-servers/linkedin/server.py --transport http --port 8802

Process with Qwen Code

# Interactive mode (requires approval for each action)
uv run python -m Orchestrator.main process

# Custom prompt
uv run python -m Orchestrator.main process --prompt "Review all pending approvals"


# Autonomous mode (YOLO - auto-approves all actions)
uv run python -m Orchestrator.main process --yolo


# Ralph Wiggum loop (autonomous multi-step processing)
uv run python -m Orchestrator.main ralph "Process all files in /Needs_Action"

Process Approved Actions

# Execute all approved actions (emails, LinkedIn posts)
uv run python -m Orchestrator.main process-approvals

Check Status

uv run python -m Orchestrator.main status

πŸ€– How It Works

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    DIGITAL FTE - SILVER TIER                    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  PERCEPTION (Watchers) β†’ REASONING (Qwen) β†’ ACTION (MCP)     β”‚
β”‚                                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”‚
β”‚  β”‚ Gmail Watcherβ”‚    β”‚             β”‚    β”‚ Email MCP    β”‚       β”‚
β”‚  β”‚ WhatsApp     │───▢│ Qwen Code │───▢│ LinkedIn MCP β”‚       β”‚
β”‚  β”‚ File Watcher β”‚    β”‚ (Brain)     β”‚    β”‚ (FastMCP)    β”‚       β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚
β”‚         β”‚                   β”‚                    β”‚              β”‚
β”‚         β–Ό                   β–Ό                    β–Ό              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”‚
β”‚  β”‚ /Needs_Actionβ”‚    β”‚ Plan.md     β”‚    β”‚ Human-in-    β”‚       β”‚
β”‚  β”‚ /Inbox       β”‚    β”‚ Dashboard.mdβ”‚    β”‚ the-Loop     β”‚       β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚
β”‚                                                                 β”‚
β”‚              Obsidian Vault (Memory/GUI)                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Workflow

  1. Watcher detects input (new email, WhatsApp message, file drop)
  2. Creates action file in /Needs_Action/ folder
  3. Orchestrator triggers Qwen Code to process
  4. Qwen reads Company_Handbook.md for rules
  5. Qwen creates plan in /Plans/ folder
  6. Qwen requests approval for sensitive actions (email, LinkedIn)
  7. Human reviews and moves files to /Approved/
  8. MCP server executes action (send email, post LinkedIn)
  9. Files moved to /Done/ and Dashboard updated

πŸ› οΈ MCP Servers

Email MCP Server

Built with FastMCP, provides:

  • send_email - Send emails via Gmail
  • draft_email - Create draft emails
  • search_emails - Search Gmail
  • get_email_content - Get full email content
  • mark_as_read - Mark emails as read

Start:

uv run python mcp-servers/email/server.py

LinkedIn MCP Server

Built with FastMCP + Playwright, provides:

  • create_post - Publish LinkedIn posts
  • create_draft_post - Create draft for approval
  • get_profile_info - Get profile information
  • close_session - Close browser session

Start:

uv run python mcp-servers/linkedin/server.py

βœ… Human-in-the-Loop Pattern

For sensitive actions, Qwen creates approval requests:

---
type: approval_request
action: email_send
to: client@example.com
subject: Invoice #123
created: 2026-01-07T10:30:00Z
status: pending
---

## Email Details
- **To:** client@example.com
- **Subject:** Invoice #123
- **Body:** Please find attached...

## To Approve
Move this file to /Approved folder.

## To Reject
Move this file to /Rejected folder.

Approval Flow:

  1. File created in /Pending_Approval/
  2. Human reviews content
  3. Move to /Approved/ to execute (or /Rejected/ to cancel)
  4. Orchestrator detects and calls MCP server
  5. Action executed, file moved to /Done/

One-line approval: Move the approval request file from /Pending_Approval/ to /Approved/ folder.


🎯 Silver Tier Checklist

  • Obsidian vault with proper folder structure
  • Dashboard.md tracking key metrics
  • Company Handbook defining rules
  • Multiple watchers operational (Gmail + WhatsApp + Filesystem)
  • Qwen Code successfully processing files
  • MCP servers built with FastMCP (Email + LinkedIn)
  • Human-in-the-loop workflow complete
  • Approval execution via MCP servers
  • Agent Skills documented

πŸ“ˆ Next Steps (Gold Tier)

  1. Odoo Accounting Integration - Self-hosted ERP via MCP
  2. Facebook/Instagram Integration - Social media posting
  3. Twitter (X) Integration - Tweet automation
  4. Weekly CEO Briefing - Autonomous business audit
  5. Error Recovery - Graceful degradation
  6. Comprehensive Audit Logging - Full action history

πŸ” Security

  • Secrets never sync: .env, tokens, credentials stay local
  • Dry run mode: Test without real actions
  • Approval workflow: Sensitive actions require human approval
  • Audit logging: All actions logged to /Logs/
  • Credential management: Use OS keychain for passwords

πŸ› Troubleshooting

Qwen Code not found

npm install -g @anthropic/qwen-code

# Verify installation
qwen --version

Qwen Code requires approval for every action

Problem: Qwen asks for approval before executing tools (write_file, run_shell_command, etc.)

Solution 1 - Use YOLO mode (full autonomy):

uv run python -m Orchestrator.main process --yolo

Solution 2 - Run interactively:

# Qwen will wait for your approval in the terminal
uv run python -m Orchestrator.main process 

Gmail API error

  • Ensure credentials.json is in ~/.gmail_watcher/
  • First run will auto-authenticate and create token.json
  • Check Google Cloud Console has Gmail API enabled

WhatsApp watcher not detecting messages

  • Check if QR code was scanned on WhatsApp Web
  • Verify WHATSAPP_SESSION_PATH exists
  • Set PLAYWRIGHT_HEADLESS=false to debug visually

MCP server not connecting

  • Check server is running: uv run python mcp-servers/email/server.py
  • Verify port is not in use
  • Check firewall settings
  • For Qwen Code integration, use stdio transport (default)

Files not being processed from Drop folder

  • Ensure filesystem watcher is running
  • Check file isn't already processed (hash is tracked)
  • Verify DRY_RUN=false in .env for actual processing

πŸ“š Documentation


🀝 Contributing

This is a hackathon project. Feel free to:

  • Fork and extend functionality
  • Add new watchers
  • Implement additional MCP servers
  • Improve documentation

πŸ“„ License

MIT License - See LICENSE file for details


πŸŽ“ Learning Resources


Built with ❀️ for the Digital FTE Hackathon 2026

Version: 0.2 (Silver Tier) | Last Updated: 2026-03-20

About

Personal AI agent that handles social media as well as any social media

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors