Services Overview
Rapida consists of multiple microservices, each with specific responsibilities. This guide explains each service in detail.Architecture at a Glance
| Service | Port | Purpose | Database | Language |
|---|---|---|---|---|
| web-api | 9001 | Core platform, dashboard backend | web_db | Go |
| assistant-api | 9007 | Voice agents, conversations | assistant_db | Go |
| integration-api | 9004 | Third-party integrations | integration_db | Go |
| endpoint-api | 9005 | Webhooks, callbacks | endpoint_db | Go |
| document-api | 9010 | Knowledge base, RAG | document_db | Python |
| ui | 3000 | Web dashboard | N/A | React |
| nginx | 8080 | API gateway, reverse proxy | N/A | N/A |
Infrastructure Services
| Service | Port | Purpose |
|---|---|---|
| PostgreSQL | 5432 | Relational database (4 instances) |
| Redis | 6379 | Cache, queues, sessions |
| OpenSearch | 9200 | Full-text search, analytics |
Core Services
web-api (Port 9001)
Purpose: Core platform orchestration and management backend Responsibilities:- User authentication and authorization
- Organization and workspace management
- Project management
- Credential management
- API rate limiting
- Dashboard API endpoints
- Configuration management
- JWT-based authentication
- Role-based access control (RBAC)
- Workspace isolation
- Multi-tenancy support
web_db in PostgreSQL
Key Tables:
users- User accountsorganizations- Organization dataworkspaces- Workspace boundariesprojects- Voice AI projectscredentials- Stored API keys (encrypted)api_keys- Service-to-service authentication
- User management
- Organization settings
- API key generation
- Credential storage (encrypted)
assistant-api (Port 9007)
Purpose: Voice agent and real-time conversation management Responsibilities:- Create and manage voice assistants
- Handle real-time voice conversations
- Audio streaming and processing
- LLM integration and inference
- Speech-to-Text (STT) orchestration
- Text-to-Speech (TTS) orchestration
- Voice activity detection (VAD)
- Conversation persistence and search
- Real-time WebSocket communication
- Low-latency audio streaming
- Voice activity detection (stops listening for silence)
- Multiple LLM provider support
- Conversation analytics
- Full conversation history with search
assistant_db in PostgreSQL
Search Engine: OpenSearch (for conversation search and analytics)
Key Tables:
assistants- Assistant configurationsassistant_versions- Version managementconversations- Conversation metadatamessages- Individual messages in conversationsaudio_files- Stored audio recordingsconversation_analysis- Call analytics data
assistant-conversations- Searchable conversation contentconversation-metrics- Call duration, quality metricsassistant-analytics- Agent performance data
- OpenAI (GPT-4, GPT-3.5)
- Anthropic Claude
- Google Gemini, Vertex AI
- Cohere
- Azure OpenAI
- AWS Bedrock
- Mistral
- HuggingFace
- Google Cloud Speech-to-Text
- Azure Cognitive Services
- Deepgram
- AssemblyAI
- Cartesia
- Sarvam AI
- Google Cloud Text-to-Speech
- Azure Cognitive Services
- ElevenLabs
- Deepgram
- Cartesia
- Sarvam AI
- Create voice assistants
- Start/manage conversations
- Query conversation history
- Update assistant configuration
integration-api (Port 9004)
Purpose: Third-party service integration and credential management Responsibilities:- Store and manage API credentials securely
- Handle OAuth authentication flows
- Integration configuration
- Provider validation and health checks
- Encryption/decryption of sensitive data
- Integration marketplace
- End-to-end credential encryption
- OAuth 2.0 support
- Provider health monitoring
- Integration templates
- Credential rotation support
integration_db in PostgreSQL
Key Tables:
integrations- Integration configurationsproviders- Provider definitionscredentials- Encrypted API keys and tokensoauth_tokens- OAuth session tokensoauth_providers- OAuth configuration
| Category | Providers |
|---|---|
| LLM | OpenAI, Anthropic, Cohere, Google, Azure, AWS Bedrock, Mistral, HuggingFace |
| STT | Google, Azure, Deepgram, AssemblyAI, Cartesia, Sarvam |
| TTS | Google, Azure, ElevenLabs, Deepgram, Cartesia, Sarvam |
| Telephony | Twilio, Vonage, Exotel |
| SendGrid | |
| Webhooks | Any HTTP endpoint |
- Store API credentials
- Test provider connections
- List available providers
- Update credential permissions
endpoint-api (Port 9005)
Purpose: Webhook and callback management Responsibilities:- Webhook configuration and delivery
- Callback handling for external events
- Event routing and filtering
- Retry logic and failure handling
- Webhook signature verification
- Event logging
- Multiple webhook events
- Automatic retry with exponential backoff
- Event filtering by type
- Webhook testing
- Event history and replay
endpoint_db in PostgreSQL
Key Tables:
webhooks- Webhook configurationswebhook_events- Event definitionswebhook_deliveries- Delivery historywebhook_logs- Detailed delivery logs
conversation.started- New conversation initiatedconversation.ended- Conversation completedmessage.sent- Message sent by assistantmessage.received- Message received from userassistant.updated- Assistant configuration changedassistant.deleted- Assistant removederror.occurred- Error in conversation
- Register webhooks
- Test webhook deliveries
- View delivery history
- Replay failed events
document-api (Port 9010)
Purpose: Knowledge base management and RAG (Retrieval Augmented Generation) Responsibilities:- Document upload and processing
- Text extraction and chunking
- Semantic embeddings generation
- Vector search
- Knowledge base organization
- Audio noise reduction (RNNoise)
- Entity extraction and tagging
- Multiple file format support (PDF, DOCX, XLSX, CSV, MD, HTML)
- Automatic text chunking with overlap
- Semantic search via embeddings
- Knowledge organization by collections
- Audio processing with noise reduction
- Metadata extraction
documents- Document metadatachunks- Text chunks from documentsembeddings- Vector embeddings for searchknowledge_bases- Knowledge collectionsdocument_processing_jobs- Background job tracking
documents-*- Full-text searchable documentsembeddings-*- Vector embeddings for similarity search
| Format | Supported |
|---|---|
| ✓ | |
| Word (.docx) | ✓ |
| Excel (.xlsx) | ✓ |
| CSV | ✓ |
| Markdown | ✓ |
| HTML | ✓ |
| Plain Text | ✓ |
| Images (with OCR) | Planned |
- Upload documents
- Organize knowledge bases
- Search documents
- Process audio files
- Extract entities
Frontend Service
ui (Port 3000)
Purpose: Web dashboard for managing Rapida platform Technology: React, TypeScript, Tailwind CSS Key Features:- Responsive design
- Real-time updates via WebSocket
- Dark/light theme support
- Mobile-friendly
- Offline support
- Assistant management interface
- Conversation viewing and analysis
- Knowledge base management
- Credential configuration
- Analytics and reporting
- User settings and preferences
- Webhook configuration
.env):
API Gateway
nginx (Port 8080)
Purpose: Reverse proxy, load balancing, and request routing Responsibilities:- Route requests to appropriate services
- Load balancing across services
- SSL/TLS termination (when configured)
- Request/response compression
- Static file serving (UI)
- Rate limiting
- CORS handling
/nginx/nginx.conf
Default Routes:
| Path | Service | Port |
|---|---|---|
/api/v1/web/* | web-api | 9001 |
/api/v1/assistant/* | assistant-api | 9007 |
/api/v1/integration/* | integration-api | 9004 |
/api/v1/endpoint/* | endpoint-api | 9005 |
/api/v1/document/* | document-api | 9010 |
/ | ui | 3000 |
Infrastructure Services
PostgreSQL (Port 5432)
Purpose: Primary relational database for all services Databases:| Database | Service | Purpose |
|---|---|---|
web_db | web-api | Users, organizations, credentials |
assistant_db | assistant-api | Assistants, conversations, messages |
integration_db | integration-api | Integrations, providers, credentials |
endpoint_db | endpoint-api | Webhooks, callbacks, events |
document_db | document-api | Documents, chunks, embeddings |
Redis (Port 6379)
Purpose: In-memory cache and message queue Uses:- Session caching
- Rate limiting
- API response caching
- Job queue for background tasks
- Real-time data caching
- Pub/Sub for real-time updates
| DB | Purpose |
|---|---|
| 0 | General cache |
| 1 | Integration API cache |
| 2 | Endpoint API jobs |
| 3+ | Reserved |
OpenSearch (Port 9200)
Purpose: Full-text search and analytics engine Indices:| Index | Purpose | Retention |
|---|---|---|
assistant-conversations | Conversation search | 90 days |
conversation-metrics | Call metrics | 30 days |
assistant-analytics | Agent performance | 30 days |
documents-* | Knowledge base search | Unlimited |
logs-* | Application logs | 7 days |
Service Dependencies
Service Interaction Flow
1. User Authentication Flow
2. Create Voice Agent Flow
3. Start Conversation Flow
4. Upload Document Flow
Scaling & Load Balancing
Each service can be scaled independently:Next Steps
- Configuration - Configure each service
- Installation - Deploy Rapida
- Troubleshooting - Fix common issues