rm -rf node_modules package-lock.json npm install
Pipeline → PostgreSQL → Embeddings → RAG → Chat flow is now fully automated:
- ✅ All pipeline runs (Slack, Gmail, Notion) automatically generate embeddings
- ✅ Data synced to RAG in real-time (no manual steps)
- ✅ Idempotent updates (no duplicates, smart upserts)
- ✅ Works with or without pgvector (JSON fallback)
- ✅ All chat endpoints unified through AI Brain
- ✅ Projects tab connected to RAG for intelligent queries
The AI agent has access to dozens of comprehensive tools with all major API features including cross-platform project tracking:
Messages & Communication:
- List all channels (names, IDs, members, privacy)
- Get ALL messages from any channel
- Send messages to channels
- Update/edit existing messages
- Delete messages
- Search messages by keyword
- Summarize channel activity
- Get thread replies
File Management:
- Upload files to channels
- Share files with comments
Message Organization:
- Pin important messages
- Unpin messages
- Get all pinned messages in channel
- Add/remove emoji reactions
Channel Management:
- Create new channels (public/private)
- Archive channels
- Rename channels
- Set channel topic/purpose
- Invite users to channels
- Remove users from channels
- List channel members
User Management:
- List all workspace users
- Get user information (name, email, title, timezone)
- Check user presence status
🎯 COMPLETE Thread Support (NEW!):
- Get COMPLETE email threads - Retrieves ALL messages (no limit!)
- Perfect for long company email chains with 50+ messages
- Full body content for every message in thread
- Complete thread history and context
- Search email threads - Find conversations, not just messages
- Thread summaries - See message count and participants
Email Reading & Search:
- Get FULL email content (complete body, not snippets!)
- Get emails from specific senders
- Find emails by subject keywords
- Advanced search with ALL Gmail operators:
from:,to:,subject:,has:attachmentis:unread,is:starred,is:importantlabel:,after:,before:,filename:larger:,smaller:(size filters)
- Get exact unread email count
- Search all emails (basic keyword search)
Email Management:
- Send emails with full formatting
- List all labels/folders
- Mark emails as read/unread
- Archive emails (remove from inbox)
- Add labels to emails
- Get complete email threads
- Filter emails by labels
- (Plus 6 more - see TOOLS_CATALOG.md)
Page Operations:
- Create new pages (markdown supported)
- Update existing pages (titles, properties)
- Append content to existing pages
- Read full page content with blocks
- Delete pages
Workspace Features:
- Search entire workspace (pages and databases)
- List all pages in workspace
- Get page metadata and properties
- Query databases with filters
- Access workspace-level information
Content Management:
- Create and manage blocks
- Add comments to pages
- Update page properties
- Organize with databases
- Semantic Search: AI-powered search across ALL platforms simultaneously using sentence-transformers vector embeddings
Cross-Platform Project Management:
- Track Projects: Automatically aggregate project updates from Slack, Gmail, and Notion
- Searches all platforms for project-related content
- Identifies key points, action items, and blockers
- Calculates progress percentage
- Shows team member activity
- Generate Reports: Create comprehensive stakeholder-ready project reports
- Formatted ASCII reports with progress bars
- Statistics from all sources
- Organized sections (highlights, action items, blockers)
- Update Notion Pages: Automatically update existing Notion pages with project status
- UPDATES existing pages (doesn't create new ones)
- Formatted markdown with timestamps
- Appends latest project summary
- Includes team members and progress
Cross-Platform Utilities:
- Search All Platforms: Search Slack, Gmail, and Notion simultaneously
- Unified results from all sources
- One query, all platforms
- Team Activity Summary: See what any team member is working on
- Shows their Slack messages, emails, and Notion updates
- Cross-platform view of activity
- Slack Channel Analytics: Analyze channel engagement and patterns
- Message counts, active users, engagement metrics
- Sentiment analysis (positive, negative, questions)
- Activity trends and insights
Example Commands:
"Track the Q4 Dashboard project for the last 7 days"
"Generate a project report for Mobile App Redesign"
"Update Notion page abc123 with Agent Project status"
"Search all platforms for 'authentication'"
"What is Ivan working on?"
"Analyze the #engineering Slack channel"
- Multi-Tool Workflows: AI chains multiple actions automatically
- Example: "Get emails from john@company.com and save to Notion" → AI does both steps
- Conversation History: AI remembers previous messages in the session
- Natural Language: Just type what you want in plain English
- Live Data: Always fetches fresh data from APIs
- Streaming Responses: See results as they're generated
- Session Management: Create multiple conversations, switch between them - FIXED Nov 2025!
- File Upload: Drag & drop files, image previews, multi-file support - NEW Nov 2025!
- Quick Actions: One-click templates for common tasks
- Workflow Templates: Pre-built multi-step automations
- Single Source of Truth: All data synced to PostgreSQL with pgvector
- ✨ gpt-5-nano: Upgraded to latest OpenAI lightweight reasoning model (optimized for speed & cost)
- 🎯 PROJECT TRACKING: Cross-platform project management! (6 NEW TOOLS)
- Track projects across Slack, Gmail, and Notion automatically
- Generate stakeholder-ready reports
- Auto-update Notion pages with project status
- Team activity summaries
- Channel analytics
- Cross-platform search
- 🛠️ 26+ NEW TOOLS: Comprehensive API coverage (50+ total tools active)
- Slack: File uploads, pins, channel management, user management
- Gmail: Full email bodies, advanced search, unread count, all operators
- Notion: Update pages, append content, workspace search
- 🎨 Fixed Chat History: Sessions now persist properly, switch without losing messages
- 📎 File Upload: Drag & drop interface with image previews (client-side validation)
- 🗑️ Removed Right Sidebar: Cleaner, more focused UI
- 🔧 Improved RAG Reliability: Vector search now uses sentence-transformers embeddings with correct dimensions
- ✅ Extensive Test Coverage: Core tools and integrations covered by Slack, Gmail, Notion, and project test suites
📖 View Complete Tool Catalog - Detailed documentation of all 50+ tools
Windows:
Mac:
# Install Homebrew if you don't have it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Python
brew install python@3.12
# Install Node.js
brew install node
# Install PostgreSQL
brew install postgresql@14
brew services start postgresql@14Windows (Command Prompt):
git clone https://github.com/yourusername/Workforce-agent.git
cd Workforce-agentMac (Terminal):
git clone https://github.com/yourusername/Workforce-agent.git
cd Workforce-agentWindows:
pip install -r requirements.txtMac:
pip3 install -r requirements.txtBoth Windows & Mac:
cd frontend
npm install
cd ..Windows (Command Prompt):
createdb workforce_agentMac (Terminal):
createdb workforce_agentCopy the example environment file:
Windows:
copy .env.example .envMac:
cp .env.example .envThen edit .env file and add your API keys:
# Required
OPENAI_API_KEY=sk-your-openai-key-here
SLACK_BOT_TOKEN=xoxb-your-slack-bot-token
SLACK_APP_TOKEN=xapp-your-slack-app-token
# Notion (optional)
NOTION_TOKEN=secret_your-notion-key
NOTION_PARENT_PAGE_ID=your-page-id
# Google OAuth (for login + per-user Gmail access)
GOOGLE_CLIENT_ID=your-google-oauth-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-google-oauth-client-secret
GOOGLE_OAUTH_REDIRECT_BASE=http://localhost:8000
FRONTEND_BASE_URL=http://localhost:5173
SESSION_SECRET=change-me-to-a-long-random-string
# Database
DATABASE_URL=postgresql://localhost:5432/workforce_agent- Go to https://platform.openai.com/api-keys
- Click "Create new secret key"
- Copy the key (starts with
sk-) - Add to
.envasOPENAI_API_KEY
- Go to https://api.slack.com/apps
- Click "Create New App" → "From scratch"
- Name it "Workforce Agent", select your workspace
- Go to "OAuth & Permissions"
- Add scopes:
channels:history,channels:read,chat:write,users:read
- Add scopes:
- Go to "Socket Mode" → Enable it
- Generate app token (starts with
xapp-) - Add to
.envasSLACK_APP_TOKEN
- Generate app token (starts with
- Install app to workspace
- Copy Bot User OAuth Token (starts with
xoxb-) - Add to
.envasSLACK_BOT_TOKEN
- Copy Bot User OAuth Token (starts with
Full setup guide: See Documentation/api_guide.md
- Go to https://console.cloud.google.com/
- Create a project (or use an existing one)
- Enable Gmail API
- Create OAuth 2.0 Web application client
- Add authorized redirect URI:
http://localhost:8000/auth/google/callback - Copy the client ID and secret into
.envasGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET
After configuring, start the backend and frontend, open the app, and click "Continue with Google" to sign in and grant Gmail access.
Full setup guide: See Documentation/Auth_plan.md
- Go to https://www.notion.so/my-integrations
- Create new integration
- Copy token (starts with
secret_) - Share a Notion page with the integration
- Copy page ID from URL
- Add both to
.env
Full setup guide: See Documentation/api_guide.md
Mac/Linux:
./START_SERVERS.shWindows:
# Start backend
cd backend
uvicorn api.main:app --reload --host 0.0.0.0 --port 8000
# In another terminal, start frontend
cd frontend
npm run devTerminal 1 - Backend:
cd backend
uvicorn api.main:app --reload --host 0.0.0.0 --port 8000Terminal 2 - Frontend:
cd frontend
npm run devOpen your browser to: http://localhost:5173
Once the backend and frontend are running, you can explore structured data via the Pipelines tab in the UI:
-
Where to find it:
- Open the web app at
http://localhost:5173. - Switch from the chat view to the Pipelines view.
- Use the small source switcher in the bottom-left to toggle between Slack, Gmail, and Notion pipelines.
- Open the web app at
-
Slack Pipeline:
- Click Run Slack Pipeline to sync your Slack workspace (users, channels, messages, files) into PostgreSQL.
- Left panel shows channels with message counts and basic stats.
- Selecting a channel loads recent messages, grouped by thread with root messages and replies.
-
Gmail Pipeline:
- Choose a Gmail label from the dropdown (e.g.
INBOX,Datasaur, etc.). - Click Run Gmail Pipeline to incrementally sync new emails for that label into the database.
- The Gmail Messages panel shows an accordion list:
- Header:
from -> recipients · subjectwith sent date. - Body: full HTML or text content when expanded.
- Header:
- Choose a Gmail label from the dropdown (e.g.
-
Notion Pipeline:
- Click Run Notion Pipeline to sync pages and databases visible to your integration using
NOTION_TOKEN. - The Notion Pages view shows your workspace name and a nested accordion of pages and subpages.
- Expanding a page shows:
- Page properties (Gmail-like info panel).
- Actual page content (text blocks) and any file/image/pdf/video attachments.
- Click Run Notion Pipeline to sync pages and databases visible to your integration using
Try these in the chat interface:
"Get all slack channel names"
"Show me messages from #social"
"Send a message to #team saying 'Hello everyone'"
"Get user info for U12345678"
"Summarize what happened in #engineering today"
"Get emails from john@company.com"
"Find emails with subject 'project'"
"Show me unread emails"
"Create a Notion page titled 'Meeting Notes'"
"List all my Notion pages"
"Get messages from #social and save them to Notion"
"Find emails about 'budget' and summarize them"
"Get all channels and list their members"
- Check Python version:
python --version(needs 3.10+) - Install dependencies:
pip install -r requirements.txt - Check database:
psql -l(should seeworkforce_agent)
- Check Node version:
node --version(needs 18+) - Install dependencies:
cd frontend && npm install - Check port 5173 is free:
lsof -i:5173
- Check
.envfile hasSLACK_BOT_TOKENstarting withxoxb- - Check
SLACK_APP_TOKENstarting withxapp- - Restart backend after adding keys
- Run first-time authentication:
cd backend && python -m core.gmail.extractor - Browser should open for OAuth
- After authentication, restart backend
Windows:
netstat -ano | findstr :8000
taskkill /PID <PID> /FMac:
lsof -ti:8000 | xargs kill -9
lsof -ti:5173 | xargs kill -9Workforce-agent/
├── backend/
│ ├── agent/ # AI brain, RAG engine & tools
│ │ ├── ai_brain.py # gpt-5-nano + multi-tool logic
│ │ ├── hybrid_rag.py # Hybrid RAG over Slack, Gmail, Notion
│ │ ├── sentence_transformer_engine.py # sentence-transformers embedding & reranker
│ │ └── langchain_tools.py # Slack/Gmail/Notion/project tools
│ ├── api/ # FastAPI server
│ │ └── main.py # REST & WebSocket endpoints
│ ├── core/ # Config, DB models, and API integrations
│ │ ├── config.py # Config & env loading
│ │ ├── database/ # PostgreSQL models
│ │ ├── slack/ # Slack API
│ │ ├── gmail/ # Gmail API
│ │ ├── notion_export/ # Notion API
│ │ └── cli/ # CLI used by top-level main.py
│ ├── scripts/ # Helper & maintenance scripts
│ ├── test_all_apis.py # API permission test script
│ ├── test_comprehensive_tools.py # All tools test suite
│ └── test_new_tools.py # New tools test suite
├── test-files/ # Legacy end-to-end Slack/Gmail/Notion tests
├── frontend/ # React UI
│ └── src/
│ └── components/ # Chat interface & pipelines views
├── data/ # Local data (Gmail token, exports, files)
├── Documentation/ # Full API setup guides
├── .env # Your API keys (create this)
├── .env.example # Template
├── START_SERVERS.sh # Mac/Linux startup
└── STOP_SERVERS.sh # Shutdown script
- 📖 Complete Tool Catalog - All Slack, Gmail, Notion, workspace, and project tools with examples
- 🔑 API Setup Guide - Step-by-step API configuration
- ⚡ API Endpoints - Interactive API docs (when running)
-
Check logs:
- Backend:
tail -f logs/backend.log - Frontend: Check browser console (F12)
- Backend:
-
Test API connection:
curl http://localhost:8000/health
-
Restart everything:
- Stop:
./STOP_SERVERS.sh(Mac) or close terminals (Windows) - Start:
./START_SERVERS.sh(Mac) or manual start (Windows)
- Stop:
- Latest AI Model: gpt-5-nano (Nov 2025) - fast, cost-efficient reasoning with tools
- Single Source of Truth: PostgreSQL with pgvector stores all cross-platform data
- Hybrid Interface: Chatbot UX + AI agent automation in one
- Smart AI: Automatically selects and chains tools
- RAG-Powered: Semantic search across all platforms using sentence-transformers embeddings (dimension depends on configured model)
- Multi-Tool Workflows: Complex automations handled automatically
- Natural Language: No commands to memorize
- Production Ready: Robust error handling, auto-reconnection, streaming responses
MIT License - See LICENSE file
Made with ❤️ | Built for productivity | Powered by gpt-5-nano (Nov 2025)