Intelligent financial document analysis platform that uses Google Gemini AI to extract, categorize, and summarize transactions from bank statements and credit reports — containerized with Docker for cloud deployment.
| Capability | Description |
|---|---|
| Bank Statement Analysis | Extracts transactions from PDF bank statements using Gemini vision, calculates debit/credit/balance, and identifies recurring patterns |
| Credit Report Analysis | Parses credit report PDFs to extract credit score, open loans, credit cards, and overdue status |
| AI-Powered OCR | Converts PDF pages to images and uses Gemini multi-modal models for high-accuracy data extraction |
| Parallel Processing | Distributes workload across up to 4 Google API keys using ThreadPoolExecutor for faster analysis |
| Beneficiary Normalization | Groups and normalizes beneficiary names using AI to unify similar entries (e.g., "apollo pharmacy" → "Apollo Pharmacy") |
| Monthly Summaries | Generates month-by-month credit/debit breakdowns and transaction-type analysis (UPI, ECS, NACH, ACH) |
| Recurring Transaction Detection | Identifies beneficiaries with transactions across ≥ 3 months |
| Cloud-Native Storage | Uploads/downloads files via Google Cloud Storage (GCS) for scalable, stateless processing |
| Streamlit Frontend | Interactive web UI for file upload and result visualization with tables and summaries |
┌─────────────────────┐ ┌──────────────────────────┐
│ Streamlit Frontend│────────▶│ FastAPI Backend │
│ (port 8080) │ HTTP │ (port 8000) │
│ │◀────────│ │
└─────────────────────┘ │ ┌────────────────────┐ │
│ │ bank_data_analyzer │ │
│ │ credit_report_ │ │
│ │ analyzer │ │
│ └────────┬───────────┘ │
└───────────┼──────────────┘
│
┌─────────────────┼─────────────────┐
▼ ▼ ▼
Google Cloud Gemini AI API Groq API
Storage (GCS) (Vision + Text) (Auxiliary)
Both services are containerized with Docker for deployment.
Finlyzer/
├── requirements.txt # Unified Python dependencies (backend + frontend)
│
├── back gke/ # Backend service
│ ├── main.py # FastAPI app — /upload, /process, /health endpoints
│ ├── bank_data_analyzer.py # Bank statement processing pipeline (9 steps)
│ ├── credit_report_analyzer.py # Credit report extraction pipeline
│ ├── Dockerfile # Backend container (Python 3.12 + Poppler)
│ ├── .env.template # Environment variable template
│ ├── credentials.template.json # GCP service account key template
│ └── .gitignore
│
└── front gke/ # Frontend service
├── app.py # Streamlit web application
├── Dockerfile # Frontend container (Python 3.12)
├── .env.template # Environment variable template
└── .gitignore
- Python 3.12+
- Poppler (required by
pdf2imagefor PDF-to-image conversion)- Windows: download from poppler-windows and add to
PATH - Linux/Docker:
apt-get install -y poppler-utils
- Windows: download from poppler-windows and add to
- Google Cloud Platform account with:
- A GCS bucket created
- A service account key (
credentials.json) with Storage Admin permissions - Gemini API key(s) from Google AI Studio
- Groq API key from Groq Console (used for auxiliary extraction)
- Docker (for containerized deployment)
git clone <repository-url>
cd "Finlyzer"cd "back gke"
# Create environment file from template
cp .env.template .env
# Create credentials file from template
cp credentials.template.json credentials.jsonEdit .env with your actual values:
GOOGLE_API_KEY=your-primary-gemini-api-key
GOOGLE_API_KEY_2=your-second-gemini-api-key
GOOGLE_API_KEY_3=your-third-gemini-api-key
GOOGLE_API_KEY_4=your-fourth-gemini-api-key
GCS_BUCKET_NAME=your-gcs-bucket-name
GOOGLE_APPLICATION_CREDENTIALS=credentials.json
GROQ_API_KEY=your-groq-api-keyEdit credentials.json with your actual GCP service account key.
# Install dependencies (from project root)
pip install -r ../requirements.txt
# Run the backend
uvicorn main:app --host 0.0.0.0 --port 8000 --reloadcd "front gke"
# Create environment file from template
cp .env.template .envEdit .env:
GOOGLE_API_KEY=your-gemini-api-key
BACKEND_URL=http://localhost:8000
GCS_BUCKET_NAME=your-gcs-bucket-name# Install dependencies (from project root)
pip install -r ../requirements.txt
# Run the frontend
streamlit run app.py --server.port 8080The app will be accessible at http://localhost:8080.
cd "back gke"
docker build -t finlyzer-backend .
docker run -p 8000:8000 \
-e GCS_BUCKET_NAME=your-bucket \
-e GROQ_API_KEY=your-groq-key \
-v /path/to/credentials.json:/app/credentials.json \
finlyzer-backendcd "front gke"
docker build -t finlyzer-frontend .
docker run -p 8080:8080 \
-e BACKEND_URL=http://host.docker.internal:8000 \
finlyzer-frontend| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Health check — returns service status |
GET |
/health/ |
Detailed health — includes bucket name |
POST |
/upload/ |
Upload a PDF file to GCS — returns { filename } |
POST |
/process/ |
Process uploaded files — accepts applicant_no, bank_file_name, credit_file_name |
curl -X POST http://localhost:8000/process/ \
-F "applicant_no=12345" \
-F "bank_file_name=<uploaded_filename>.pdf" \
-F "credit_file_name=<uploaded_filename>.pdf"The bank_main() function orchestrates a 9-step pipeline:
| Step | Action |
|---|---|
| 1 | Extract transactions from PDF via Gemini Vision (parallel across API keys) |
| 2 | Calculate Previous Balance, Debit, and Credit from sequential balances |
| 3 | Generate monthly credit/debit/net summary |
| 4 | Extract beneficiary names from descriptions using AI (parallel batches) |
| 5 | Normalize beneficiary names to unify duplicates |
| 6 | Group transactions by beneficiary |
| 7 | Identify recurring transactions (≥ 3 months) |
| 8 | Summarize recurring transactions with averages |
| 9 | Analyze transaction types (UPI, ECS, NACH, ACH) by month |
| Variable | Required | Description |
|---|---|---|
GOOGLE_API_KEY |
✅ | Primary Gemini API key |
GOOGLE_API_KEY_2 |
⬜ | Second API key for parallel processing |
GOOGLE_API_KEY_3 |
⬜ | Third API key for parallel processing |
GOOGLE_API_KEY_4 |
⬜ | Fourth API key for parallel processing |
GCS_BUCKET_NAME |
✅ | Google Cloud Storage bucket name |
GOOGLE_APPLICATION_CREDENTIALS |
✅ | Path to GCP service account JSON (default: credentials.json) |
GROQ_API_KEY |
✅ | Groq API key for auxiliary text extraction |
| Variable | Required | Description |
|---|---|---|
BACKEND_URL |
✅ | Backend API URL (default: http://localhost:8000) |
GOOGLE_API_KEY |
⬜ | Gemini API key (if used) |
GCS_BUCKET_NAME |
⬜ | GCS bucket name |
Caution
- Never commit
credentials.jsonor.envfiles to version control. - Use
credentials.template.jsonand.env.templateas references. - The
.gitignorefiles are configured to exclude sensitive files. - All API keys and service account paths are loaded from environment variables.
| Layer | Technology |
|---|---|
| Backend | Python, FastAPI, Gunicorn, Uvicorn |
| Frontend | Python, Streamlit |
| AI/ML | Google Gemini (1.5 Pro, 2.5 Pro), Groq, Agno framework |
| Cloud Storage | Google Cloud Storage |
| PDF Processing | pdf2image, pdfplumber, Poppler |
| Containerization | Docker |
| Data Processing | Pandas, NumPy |
This project is proprietary. All rights reserved.