Thanks to visit codestin.com
Credit goes to github.com

Skip to content

sturzael/elliotos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ElliotOS ๐Ÿค–

Your Personal AI Assistant powered by Ollama

ElliotOS is a comprehensive local AI assistant that integrates with multiple data sources to provide intelligent morning and evening summaries via Slack. It combines data from your calendar, emails, health metrics, productivity stats, news, and more to give you personalized insights and recommendations.

ElliotOS Demo Python Ollama Slack

๐ŸŒŸ What ElliotOS Does

ElliotOS automatically generates personalized daily summaries by:

  1. ๐Ÿ”„ Collecting Data from 8+ sources (health, productivity, news, sports, etc.)
  2. ๐Ÿง  AI Processing with local Ollama (privacy-first) or cloud AI fallbacks
  3. ๐Ÿ“ฑ Slack Delivery of beautiful morning and evening digests
  4. ๐Ÿ“Š Smart Insights based on your actual usage patterns and data

๐ŸŒ… Morning Digest Example

  • Current time and personalized greeting
  • Today's calendar events (if configured)
  • Health check (sleep quality, fitness goals)
  • Current productivity status
  • Chelsea FC updates
  • World news headlines
  • Daily focus recommendations
  • Motivational insights

๐ŸŒ™ Evening Digest Example

  • Reflection on the day's activities
  • Productivity and health summary
  • Tomorrow's preview
  • Wellness check and rest recommendations
  • Sports and news recap
  • Positive insights to end the day

โœจ Key Features

๐Ÿ”’ Privacy-First Design

  • Local AI processing with Ollama (no data leaves your machine)
  • Optional cloud fallbacks (OpenAI/Anthropic) only if you configure them
  • Secure credential storage in environment variables
  • No tracking or analytics unless you enable them

๐Ÿ“Š Data Sources

  • ๐ŸŽ Apple Health/HealthKit: Steps, sleep, activity rings, workouts
  • ๐Ÿ’ป macOS System Stats: App usage, productivity metrics, system health
  • ๐Ÿ“… Google Calendar: Events, meetings, scheduling conflicts
  • ๐Ÿ“ง Gmail: Unread emails, important messages, mentions
  • ๐Ÿ’ฌ Slack: Messages, mentions, team activity across workspaces
  • ๐Ÿฅ— MyFitnessPal: Nutrition tracking, calories, meal logging
  • ๐Ÿ“ฐ News APIs: World headlines, tech news, trending topics
  • โšฝ Chelsea FC: Match results, fixtures, team news, league position

๐Ÿค– AI Integration

  • Primary: Ollama (local, private, fast)
  • Fallback 1: OpenAI GPT (if configured)
  • Fallback 2: Anthropic Claude (if configured)
  • Fallback 3: Template responses (always works)

๐Ÿš€ Quick Start

Prerequisites

  • macOS (for full functionality - some features work on other platforms)
  • Python 3.8+
  • Ollama installed and running locally
  • Slack workspace with webhook or bot permissions

1. Installation

# Clone the repository
git clone <your-repo-url>
cd elliotos

# Run the setup script (installs dependencies and creates directories)
python3 setup.py

# Or install manually:
pip3 install -r requirements.txt

2. Install and Setup Ollama

# Install Ollama (if not already installed)
curl -fsSL https://ollama.ai/install.sh | sh

# Pull a recommended model
ollama pull mistral:latest
# OR
ollama pull llama3.1:8b

# Start Ollama (keep running in background)
ollama serve

3. Configure Environment Variables

Copy the example environment file and edit it:

cp env.example .env
nano .env  # or use your preferred editor

Minimum required configuration:

# Ollama Configuration
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=mistral:latest

# Slack Configuration (choose one method)
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
# OR
SLACK_BOT_TOKENS=xoxb-your-bot-token

SLACK_SUMMARY_CHANNEL=#elliot-daily

# Schedule
MORNING_DIGEST_TIME=07:00
EVENING_DIGEST_TIME=21:00

4. Test the System

# Test data collection
python3 main.py --test-data

# Test Slack connection
python3 main.py --test-slack

# Test morning digest
python3 main.py --test-morning

# Check system status
python3 main.py --status

5. Run ElliotOS

# Start the scheduler (runs continuously)
python3 main.py

# Or run in background
nohup python3 main.py > elliotos.log 2>&1 &

โš™๏ธ Configuration Guide

๐Ÿ“ Configuration Files

File Purpose Location
.env Main configuration Root directory
config/settings.py Settings validation Auto-loaded
logs/ Daily log files Auto-created
data/ Cached tokens/data Auto-created

๐Ÿ”ง Environment Variables

Essential Settings

# Ollama (Required)
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=mistral:latest  # or llama3.1:8b

# Slack (Required - choose one)
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/T.../B.../...
SLACK_BOT_TOKENS=xoxb-your-bot-token
SLACK_SUMMARY_CHANNEL=#elliot-daily

# Schedule (Required)
MORNING_DIGEST_TIME=07:00
EVENING_DIGEST_TIME=21:00
TIMEZONE=America/New_York

Optional Integrations

# Google Services
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
[email protected],[email protected]

# Health & Fitness
[email protected]
MYFITNESSPAL_PASSWORD=your_password
APPLE_HEALTH_ENABLED=true

# News & Sports
NEWS_API_KEY=your_newsapi_key
CHELSEA_FC_ENABLED=true
FOOTBALL_API_KEY=your_football_api_key

# Backup AI Services
OPENAI_API_KEY=your_openai_key
ANTHROPIC_API_KEY=your_anthropic_key

# Advanced Features
GITHUB_TOKEN=your_github_token
READWISE_TOKEN=your_readwise_token
NOTION_TOKEN=your_notion_token

System Settings

# Application Settings
LOG_LEVEL=INFO
DATA_RETENTION_DAYS=30
ENABLE_ANALYTICS=true
ENABLE_WEB_DASHBOARD=false

# macOS Features
MACOS_SCREEN_TIME_ENABLED=true
MACOS_APP_USAGE_ENABLED=true

๐Ÿ”— Integration Setup

๐Ÿ“ฑ Slack Integration

Option 1: Webhook (Easiest)

  1. Go to your Slack workspace settings
  2. Create a new webhook for your channel
  3. Add SLACK_WEBHOOK_URL to .env

Option 2: Bot Token (More Features)

  1. Create a Slack app at api.slack.com
  2. Add bot token scopes: chat:write, channels:read, users:read
  3. Install the app to your workspace
  4. Add SLACK_BOT_TOKENS to .env

๐Ÿ“… Google Calendar & Gmail

  1. Create Google Cloud Project:

  2. Create OAuth Credentials:

    • Go to "Credentials" โ†’ "Create Credentials" โ†’ "OAuth 2.0 Client IDs"
    • Application type: "Desktop application"
    • Download the JSON file
  3. Configure Environment:

    GOOGLE_CLIENT_ID=your_client_id
    GOOGLE_CLIENT_SECRET=your_client_secret
    [email protected]

๐Ÿ“ฐ News Integration

  1. Get a free API key from NewsAPI.org
  2. Add to .env:
    NEWS_API_KEY=your_newsapi_key

๐ŸŽ Health Data (macOS)

ElliotOS automatically integrates with:

  • Apple Health (via HealthKit framework)
  • macOS Screen Time (via system APIs)
  • Activity Monitor (for app usage tracking)

No additional setup required on macOS.

๐ŸŽฎ Usage

Command Line Options

# Run scheduled digests
python3 main.py

# Test individual components
python3 main.py --test-morning     # Test morning digest
python3 main.py --test-evening     # Test evening digest
python3 main.py --test-data        # Test data aggregation
python3 main.py --test-slack       # Test Slack connection

# System information
python3 main.py --status           # Show system status

Manual Testing

# Test individual modules
python3 backend/fetch_calendar.py
python3 backend/fetch_health.py
python3 backend/fetch_slack.py

# Test data aggregation
python3 data_aggregator.py

# Test Slack bot
python3 -c "from slack_bot.bot import slack_bot; slack_bot.post_custom_message('Test message')"

๐Ÿ“ Project Structure

elliotos/
โ”œโ”€โ”€ backend/                 # Data fetching modules
โ”‚   โ”œโ”€โ”€ fetch_calendar.py   # Google Calendar integration
โ”‚   โ”œโ”€โ”€ fetch_gmail.py      # Gmail integration
โ”‚   โ”œโ”€โ”€ fetch_slack.py      # Slack integration
โ”‚   โ”œโ”€โ”€ fetch_health.py     # Apple Health integration
โ”‚   โ”œโ”€โ”€ fetch_mac_stats.py  # macOS system stats
โ”‚   โ”œโ”€โ”€ fetch_nutrition.py  # MyFitnessPal integration
โ”‚   โ”œโ”€โ”€ fetch_news.py       # News aggregation
โ”‚   โ”œโ”€โ”€ fetch_chelsea.py    # Chelsea FC data
โ”‚   โ””โ”€โ”€ ollama_client.py    # AI integration
โ”œโ”€โ”€ slack_bot/              # Slack integration
โ”‚   โ””โ”€โ”€ bot.py             # Slack bot implementation
โ”œโ”€โ”€ config/                 # Configuration management
โ”‚   โ””โ”€โ”€ settings.py        # Settings and validation
โ”œโ”€โ”€ utils/                  # Utilities
โ”‚   โ””โ”€โ”€ logger.py          # Logging system
โ”œโ”€โ”€ logs/                   # Daily log files
โ”œโ”€โ”€ data/                   # Cached data and tokens
โ”œโ”€โ”€ data_aggregator.py      # Data aggregation engine
โ”œโ”€โ”€ main.py                # Main orchestrator
โ”œโ”€โ”€ setup.py               # Setup script
โ”œโ”€โ”€ requirements.txt        # Python dependencies
โ”œโ”€โ”€ .env                   # Your configuration (create from env.example)
โ””โ”€โ”€ README.md              # This file

๐Ÿ” Troubleshooting

Common Issues

1. Ollama Connection Failed

# Check if Ollama is running
curl http://localhost:11434/api/tags

# Start Ollama if needed
ollama serve

# Pull the model if missing
ollama pull mistral:latest

2. Slack Messages Not Posting

# Test Slack connection
python3 main.py --test-slack

# Check webhook URL or bot token in .env
# Verify channel permissions

3. Environment Variables Not Loading

# Ensure .env file exists (not env)
ls -la .env

# Check file format (one variable per line)
cat .env | head -5

# Verify no extra spaces or characters

4. Google APIs Not Working

# Check credentials in .env file
# Verify APIs are enabled in Google Cloud Console
# Check OAuth consent screen configuration

5. Health Data Not Available

# Ensure running on macOS
# Check privacy permissions in System Preferences
# Verify HealthKit access if using Apple Health

Debug Mode

Enable detailed logging:

LOG_LEVEL=DEBUG python3 main.py

Check log files:

tail -f logs/elliotos_$(date +%Y%m%d).log

๐Ÿ”„ Automation

Run as Service (macOS)

Create a LaunchAgent:

# Create service file
cat > ~/Library/LaunchAgents/com.elliotos.plist << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.elliotos</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/python3</string>
        <string>/path/to/elliotos/main.py</string>
    </array>
    <key>WorkingDirectory</key>
    <string>/path/to/elliotos</string>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
</dict>
</plist>
EOF

# Load the service
launchctl load ~/Library/LaunchAgents/com.elliotos.plist

Docker Deployment

FROM python:3.11-slim

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .

CMD ["python", "main.py"]

๐Ÿ›ก๏ธ Privacy & Security

  • Local Processing: All AI processing happens locally via Ollama
  • Secure Storage: Credentials stored in environment variables
  • Data Retention: Configurable data retention policies
  • Privacy First: Health and personal data never leaves your machine
  • Optional Cloud: Only uses cloud APIs you explicitly configure

๐Ÿ“Š Feature Status

Feature Status Configuration Required
๐Ÿค– AI Processing โœ… Working Ollama setup
๐Ÿ“ฑ Slack Integration โœ… Working Webhook or bot token
๐Ÿ’ป macOS Stats โœ… Working None (automatic)
๐ŸŽ Apple Health โœ… Working None (automatic on macOS)
โšฝ Chelsea FC โœ… Working None (uses mock data)
๐Ÿ“ฐ News โš ๏ธ Mock Data NewsAPI key for real data
๐Ÿ“… Google Calendar โš ๏ธ Optional Google API credentials
๐Ÿ“ง Gmail โš ๏ธ Optional Google API credentials
๐Ÿฅ— MyFitnessPal โš ๏ธ Optional Login credentials
๐Ÿ’ฌ Slack Messages โš ๏ธ Limited Proper bot tokens

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Submit a pull request

Development Setup

# Install development dependencies
pip install -r requirements.txt
pip install pytest black flake8

# Run tests
pytest tests/

# Format code
black .

# Lint code
flake8 .

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Ollama for local AI inference
  • Slack for communication platform
  • Google for Calendar and Gmail APIs
  • Apple for HealthKit and macOS integration
  • NewsAPI for news aggregation
  • Football-Data.org for sports data

ElliotOS - Your personal AI assistant that respects your privacy while keeping you informed and productive. ๐Ÿš€

๐Ÿ“ž Support

If you encounter issues:

  1. Check the troubleshooting section above
  2. Review the logs in logs/elliotos_YYYYMMDD.log
  3. Test individual components with --test-* flags
  4. Ensure all required environment variables are set

For questions or feature requests, please open an issue in the repository.

About

vibe coding myself an ai agent

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages