System Architecture: Building a Scalable Multilingual Platform
Explore the modular architecture behind the URA Chatbot, from retrieval-augmented generation pipelines to CI/CD workflows.
System Architecture: Building a Scalable Multilingual Platform
Modular Design
The URA Chatbot uses a modular layered architecture that separates concerns and enables independent scaling of components:
Core Components
1. Frontend Layer: Web and mobile interfaces built for accessibility and responsiveness
2. API Layer: RESTful APIs handling user requests and orchestrating backend services
3. Processing Layer: Multilingual text processing, translation, and language detection
4. Retrieval Layer: Document search and vector-based semantic retrieval
5. Generation Layer: Large language models generating contextually accurate responses
6. Integration Layer: Connections to external services and legacy systems
Retrieval-Augmented Generation Pipeline
Our 10-stage RAG pipeline ensures accuracy and source grounding:
1. Input Processing: Normalize and clean user queries
2. Language Detection: Identify if input is English or Luganda
3. Translation: Convert Luganda to English for processing
4. Query Expansion: Enhance queries for better retrieval
5. Hybrid Retrieval: Combine BM25 keyword search with vector similarity
6. Reciprocal Rank Fusion: Merge multiple retrieval results
7. Document Ranking: Score documents by relevance
8. Context Assembly: Build coherent context from top documents
9. Generation: LLM generates response from context
10. Output Processing: Format response with sources and translate back to requested language
Technology Stack
| Component | Technology |
|---|---|
| Frontend | React, TypeScript, Tailwind CSS |
| Mobile | React Native/PWA |
| Backend | Python, FastAPI |
| Database | PostgreSQL, Vector DB |
| LLM | Qwen3-8B with LoRA fine-tuning |
| Deployment | Docker, Kubernetes, Crane Cloud |
| CI/CD | GitHub Actions, Automated Testing |
CI/CD and MLOps Pipeline
We implemented an end-to-end pipeline for continuous improvement:
- Automated Testing: Unit, integration, and end-to-end tests on every commit
- Model Validation: Continuous evaluation of retrieval and generation quality
- Staged Deployment: Dev → Staging → Production with automated rollbacks
- Monitoring: Real-time performance tracking and anomaly detection
- Feedback Loop: Production errors feed back into model improvements
This architecture enables us to scale horizontally, handle traffic spikes, and continuously improve the system based on real user feedback.