Production-ready AI Retrieval-Augmented Generation (RAG) platform built with FastAPI, React, ChromaDB, Google Gemini, Docker, AWS EC2, Prometheus, Grafana and GitHub Actions CI/CD.
Financial RAG Platform is an end-to-end Generative AI application that demonstrates how modern LLM-powered systems can be engineered, containerized, monitored and deployed using production-inspired software engineering practices.
Instead of relying only on a Large Language Model, the platform implements Retrieval-Augmented Generation (RAG) to provide grounded responses from uploaded financial documents. Users can upload PDF reports, annual statements or investment documents, build a semantic vector database and interact with them through natural language.
Beyond the AI workflow, this project focuses heavily on Cloud Engineering, DevOps, Backend Engineering and Observability by implementing automated CI/CD pipelines, Dockerized services, AWS deployment, monitoring dashboards and production health checks.
The primary objective of this project was to understand how production AI systems are built rather than simply calling an LLM API.
The project explores multiple engineering domains simultaneously:
- Artificial Intelligence Engineering
- Retrieval-Augmented Generation (RAG)
- Backend API Development
- Cloud Computing
- DevOps Engineering
- Infrastructure Automation
- Monitoring & Observability
- Containerized Deployments
- Continuous Integration & Continuous Deployment (CI/CD)
- Production Debugging
Rather than treating AI as a standalone component, the application demonstrates how intelligent systems are integrated into reliable production environments.
- Retrieval-Augmented Generation (RAG)
- Financial Document Question Answering
- Sentence Transformer Embeddings
- ChromaDB Vector Database
- Semantic Similarity Search
- Context-aware Prompt Construction
- Source Grounded Gemini Responses
- Multi-document Knowledge Base
- Intelligent Document Chunking
- Retrieval-only fallback mode
- Dockerized Microservice Architecture
- Docker Compose Orchestration
- AWS EC2 Deployment
- Nginx Reverse Proxy
- GitHub Actions CI/CD
- Automated Docker Hub Publishing
- Health Checks
- Persistent Volumes
- Prometheus Monitoring
- Grafana Dashboards
- Automated Deployment Verification
- Container Lifecycle Management
Large Language Models are extremely capable but cannot reliably answer questions about private documents they have never seen.
Retrieval-Augmented Generation solves this problem by retrieving relevant document chunks before generating a response.
Instead of asking Gemini to hallucinate an answer, the application performs semantic retrieval against a vector database and supplies the retrieved context to the model.
Benefits include:
- Higher factual accuracy
- Reduced hallucinations
- Source-grounded responses
- Support for private datasets
- Domain-specific knowledge
- Explainable AI outputs
GitHub Repository
β
βΌ
GitHub Actions Workflow
β
ββββββββββββββββββββ΄βββββββββββββββββββ
βΌ βΌ
Backend Docker Image Frontend Docker Image
β β
ββββββββββββββββββββ¬βββββββββββββββββββ
βΌ
Docker Hub
β
βΌ
AWS EC2 Instance
β
Docker Compose
β
βββββββββββββββ¬ββββββββββββββββ¬ββββββββββββββββ
βΌ βΌ βΌ βΌ
Nginx React UI FastAPI API Prometheus
β β
βΌ βΌ
RAG Pipeline Grafana
β
ββββββββββββββββββββ΄ββββββββββββββββββ
βΌ βΌ
ChromaDB Google Gemini
β
βΌ
Sentence Transformer Embeddings
Upload Financial PDF
β
βΌ
Extract PDF Content
β
βΌ
Intelligent Text Chunking
β
βΌ
Generate Sentence Transformer Embeddings
β
βΌ
Store in ChromaDB
β
βΌ
User asks a Question
β
βΌ
Semantic Similarity Search
β
βΌ
Retrieve Most Relevant Chunks
β
βΌ
Build Prompt using Retrieved Context
β
βΌ
Google Gemini LLM
β
βΌ
Source Grounded Financial Response
Developer
β
βΌ
Push to GitHub
β
βΌ
GitHub Actions CI/CD
β
βΌ
Build Docker Images
β
βΌ
Push to Docker Hub
β
βΌ
Connect to AWS EC2 via SSH
β
βΌ
Pull Latest Docker Images
β
βΌ
Docker Compose Deployment
β
βΌ
Health Check Verification
β
βΌ
Production Application Live
FastAPI Application
β
βΌ
Prometheus Instrumentation
β
βΌ
/metrics Endpoint
β
βΌ
Prometheus Scraping
β
βΌ
Time Series Database
β
βΌ
Grafana Dashboards
β
βΌ
Performance Visualization
| Category | Technologies |
|---|---|
| Programming Language | Python, JavaScript |
| Backend Framework | FastAPI |
| Frontend | React + Vite |
| AI Model | Google Gemini |
| Embedding Model | Sentence Transformers |
| Vector Database | ChromaDB |
| PDF Processing | PyPDF |
| API Server | Uvicorn |
| Monitoring | Prometheus |
| Visualization | Grafana |
| Containerization | Docker |
| Orchestration | Docker Compose |
| Reverse Proxy | Nginx |
| CI/CD | GitHub Actions |
| Container Registry | Docker Hub |
| Cloud Platform | AWS EC2 |
| Version Control | Git & GitHub |
financial-rag-platform/
β
βββ backend/
β βββ app/
β β βββ main.py
β β βββ rag_pipeline.py
β β βββ vector_store.py
β β βββ pdf_loader.py
β β βββ text_splitter.py
β β βββ config.py
β β βββ schemas.py
β β
β βββ Dockerfile
β βββ requirements.txt
β
βββ frontend/
β βββ src/
β βββ public/
β βββ Dockerfile
β
βββ monitoring/
β βββ prometheus.yml
β βββ grafana/
β
βββ nginx/
β βββ nginx.conf
β βββ default.conf
β
βββ screenshots/
β
βββ .github/
β βββ workflows/
β βββ deployment.yml
β
βββ docker-compose.yml
βββ docker-compose.prod.yml
βββ README.md
The following screenshots showcase the complete lifecycle of the applicationβfrom uploading financial documents and generating AI-powered responses to production deployment, monitoring, and cloud infrastructure.
Demonstrates the production application successfully deployed on an AWS EC2 instance.
Upload a financial PDF to build the knowledge base for Retrieval-Augmented Generation (RAG).
Question answering powered by semantic search with source-grounded responses generated using Google Gemini.
Clear all uploaded documents and vector embeddings to start with a fresh knowledge base.
Docker Compose running the complete production stack, including the frontend, backend, Nginx, Prometheus, and Grafana services.
Production health endpoint used by Docker health checks and the CI/CD deployment pipeline.
Successful automated pipeline for validation, testing, Docker image publishing, and deployment to AWS.
Automatically published production Docker images for deployment and version management.
Prometheus continuously collecting metrics from the FastAPI backend for monitoring and observability.
Grafana dashboard visualizing application performance, request metrics, and service health.
AWS EC2 instance hosting the production deployment of the application.
Inbound security rules configured to securely expose HTTP, HTTPS, and SSH access for the production environment.
This project demonstrates practical experience in:
- Artificial Intelligence Engineering
- LLM Application Development
- Retrieval-Augmented Generation
- Semantic Search
- Vector Databases
- Backend API Development
- REST API Design
- Cloud Deployment
- DevOps Engineering
- Docker
- Docker Compose
- GitHub Actions
- CI/CD
- AWS EC2
- Monitoring
- Observability
- Infrastructure Automation
- Production Debugging
Before running the application, ensure the following software is installed:
| Software | Version |
|---|---|
| Python | 3.10+ |
| Docker | Latest |
| Docker Compose | Latest |
| Git | Latest |
You will also require a valid Google Gemini API Key.
git clone https://github.com/aadi090204/financial-rag-platform.git
cd financial-rag-platformCreate an environment file.
cp .env.example .envAdd your Gemini API Key.
GEMINI_API_KEY=YOUR_API_KEYdocker compose builddocker compose up -ddocker psExpected services:
- Frontend
- Backend
- Nginx
- Prometheus
- Grafana
| Service | URL |
|---|---|
| Frontend | http://localhost |
| Backend API | http://localhost:8000 |
| Swagger UI | http://localhost:8000/docs |
| Health Endpoint | http://localhost/health |
| Metrics | http://localhost:8000/metrics |
| Prometheus | http://localhost:9090 |
| Grafana | http://localhost:3001 |
POST /uploadUploads financial PDF documents.
POST /askQueries uploaded financial documents using semantic search and Gemini.
DELETE /documents/resetDeletes all stored embeddings and uploaded documents.
GET /healthUsed by Docker health checks and deployment verification.
GET /metricsExports Prometheus metrics.
The deployment pipeline follows a production-inspired workflow.
Developer Push
β
βΌ
GitHub Repository
β
βΌ
GitHub Actions
β
βΌ
Validate Docker Compose
β
βΌ
Integration Tests
β
βΌ
Build Backend Image
β
βΌ
Build Frontend Image
β
βΌ
Publish Docker Images
β
βΌ
Sync Production Configuration
β
βΌ
Deploy to AWS EC2
β
βΌ
Health Verification
β
βΌ
Docker Image Cleanup
The workflow performs:
- Docker Compose validation
- Integration testing
- Docker image creation
- Docker Hub publishing
- Automated AWS deployment
- Health verification
- Automatic cleanup of dangling images
The production environment runs on an AWS EC2 instance.
Deployment stack:
- Amazon EC2
- Docker Compose
- Nginx Reverse Proxy
- Docker Hub
- GitHub Actions
- Prometheus
- Grafana
The deployment process is fully automated.
Each push to the main branch triggers a deployment pipeline that:
- Builds Docker images.
- Publishes them to Docker Hub.
- Connects securely to EC2.
- Pulls updated images.
- Restarts containers.
- Verifies service health.
- Cleans unused Docker images.
Each application component runs as an isolated container.
Docker Compose
βββ Nginx
β
βββ React Frontend
β
βββ FastAPI Backend
β β
β βΌ
β ChromaDB
β
βββ Prometheus
β
βββ Grafana
Benefits:
- Service isolation
- Easy scaling
- Reproducible environments
- Simplified deployment
- Independent updates
Monitoring was integrated from the beginning to simulate a production environment.
Prometheus periodically scrapes metrics exposed by the FastAPI application.
Grafana visualizes these metrics using dashboards.
Collected metrics include:
- Request count
- Request duration
- API latency
- Endpoint availability
- Container health
- Service uptime
This enables proactive monitoring and easier debugging.
The application implements health checks at multiple levels.
Docker Healthcheck
GET /health
GitHub Actions verifies application readiness after deployment.
Prometheus continuously monitors application availability.
Application data persists between deployments.
Persistent directories include:
uploads/
Stores uploaded PDF files.
chroma_db/
Stores vector embeddings.
This prevents data loss during container recreation.
The project follows several production-oriented security practices.
- Environment variables stored outside source code
- Sensitive API keys excluded from Git
- Reverse proxy through Nginx
- Automated health verification
- Isolated Docker network
- Persistent storage mounted through Docker volumes
Future improvements include:
- JWT Authentication
- HTTPS using Let's Encrypt
- Secrets Manager
- IAM Roles
Several optimizations were implemented throughout development.
- Lazy initialization
- Optimized startup sequence
- Health endpoint
- Docker health checks
- Multi-container architecture
- Automatic restart policies
- Docker image cleanup
- Persistent volumes
- Automated health verification
- Reduced deployment downtime
- Image reuse
- Pull policy optimization
Throughout development several real-world engineering problems were encountered and resolved.
- Large image size
- Disk exhaustion on EC2
- Dangling image cleanup
- Container lifecycle management
- Deployment synchronization
- Health verification timing
- SSH connectivity
- Automated deployment debugging
- PDF parsing reliability
- Embedding generation
- Semantic retrieval
- Prompt construction
- Gemini integration
- Prometheus scraping
- Grafana dashboards
- Metrics instrumentation
- Docker networking
- Reverse proxy configuration
- Persistent volumes
- Production deployment
This project provided hands-on experience with modern AI and cloud-native engineering practices.
- Retrieval-Augmented Generation
- Vector Databases
- Semantic Search
- Embedding Models
- Prompt Engineering
- Large Language Models
- FastAPI
- REST APIs
- File Upload Handling
- Background Processing
- AWS EC2
- Linux Server Administration
- Nginx
- Docker Deployment
- Docker
- Docker Compose
- GitHub Actions
- Docker Hub
- CI/CD Pipelines
- Monitoring
- Observability
Planned enhancements include:
- Kubernetes Deployment
- AWS ECS
- AWS EKS
- Terraform Infrastructure as Code
- Redis Caching
- JWT Authentication
- User Accounts
- Multi-user Document Collections
- OpenTelemetry
- Distributed Tracing
- Object Storage (Amazon S3)
- Horizontal Scaling
- Load Balancing
- Blue-Green Deployment
- Canary Releases
- Automated Unit Testing
- Integration Testing
- Security Scanning
This project demonstrates practical experience in:
- Retrieval-Augmented Generation (RAG)
- Generative AI
- LLM Integration
- Google Gemini
- Semantic Search
- ChromaDB
- Vector Databases
- FastAPI
- REST API Development
- Python
- API Design
- File Processing
- AWS EC2
- Linux
- Docker Deployment
- Reverse Proxy
- Infrastructure Management
- Docker
- Docker Compose
- GitHub Actions
- CI/CD
- Docker Hub
- Monitoring
- Observability
- Health Checks
Contributions are welcome.
Feel free to:
- Open issues
- Suggest improvements
- Submit pull requests
This project is released under the MIT License.
Software Engineer passionate about building production-ready AI systems that combine modern LLM technologies with cloud-native engineering practices.
- Artificial Intelligence
- Generative AI
- Retrieval-Augmented Generation
- Backend Engineering
- Cloud Computing
- DevOps
- Platform Engineering
- Distributed Systems
GitHub
https://www.linkedin.com/in/adithya-anil-8a247a255/
It helps others discover the project and supports future development.











