How openchatai/copilot works
Main Components Overview
a) Dashboard (Frontend)
• Located in /dashboard directory
• Next.js-based web application
• Handles copilot configuration and management
• Contains authenticated and unauthenticated routes
b) LLM Server (Backend)
• Located in /llm-server directory
• Python-based FastAPI application
• Handles AI processing and API integrations
• Contains multiple services and workers
c) Copilot Widget
• Located in /copilot-widget directory
• Embeddable React component
• Client-facing chat interface
Key Architectural Components
Database Layer:
• PostgreSQL database connection
• Qdrant vector store for embeddings
• Alembic migrations system
External Services:
• OpenAI API integration
• Vector store connections
• API endpoints being managed
Message Flow:
• WebSocket connections for real-time chat
• REST API calls between components
• Authentication flow
Detailed Component Breakdown
LLM Server Services:
• Action Service
• Analytics Service
• Chat Service
• Flow Service
• Search Service
• Upload Service
• Worker Service (Celery)
Dashboard Modules:
• Authentication
• Copilot Management
• Analytics
• Knowledge Base
• Workflow Editor
• Settings Management
Widget Components:
• Chat Interface
• Form Handling
• Socket Management
• Message Processing
Important Workflows to Highlight
API Integration Flow:
Dashboard → Swagger Upload → LLM Server → Vector Store → Action Repository
Chat Processing Flow:
Widget → WebSocket → LLM Server → OpenAI → API Execution → Response Transform
Knowledge Base Flow:
Upload → Worker Service → Vector Embedding → Vector Store → Search Service
Additional Elements
Security Layer:
• Authentication boundaries
• API key management
• Request validation
Scaling Components:
• Worker distribution
• Database replication
• Cache layers