diff --git a/ROADMAP.md b/ROADMAP.md new file mode 100644 index 0000000..46665c9 --- /dev/null +++ b/ROADMAP.md @@ -0,0 +1,482 @@ +# πŸ—ΊοΈ Chat Switchboard Roadmap + +## Vision + +**Become the "VSCode of AI Interfaces"** - A minimal, extensible core with infinite capabilities through plugins. + +## Competitive Position + +| Feature | Chat Switchboard | Open WebUI | ChatGPT | Claude Desktop | LibreChat | +|---------|-----------------|------------|---------|----------------|-----------| +| **Multi-Model** | βœ… Auto-routing | βœ… Manual | ❌ | ❌ | βœ… | +| **Plugin System** | βœ…β­ Dogfooded | 🟑 Limited | ❌ | ❌ | 🟑 | +| **Offline Mode** | βœ… Full featured | ❌ | ❌ | 🟑 | ❌ | +| **Workflows** | βœ…β­ Visual DAG | ❌ | ❌ | ❌ | ❌ | +| **Channels** | βœ… With AI | βœ… | ❌ | ❌ | 🟑 | +| **RAG/Knowledge** | βœ… pgvector | βœ… | 🟑 | 🟑 | βœ… | +| **Self-Hosted** | βœ… Easy | βœ… Complex | ❌ | ❌ | βœ… | +| **Open Source** | βœ… MIT | βœ… MIT | ❌ | ❌ | βœ… MIT | +| **No Backend Required** | βœ…β­ Optional | ❌ | ❌ | ❌ | ❌ | +| **Desktop App** | 🟑 Planned | ❌ | βœ… | βœ… | ❌ | +| **Mobile App** | 🟑 PWA | 🟑 | βœ… | βœ… | 🟑 | + +**Unique Advantages:** +1. **Workflows** - No competitor has visual AI orchestration +2. **Plugin-First** - Core features ARE plugins (proves extensibility) +3. **Dual-Mode** - Works offline or managed (privacy + collaboration) +4. **Smart Routing** - Automatic model selection for cost/quality + +## Development Phases + +### βœ… Phase 0: Foundation (Current) +**Status:** Complete +**Timeline:** Week 1-2 + +- [x] Frontend core (vanilla JS) +- [x] LocalStorage state management +- [x] OpenAI-compatible API client +- [x] Streaming responses +- [x] Chat history +- [x] Export (Markdown, JSON, Text) +- [x] Model switching +- [x] Standalone build + +### 🚧 Phase 1: Backend Core +**Status:** In Progress +**Timeline:** Week 3-6 (4 weeks) + +**Goals:** +- Full Go backend with PostgreSQL +- User authentication (JWT) +- WebSocket server for real-time +- Extension manager (load/manage plugins) +- Mode switching (unmanaged ↔ managed) + +**Tasks:** +- [ ] Implement auth handlers (register, login, JWT) +- [ ] PostgreSQL models and migrations +- [ ] WebSocket hub for real-time messaging +- [ ] Extension discovery and lifecycle management +- [ ] API endpoints for chats, settings, users +- [ ] Frontend mode detection and switching + +**Deliverables:** +- Users can create accounts +- Backend stores chat history +- WebSocket connections work +- At least 1 extension loads and runs + +--- + +### 🎯 Phase 2: Core Features as Plugins +**Status:** Not Started +**Timeline:** Week 7-10 (4 weeks) + +**Goal:** Prove plugin architecture by implementing core features as extensions + +**2.1 Chat Engine Plugin (Python)** +``` +extensions/backend/chat-engine/ +β”œβ”€β”€ extension.json +β”œβ”€β”€ main.py +β”œβ”€β”€ requirements.txt +└── models/ + β”œβ”€β”€ openai.py + β”œβ”€β”€ anthropic.py + └── ollama.py +``` + +**Tasks:** +- [ ] Multi-provider adapter pattern +- [ ] Streaming response handling +- [ ] Token counting and cost tracking +- [ ] Message history management +- [ ] System prompt injection + +**2.2 Channels Plugin (Go)** +``` +extensions/backend/channels/ +β”œβ”€β”€ extension.json +β”œβ”€β”€ main.go +β”œβ”€β”€ handlers/ +β”‚ β”œβ”€β”€ channels.go +β”‚ └── messages.go +└── websocket/ + └── broadcaster.go +``` + +**Tasks:** +- [ ] Channel CRUD operations +- [ ] Membership management +- [ ] Real-time message broadcasting +- [ ] @mention parsing (users + AI models) +- [ ] Threading support + +**2.3 Notes Plugin (Go)** +``` +extensions/backend/notes/ +β”œβ”€β”€ extension.json +β”œβ”€β”€ main.go +└── handlers/ + └── notes.go +``` + +**Tasks:** +- [ ] Note CRUD +- [ ] Folder organization +- [ ] Tagging system +- [ ] Markdown rendering +- [ ] Full-text search + +**Deliverables:** +- Chat works via chat-engine extension +- Channels support user + AI conversations +- Notes can be created and organized +- All features disabled if extension not loaded + +--- + +### πŸš€ Phase 3: RAG & Knowledge Bases +**Status:** Not Started +**Timeline:** Week 11-13 (3 weeks) + +**Goal:** Advanced knowledge management with vector search + +**3.1 RAG Engine Plugin (Python)** +``` +extensions/backend/rag-engine/ +β”œβ”€β”€ extension.json +β”œβ”€β”€ main.py +β”œβ”€β”€ embeddings.py +β”œβ”€β”€ chunker.py +└── requirements.txt + # Dependencies: langchain, pgvector, tiktoken +``` + +**Features:** +- [ ] Document upload (PDF, DOCX, TXT, MD) +- [ ] Smart chunking (recursive, semantic) +- [ ] Embedding generation (OpenAI, local models) +- [ ] Vector storage (pgvector) +- [ ] Semantic search +- [ ] Context injection in chat + +**3.2 Knowledge Base UI** +- [ ] KB management interface +- [ ] Drag-and-drop upload +- [ ] Document viewer +- [ ] Search results preview +- [ ] Chat integration (auto-search when enabled) + +**Deliverables:** +- Upload documents to KB +- Semantic search works +- Chat can reference KB automatically +- Cost tracking for embeddings + +--- + +### ⭐ Phase 4: Workflows (KILLER FEATURE) +**Status:** Not Started +**Timeline:** Week 14-18 (5 weeks) + +**Goal:** Visual workflow builder for multi-step AI operations + +**4.1 Workflow Engine (Go + Python)** +``` +extensions/backend/workflows/ +β”œβ”€β”€ extension.json +β”œβ”€β”€ executor.go # Go: DAG execution +β”œβ”€β”€ registry.py # Python: Tool registry +└── nodes/ + β”œβ”€β”€ llm_node.go + β”œβ”€β”€ tool_node.go + β”œβ”€β”€ conditional_node.go + └── loop_node.go +``` + +**Features:** +- [ ] DAG execution engine +- [ ] Node type system (LLM, tool, logic, I/O) +- [ ] Variable resolution and templating +- [ ] Conditional branching +- [ ] Loops and iteration +- [ ] Error handling and retries +- [ ] Cost tracking per workflow +- [ ] Execution history and logs + +**4.2 Visual Workflow Builder (Frontend)** +- [ ] Drag-and-drop canvas +- [ ] Node palette (search and add) +- [ ] Connection drawing +- [ ] Node configuration panels +- [ ] Live execution preview +- [ ] Debug mode (step-through) + +**4.3 Workflow Templates** +- [ ] Research Assistant +- [ ] Code Review Pipeline +- [ ] Multi-Model Consensus +- [ ] Content Creation Factory +- [ ] Data Processing Pipeline + +**Deliverables:** +- Users can create workflows visually +- Workflows execute correctly +- Template marketplace basics +- At least 5 working templates + +--- + +### πŸ”§ Phase 5: Developer Experience +**Status:** Not Started +**Timeline:** Week 19-21 (3 weeks) + +**Goal:** Make extension development effortless + +**5.1 Extension Templates** +- [ ] `_template-python` with FastAPI boilerplate +- [ ] `_template-go` with Gin boilerplate +- [ ] `_template-node` with Express boilerplate +- [ ] CLI tool: `chatswitch create-extension` + +**5.2 Extension Marketplace** +``` +marketplace/ +β”œβ”€β”€ backend/ +β”‚ β”œβ”€β”€ api.go # Publish, search, install +β”‚ └── storage/ # Extension packages +└── frontend/ + └── marketplace.html # Browse and install UI +``` + +**Features:** +- [ ] Publish extensions (tarball upload) +- [ ] Search and browse +- [ ] One-click install +- [ ] Ratings and reviews +- [ ] Version management +- [ ] Dependency resolution + +**5.3 Documentation & Examples** +- [ ] Complete API documentation +- [ ] 10+ example extensions +- [ ] Video tutorials +- [ ] Plugin development guide +- [ ] Contributing guidelines + +**Deliverables:** +- Easy extension scaffolding +- Working marketplace +- Comprehensive docs + +--- + +### πŸ’Ž Phase 6: Polish & Launch Prep +**Status:** Not Started +**Timeline:** Week 22-24 (3 weeks) + +**6.1 Desktop App (Tauri)** +``` +desktop/ +β”œβ”€β”€ src-tauri/ # Rust backend +β”‚ β”œβ”€β”€ main.rs +β”‚ └── Cargo.toml +└── src/ # Frontend (reuse web) + └── index.html +``` + +**Features:** +- [ ] Native app wrapper +- [ ] System tray integration +- [ ] Keyboard shortcuts +- [ ] Native notifications +- [ ] Auto-updates + +**6.2 Mobile (PWA)** +- [ ] Responsive design +- [ ] Touch gestures +- [ ] Offline support +- [ ] Install prompt + +**6.3 Performance** +- [ ] Frontend bundle optimization +- [ ] Backend query optimization +- [ ] WebSocket connection pooling +- [ ] Redis caching +- [ ] CDN for static assets + +**6.4 Security Audit** +- [ ] SQL injection prevention +- [ ] XSS protection +- [ ] CSRF tokens +- [ ] Rate limiting +- [ ] API key encryption audit +- [ ] Extension sandboxing review + +**Deliverables:** +- Desktop app for Windows, Mac, Linux +- Mobile-friendly PWA +- Performance benchmarks +- Security audit report + +--- + +### πŸŽ‰ Phase 7: Launch +**Timeline:** Week 25 + +**7.1 Marketing** +- [ ] Landing page +- [ ] Demo video +- [ ] Blog post +- [ ] HackerNews/Reddit launch +- [ ] ProductHunt submission + +**7.2 Community** +- [ ] Discord server +- [ ] GitHub Discussions +- [ ] Documentation site +- [ ] Example workflows gallery + +**7.3 Infrastructure** +- [ ] Hosted demo instance +- [ ] CI/CD pipeline +- [ ] Monitoring (Prometheus, Grafana) +- [ ] Error tracking (Sentry) + +**Launch Checklist:** +- [ ] All core features working +- [ ] 10+ bundled extensions +- [ ] Desktop app released +- [ ] Documentation complete +- [ ] Demo video published +- [ ] Community channels live + +--- + +## Post-Launch Roadmap + +### v1.1 - Enterprise Features +**Timeline:** Month 2-3 + +- [ ] SSO/SAML authentication +- [ ] Team management +- [ ] Role-based access control (RBAC) +- [ ] Audit logs +- [ ] Usage analytics dashboard +- [ ] Billing integration (Stripe) + +### v1.2 - Advanced Workflows +**Timeline:** Month 4-5 + +- [ ] Workflow version control (Git-like) +- [ ] Collaborative editing +- [ ] A/B testing workflows +- [ ] Scheduled executions (cron) +- [ ] Webhook triggers +- [ ] API-first workflow execution + +### v1.3 - AI Enhancements +**Timeline:** Month 6-7 + +- [ ] Fine-tuned model hosting +- [ ] Custom embedding models +- [ ] Multi-modal support (images, audio) +- [ ] Voice chat +- [ ] Real-time translation + +### v2.0 - Platform Evolution +**Timeline:** Month 8-12 + +- [ ] Plugin marketplace monetization +- [ ] White-label solution +- [ ] Multi-tenant SaaS mode +- [ ] Advanced analytics (cost optimization, usage insights) +- [ ] Mobile native apps (React Native) + +--- + +## Success Metrics + +### User Metrics +- **Week 1:** 100 GitHub stars +- **Month 1:** 1,000 active users +- **Month 3:** 5,000 active users, 50 community extensions +- **Month 6:** 20,000 active users, 200 community extensions + +### Technical Metrics +- **Plugin Load Time:** < 2s +- **API Response Time:** < 100ms (p95) +- **WebSocket Latency:** < 50ms +- **Uptime:** 99.9% + +### Business Metrics (If Applicable) +- **Free Tier:** Unlimited local use +- **Hosted Basic:** $10/user/month +- **Hosted Pro:** $25/user/month (workflows, advanced features) +- **Enterprise:** Custom pricing + +--- + +## Risk Mitigation + +### Technical Risks +| Risk | Mitigation | +|------|-----------| +| Extension security vulnerabilities | Sandboxing, code review, security audit | +| WebSocket scaling issues | Redis pub/sub, horizontal scaling | +| Database performance | Query optimization, indexing, caching | +| Third-party API rate limits | Retry logic, fallback chains, caching | + +### Product Risks +| Risk | Mitigation | +|------|-----------| +| Competitors copy workflows feature | Speed to market, open-source advantage | +| Low plugin adoption | High-quality templates, good DX | +| Users prefer monolithic apps | Prove extensibility with core features | + +### Market Risks +| Risk | Mitigation | +|------|-----------| +| AI providers release similar tools | Self-hosted option, multi-provider support | +| Regulation changes | Privacy-first design, compliance features | + +--- + +## How to Contribute + +### For Developers +1. Pick an issue from GitHub +2. Fork the repo +3. Create a feature branch +4. Submit a PR + +**High Priority:** +- Implement Phase 1 backend tasks +- Create example extensions +- Write documentation + +### For Designers +- UI/UX improvements +- Workflow builder mockups +- Landing page design + +### For Writers +- Blog posts +- Tutorials +- Documentation improvements + +### For Users +- Bug reports +- Feature requests +- Extension ideas + +--- + +## Questions? + +- **GitHub Issues:** Bug reports, feature requests +- **GitHub Discussions:** General questions, ideas +- **Discord:** Real-time chat (coming soon) + +**Let's build the future of AI interfaces together! πŸš€**