Back to Omi

šŸš€ OMI Slack App - Setup Complete!

plugins/omi-slack-app/SETUP.md

3.0.0-Android-App6.6 KB
Original Source

šŸš€ OMI Slack App - Setup Complete!

āœ… What's Been Created

I've built a complete Slack messaging app for OMI with the following features:

Core Functionality

  • Voice-activated Slack messaging - Say "Send message to [channel] saying [message]"
  • AI-powered channel matching - Fuzzy matches spoken channel names to your workspace
  • Smart message extraction - Cleans up filler words and formats messages
  • OAuth 2.0 integration - Secure Slack workspace authentication
  • Mobile-first UI - Beautiful Slack-themed interface
  • Channel management - Set default channel or specify in voice

Files Created

slack/
ā”œā”€ā”€ main.py                  # FastAPI app with all endpoints
ā”œā”€ā”€ slack_client.py          # Slack API integration
ā”œā”€ā”€ message_detector.py      # AI channel matching & message extraction
ā”œā”€ā”€ simple_storage.py        # File-based storage
ā”œā”€ā”€ requirements.txt         # Python dependencies
ā”œā”€ā”€ .env.example            # Environment template
ā”œā”€ā”€ .gitignore             # Git ignore rules
ā”œā”€ā”€ README.md              # Full documentation
ā”œā”€ā”€ LICENSE                # MIT License
ā”œā”€ā”€ Procfile               # Deployment config
ā”œā”€ā”€ railway.toml           # Railway config
└── runtime.txt            # Python version

šŸ”§ Next Steps

1. Push to GitHub

The git repository is initialized and committed, but needs your credentials to push:

bash
cd /Users/aaravgarg/omi-ai/Code/apps/slack
git push -u origin main

If you need to authenticate, you can use:

  • Personal Access Token (recommended)
  • SSH key
  • GitHub CLI (gh auth login)

2. Set Up Slack App

  1. Go to https://api.slack.com/apps
  2. Click "Create New App" → "From scratch"
  3. Enter name: "OMI Voice Messenger" (or your choice)
  4. Select your workspace
  5. Navigate to OAuth & Permissions
  6. Add these Scopes:
    • channels:read - View public channels
    • chat:write - Send messages
    • groups:read - View private channels
    • users:read - View user info
  7. Add Redirect URL: http://localhost:8000/auth/callback (for local testing)
  8. Copy Client ID and Client Secret

3. Configure Environment

bash
cd /Users/aaravgarg/omi-ai/Code/apps/slack
cp .env.example .env

Edit .env with your credentials:

env
SLACK_CLIENT_ID=your_client_id_here
SLACK_CLIENT_SECRET=your_client_secret_here
OPENAI_API_KEY=your_openai_key_here
OAUTH_REDIRECT_URL=http://localhost:8000/auth/callback
APP_HOST=0.0.0.0
APP_PORT=8000

4. Install Dependencies

bash
# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

5. Run Locally

bash
python main.py

Then visit:

6. Deploy to Railway

  1. Push to GitHub (step 1 above)
  2. Go to https://railway.app
  3. Click "New Project" → "Deploy from GitHub"
  4. Select omi-slack-app repository
  5. Add environment variables (from .env)
  6. Get your Railway URL (e.g., your-app.up.railway.app)
  7. Update in Slack app settings:
    • Redirect URL: https://your-app.up.railway.app/auth/callback

7. Configure OMI

In your OMI app settings, use:

  • Webhook URL: https://your-app.up.railway.app/webhook
  • App Home URL: https://your-app.up.railway.app/
  • Auth URL: https://your-app.up.railway.app/auth
  • Setup Check URL: https://your-app.up.railway.app/setup-completed

šŸŽ¤ How to Use

Voice Commands

With channel specified:

"Send message to general saying hello team!"
"Post in marketing that the campaign is live"
"Slack message to random saying great idea!"

Using default channel:

"Send message saying quick update for everyone"

The Process

  1. Trigger detected - "Send message to [channel]"
  2. Collect 3 segments - (~10-15 seconds of speech)
  3. AI extracts:
    • Channel name (fuzzy matched)
    • Message content (cleaned)
  4. Post to Slack - Message sent!
  5. Notification - "āœ… Message sent to #general: [message]"

🧠 AI Features

Channel Matching

AI intelligently matches spoken channel names:

  • "general" → #general āœ…
  • "the marketing channel" → #marketing āœ…
  • "random stuff" → #random āœ…
  • Handles pronunciation variations
  • Fuzzy matching for imperfect transcriptions

Message Cleaning

  • Removes filler words (um, uh, like)
  • Fixes grammar and capitalization
  • Formats professionally
  • Preserves meaning and tone

šŸ“ Architecture Overview

Similar to GitHub/Twitter apps but customized for Slack:

Voice Input (OMI)
    ↓
Webhook Endpoint (/webhook)
    ↓
Trigger Detection ("Send message")
    ↓
Segment Collection (3 segments)
    ↓
AI Processing:
  - Extract channel name
  - Extract message content
  - Match to workspace channels
    ↓
Slack API (Post Message)
    ↓
User Notification āœ…

šŸ”‘ Key Differences from GitHub/Twitter Apps

  1. Channel Selection - User can specify channel in voice OR use default
  2. AI Channel Matching - Fuzzy matches spoken names to workspace channels
  3. Dual Mode - Works with or without default channel set
  4. 3 Segments - Balanced for channel + message extraction
  5. Slack OAuth - Different from GitHub/Twitter OAuth flow
  6. Real-time Channels - Fetches and updates channel list dynamically

šŸ“Š Technical Details

  • Framework: FastAPI
  • AI: OpenAI GPT-4o for channel matching & extraction
  • Storage: File-based with Railway persistence (/app/data)
  • OAuth: Slack OAuth 2.0
  • Deployment: Railway (recommended)
  • Python: 3.10.17

šŸ› Common Issues & Solutions

"Channel not found"

→ Click "Refresh Channels" in settings → Speak channel name more clearly → Set as default channel

"No default channel set"

→ Visit homepage and select a default → OR always specify channel in voice

"Authentication failed"

→ Verify Slack app credentials → Check redirect URL matches exactly → Ensure all required scopes are added

✨ What Makes This Special

  1. Smart Channel Detection - No need to perfectly pronounce channel names
  2. Flexible Usage - Works with or without defaults
  3. Voice-First - Designed specifically for voice interaction
  4. AI-Powered - Intelligent extraction and formatting
  5. Production-Ready - Full error handling and logging

šŸŽ‰ You're All Set!

The app is complete and ready to use. Just:

  1. Push to GitHub (with your credentials)
  2. Set up Slack app
  3. Configure environment
  4. Run locally or deploy to Railway
  5. Connect to OMI

Happy voice messaging! šŸ’¬āœØ