Persistent Data Layer
Storage Infrastructure
| Service | Port | Type | Purpose | Components |
|---|---|---|---|---|
| PostgreSQL | 5432 | Relational DB | Persistent data storage | web_db, assistant_db, integration_db, endpoint_db, document_db |
| Redis | 6379 | In-Memory Cache | Sessions, caching, job queues | DB:0 (Cache), DB:1 (Sessions), DB:2 (Jobs & Queues) |
| OpenSearch | 9200 | Search & Analytics | Full-text search, indexing | Conversations, Metrics, Documents, Audit Logs |
PostgreSQL Databases
| Database Name | Purpose | Key Tables |
|---|---|---|
| web_db | User & org management | users, organizations, projects, credentials |
| assistant_db | Voice agents & conversations | assistants, conversations, messages, audio_files |
| integration_db | Provider integrations | integrations, credentials, oauth_tokens |
| endpoint_db | Webhooks & events | webhooks, webhook_events, webhook_deliveries |
| document_db | Knowledge base & embeddings | documents, chunks, embeddings, knowledge_bases |
Redis Data Structure
| DB Number | Purpose | Usage |
|---|---|---|
| DB 0 | Cache & Config | Application cache, configuration values |
| DB 1 | Session Store | User sessions, auth tokens |
| DB 2 | Job Queues | Background job queue, Celery tasks |
| DB 3+ | Reserved | Future use, custom applications |
OpenSearch Indices
| Index Name | Data Type | Purpose |
|---|---|---|
| conversations | Conversation records | Full-text search, conversation transcripts |
| metrics | Performance data | Call metrics, performance analytics |
| documents | Knowledge content | Knowledge base search, embeddings |
| audit-logs | System events | Audit trail, event tracking |
Core Components
API Services (Microservices)
| Service | Port | Purpose | Built With |
|---|---|---|---|
| web-api | 9001 | Dashboard backend, user management, orchestration | Go + Gin |
| assistant-api | 9007 | Voice agents, conversations, real-time audio | Go + gRPC |
| integration-api | 9004 | Third-party integrations, credential management | Go + Gin |
| endpoint-api | 9005 | Webhooks, callbacks, external events | Go + Gin |
| document-api | 9010 | Knowledge base, RAG, embeddings | Python + FastAPI |
Frontend
| Service | Port | Purpose | Built With |
|---|---|---|---|
| ui | 3000 | Web dashboard | React + TypeScript |
API Gateway
| Service | Port | Purpose |
|---|---|---|
| nginx | 8080 | Reverse proxy, load balancing, SSL/TLS |
Infrastructure Services
| Service | Port | Purpose | Data |
|---|---|---|---|
| PostgreSQL | 5432 | Relational database | 4 separate databases |
| Redis | 6379 | Cache, queues, sessions | In-memory store |
| OpenSearch | 9200 | Full-text search, analytics | Indices for conversations, logs |
Data Flow
1. User Authentication
2. Create Voice Agent
3. Start Voice Conversation
4. Upload Knowledge Document
Service Communication
Synchronous Communication
- REST APIs: Services expose HTTP/REST endpoints
- gRPC: Internal service-to-service communication (assistant-api)
- WebSocket: Real-time bidirectional communication for voice streams
Asynchronous Communication
- Redis Pub/Sub: Real-time notifications, session updates
- Redis Queues: Background job processing (document processing, embeddings)
- Webhooks: External event notifications via HTTP callbacks
Database Strategy
PostgreSQL Databases
Redis Databases
OpenSearch Indices
Deployment Models
Docker Compose (Development/Single Server)
All services run as containers on a single server:Kubernetes (Production)
Services can be deployed to Kubernetes clusters:AWS Deployment
Services deployed with AWS CodeDeploy:Security Architecture
Authentication & Authorization
Credential Management
Network Security
Scaling Considerations
Horizontal Scaling
Services that can scale independently:Load Distribution
Development vs Production
Development (Docker Compose)
- Single PostgreSQL instance
- Single Redis instance
- Single OpenSearch node
- All services on one network
- Local volume storage
- No SSL/TLS
- No authentication for internal services
Production (Kubernetes/AWS)
- PostgreSQL with replication and backups
- Redis with high availability
- OpenSearch with multiple nodes and sharding
- Services with health checks and auto-recovery
- Persistent block storage or managed services
- SSL/TLS everywhere
- Authentication for all internal communication
- Monitoring, logging, and alerting