Democratizing credit access for 190M+ credit-invisible Indians through conversational AI
190M+ Indians are credit-invisible — they can't access formal loans because:
- Bank processes are complex and intimidating
- Forms and communication are English-only
- No guidance through the application process
- Loan decisions feel arbitrary with no explanation
Loner is a conversational multi-agent AI system that guides anyone through the entire loan application process — in their own language, with voice support, and with every decision grounded in actual policy documents.
- 🤖 Multi-Agent Architecture — 4 specialized LLM agents handle different stages
- 🔍 RAG Pipeline — ChromaDB + Gemini embeddings for policy-grounded decisions
- 🎙️ Voice Support — Hands-free interaction with speech-to-text and text-to-speech
- 🌐 Multilingual — Full support for English, Hindi, and Spanish
- 📄 OCR Salary Verification — Tesseract OCR with LLM fallback
- 🛡️ Output Guardrails — Validates LLM responses for policy compliance
- 📊 Audit Trail — Complete SQLite logging of all decisions
User
↓
Frontend (TypeScript/Vite)
↓
Backend (Python/Gradio)
↓
Agent Router
↙ ↓ ↓ ↘
Sales Verify Underwrite Sanction
↓
RAG Pipeline
↙ ↘
ChromaDB Gemini API
(Vector DB) (Embeddings + LLM)
↓
Policy Documents
(RBI Guidelines, Loan Policy)
1. Sales Agent → Understand loan needs, collect amount & tenure
2. Verification Agent → KYC verification
3. Underwriting Agent → RAG-powered decision with policy citations
4. Sanction Agent → Generate sanction letter
loan_policy.md
↓
Chunked (500 tokens, 50 overlap)
↓
Gemini Embeddings (gemini-embedding-001)
↓
Stored in ChromaDB
↓
At underwriting: query → top 3 relevant chunks
↓
Injected into Gemini prompt
↓
Policy-grounded decision reason ✅
Without RAG:
Decision: REJECTED
Reason: "Low credit score" ← generic, unhelpful
With RAG:
Decision: REJECTED
Reason: "Per Section 4.2, applicants with CIBIL
score below 700 are auto-rejected. Your score of
650 falls below the minimum threshold required
for personal loans." ← grounded in actual policy
| Layer | Technology |
|---|---|
| LLM | Google Gemini 2.5 Flash |
| RAG | LangChain + ChromaDB |
| Embeddings | Gemini Embedding 001 |
| Backend | Python, Gradio, FastAPI |
| Frontend | TypeScript, Vite |
| Database | SQLite |
| OCR | Tesseract + LLM fallback |
| Containerization | Docker + Docker Compose |
- Python 3.11+
- Node.js 18+
- Tesseract OCR
- Docker (optional)
# Clone the repo
git clone https://github.com/sam131725/loner-ai-loan-assistant.git
cd loner-ai-loan-assistant
# Add your API key
cp backend/.env.example backend/.env
# Edit backend/.env and add GEMINI_API_KEY
# Run everything
docker-compose up --buildBackend:
cd ey_techathon
pip install -r backend/requirements.txt
# Set environment variables
cp backend/.env.example backend/.env
# Add your GEMINI_API_KEY to backend/.env
# Ingest knowledge base
python -m backend.rag.ingest
# Start backend
python backend/app_gradio.pyFrontend:
cd frontend
npm install
npm run devAccess:
- Frontend: http://localhost:3002
- Backend: http://localhost:7871
Create backend/.env:
GEMINI_API_KEY=your_key_here
GEMINI_MODEL=gemini-2.5-flash
APP_DB_PATH=backend/output/app.db
USE_GENAI=trueGet your free Gemini API key at: aistudio.google.com
loner/
├── backend/
│ ├── agents/ # Sales, Verification, Underwriting, Sanction
│ ├── rag/ # ingest.py, retriever.py
│ ├── utils/ # llm.py, ocr, guardrails
│ ├── db/ # SQLite + ChromaDB
│ ├── data/ # Knowledge base documents
│ └── app_gradio.py # Main application
├── frontend/ # TypeScript/Vite frontend
├── Dockerfile.backend
├── Dockerfile.frontend
├── docker-compose.yml
└── README.md
- Speech-to-Text — Web Speech API, auto-transcription
- Text-to-Speech — Agent responses spoken aloud
- Multi-language Voice — Works in EN, HI, ES
Output validation ensures:
- Decisions are only APPROVED / REJECTED / CONDITIONAL
- Interest rates are within valid policy ranges
- No PII leakage between sessions
- Responses reference actual policy rules
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License — see LICENSE for details.
Built with ❤️ to make financial services accessible to everyone

