Author: Google Gemini 3 Pro (Preview) Date: 2026-01-28 Status: Proposal
This document outlines the comprehensive plan to transform Moltbot from a self-hosted developer tool into a mass-market cloud messaging product.
We will decompose the monolithic daemon into a scalable, event-driven microservices architecture.
-
Gateway Service (The Hub)
- Role: Replaces the local WebSocket server. Manages persistent WebSocket connections from Client Apps (Mobile/Desktop) and Bridge Nodes (User's Mac/PC).
- Tech: Node.js/Bun with
wsor Go. Scaled horizontally with a Redis adapter for broadcast distribution. - Protocol: Retains the existing JSON schema-validated WebSocket protocol but adds authentication (JWT) and routing logic.
-
API Service
- Role: REST/RPC API for onboarding, configuration, billing, and history queries.
- Tech: Hono or Express (migrated from current
server-http.ts). - Auth: Clerk, Auth0, or Supabase Auth for robust user management.
-
Channel Workers (The Limbs)
- Cloud-Native Fleet: Stateless workers handling "Easy" channels (Telegram, Discord, Slack, MS Teams).
- Ingress: HTTP endpoints for Webhooks (Slack Events, Telegram Webhooks).
- Egress: Queue consumers (Redis/SQS) picking up "Send Message" jobs.
- Bridge Routing: Logic to route messages for "Hard" channels (iMessage, WhatsApp) to the specific user's connected Bridge Node (see below).
- Cloud-Native Fleet: Stateless workers handling "Easy" channels (Telegram, Discord, Slack, MS Teams).
-
AI Agent Worker (The Brain)
- Role: Decoupled execution of the "Pi" agent.
- Trigger: Listens to
message.receivedevents. - State: Loads session history from DB + Vector Search from Cloud Vector DB.
- Tech: Python or Node.js wrapper around
pi-agent-core.
We migrate from filesystem (JSONL/YAML) to structured cloud data.
- Primary DB (Postgres):
Users: ID, email, subscription tier.Tenants/Teams: Grouping users (for B2B expansion).Channels: Configs (tokens, webhooks) encrypted at rest.Sessions: Conversation metadata (replacessessions.json).Messages: High-volume storage. Partitioned by Time or Tenant.
- Vector DB (pgvector / Pinecone):
- Replaces local
sqlite-vec. Stores embeddings of message history for long-term agent memory.
- Replaces local
- Blob Storage (S3):
- Stores images, voice notes, and attachments.
- Cache/Queue (Redis):
- Real-time event pub/sub.
- Job queues for message delivery and AI processing.
- Client subscriptions: WebSocket connections to Gateway Service subscribe to tenant-scoped event streams.
- Internal eventing: Redis Pub/Sub (Phase 1) graduating to NATS JetStream or Kafka (Phase 2+) as throughput grows.
- Event types:
message.received,message.sent,message.delivery_updated,channel.status_changed,agent.run_started,agent.run_completed. - Resume capability: Events carry monotonic sequence IDs; clients reconnect with
since_seqto catch up on missed events.
- Upload flow: Client requests presigned S3 URL, uploads directly, webhook notifies API of completion.
- Processing: Lambda/Cloud Function pipeline for thumbnails, waveforms, virus scanning.
- Delivery: CloudFront signed URLs with tenant-scoped access policies.
- Retention: Free tier = 30 days, Pro = 1 year, Team = unlimited.
- Stateless job execution: Each
message.receivedevent triggers an agent job via queue. - Context assembly: Pull recent messages from Postgres + relevant embeddings from pgvector.
- Budgeted prompting: Per-plan token limits enforced before API call.
- Tool sandbox: Capability-based tool execution with per-tenant allowlists.
- Cost tracking: Every run records
tokens_in,tokens_out,cost_usdfor billing.
The goal is "Zero to Hero" in < 2 minutes without touching a terminal.
- Web Signup: User visits
moltbot.com, signs up with Google/Apple. - Instant Value (Cloud Channels):
- "Connect Telegram": User enters Bot Token (or clicks "Auth" for Discord/Slack).
- Result: Immediately functional. They can chat with the bot via the web UI.
- The "Bridge" (Optional Power Move):
- Prompt: "Want iMessage or WhatsApp?"
- Action: Download
Moltbot Bridgeapp (Mac/Windows) or runcurl -sSL https://molt.bot/install | bash. - Pairing: Run app -> It displays a QR code. User scans with Mobile App OR enters a code on the Web Dashboard.
- Result: The local daemon starts in "Bridge Mode" (headless), strictly forwarding traffic to the Cloud Gateway.
- No Config Files: Config is stored in Postgres. The Bridge Node pulls its config (allowlists, etc.) from the cloud on connection.
- Hosted Agent: User doesn't need to configure LLM keys. We resell access (or allow BYO Key on Pro tier).
- Token-based (Telegram): Paste bot token -> validate -> connected in 30 seconds.
- OAuth (Discord, Slack, MS Teams): Click "Connect" -> OAuth popup -> authorize -> connected in 2 clicks.
- QR-based (WhatsApp Web): Click "Connect WhatsApp" -> QR appears in dashboard -> scan with phone -> connected.
- Device pairing (iMessage): Click "Connect iMessage" -> get pairing code -> enter in Mac app -> WSS tunnel established.
- Free: 1 cloud channel, 30-day retention, basic AI. No bridge channels.
- Paid: Unlock bridge channels, unlimited history, premium AI models, BYOK option.
- Upsell moments: Adding second channel, enabling AI, connecting iMessage/WhatsApp.
- Before: Connect to local IP/Tailscale.
- After: Hardcoded to connect to
wss://api.moltbot.com/gateway. - Auth: Login screen (OIDC) instead of "Enter Gateway Address".
- Push Notifications: Centralized APNS/FCM service triggered by the Cloud Gateway.
- Feature parity: Unified inbox, conversation view, real-time streaming, media sharing.
- Split Personality:
- Client Mode: A rich UI for chatting, viewing conversations, managing settings.
- Bridge Mode: A background helper that runs the
imessageorwhatsappadapters.
- UI: "Settings" pane allows toggling "Enable iMessage Bridge".
- Removed: Gateway hosting, local channel management, local config UI.
- Added: Cloud auth (JWT), cloud connection indicator, pairing flow.
- Unified inbox for all channels with search and filters.
- Channel management (Add/Remove/Reauth with status indicators).
- Agent configuration (Persona, system prompt, model selection, tool toggles, routing rules).
- Usage & billing (token consumption graphs, plan management).
- Bridge status (connected devices, health, troubleshooting).
# Cloud mode (default)
moltbot login # Opens browser for OAuth
moltbot status # Cloud status (channels, usage, plan)
moltbot channels list # Connected channels from cloud
moltbot channels connect telegram # Guided connection flow
moltbot tail # Stream events for debugging
moltbot export # Download archive
# Self-hosted mode (preserved for power users)
moltbot selfhost start # Original local gatewayWe shift from "Open Source Tool" to "SaaS with Free Tier".
-
Free / Hobby - $0/mo:
- Cloud Channels: 1 (Telegram or Discord).
- AI: Basic model (e.g., Gemini Flash), limited context window. 500 messages/month.
- Retention: 30 days message history.
- Storage: 100 MB media.
-
Pro - $15/mo:
- Cloud Channels: Unlimited (Slack, Teams, etc.).
- Bridge Channels: iMessage, WhatsApp, Signal.
- AI: Premium models (Claude Sonnet, GPT-4o), large context. 5,000 messages/month.
- Retention: Unlimited history + Vector Search memory.
- Storage: 10 GB media.
- Features: Voice transcription, image generation, BYOK (unlimited with own keys).
-
Team - $12/user/mo (min 3):
- Shared inboxes (multiple humans + AI agent in same channel).
- Role-based permissions.
- SSO (Google Workspace, Okta).
- Audit log.
- Everything in Pro.
-
Enterprise - Custom:
- Dedicated infrastructure, custom SLA, SOC 2 compliance, on-premise option.
- Messages ingested/sent (count)
- AI tokens (input/output)
- Media stored (GB-month)
- Overages: $0.01/message (basic), $0.05/message (premium AI), $0.50/GB storage.
- Continue to support the OSS Docker image.
- "Bring Your Own Cloud" license keys for enterprise deployments.
-
Phase 1: Cloud Sync (Hybrid) - Foundation
- Keep local gateway logic.
- Add "Sync to Cloud" plugin.
- Mobile apps connect to Cloud, Cloud proxies to Local Gateway.
- Value: Solves the "Tailscale/Public IP" headache for users.
-
Phase 2: Cloud Brain - AI + First Connectors
- Move the Agent logic to the cloud.
- Launch Telegram + Discord cloud connectors.
- Web dashboard with auth + channel management.
- Local gateway becomes just a "Dumb Bridge".
-
Phase 3: Full SaaS - Complete Product
- All cloud integrations (Slack, Teams, etc.).
- Real-time subscriptions + message search.
- iMessage edge connector + Mac app refactor.
- Billing + usage metering (Stripe).
-
Phase 4: Growth - Polish + Scale
- Mobile app cloud-native refactor.
- Push notifications.
- Team features, analytics, automations.
- Self-hosted migration tool.
moltbot cloud migratecommand:- Exports local JSONL transcripts + session metadata.
- Creates cloud account, uploads history.
- Re-authenticates channels in cloud.
- Verifies message parity.
- Hybrid mode preserved during transition (local gateway + cloud sync).
| Risk | Impact | Likelihood | Mitigation |
|---|---|---|---|
| Privacy breach | Critical | Low | E2EE where possible, strict data policies, SOC2 |
| iMessage instability | High | Medium | Keep bridge local (user hardware), graceful degradation |
| WhatsApp ToS | High | Medium | Bridge model (user-owned), parallel Cloud API option |
| AI cost overruns | Medium | Medium | Strict per-plan budgets, Haiku/Flash for free tier |
| Supabase scaling | Medium | Low | Can migrate to dedicated Postgres + custom realtime |
- The "One Inbox" Dream: Competitors like Beeper are great, but Moltbot adds a Personal AI Chief of Staff that lives in that inbox.
- AI-First: Not just "Chat with AI", but "AI reads my chats and drafts replies / reminds me of things".
- Privacy/Control: The "Bridge" model appeals to privacy-conscious users who don't want a cloud server logging into their iCloud.
| Feature | Moltbot Cloud | Beeper | texts.com | ChatGPT |
|---|---|---|---|---|
| AI Agent | Core feature | No | No | Destination app |
| Multi-channel | 7+ channels | 15+ | 5+ | 1 (own) |
| Self-hosted option | Yes | No | No | No |
| BYOK AI | Yes | N/A | N/A | N/A |
| In your existing chats | Yes | Yes | Yes | No |
| Price | $0-15/mo | $0-5/mo | Free | $20/mo |
- Vs. Beeper: We have the Agent. They are just aggregation.
- Vs. ChatGPT: We are in your iMessage/Telegram. ChatGPT is a destination app you go to.
- Vs. Self-Hosted OSS: We "just work". No Docker, no config files, no YAML.
- Morning Briefing: Agent summarizes all missed messages across Telegram/Slack/iMessage every morning.
- Cross-Platform Search: "What did John say about the project last month?" (Searches across ALL platforms).
- Smart Reply Drafts: AI drafts replies in your voice for review.
- Follow-up Reminders: "Nudge me if no response in 2 days."
- Vacation Mode: Auto-reply across all channels with AI.
- Contact Intelligence: Lightweight CRM notes per person.
- Launch on Product Hunt with free tier.
- Content marketing: "How I replaced 5 messaging apps with one AI."
- Developer community: Open-source channel plugin SDK.
- Referrals: "Invite a friend, get 1 month Pro free."
- In-app support powered by Moltbot itself.