Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FinSight India 🇮🇳 Agentic RAG financial research assistant for Indian markets FinSight India enables deep financial research over Indian company annual reports and RBI regulatory circulars. It combines hybrid retrieval (dense semantic + BM25 sparse, fused with Reciprocal Rank Fusion) with agentic tool-calling to deliver cited answers in real time.

Why this exists: Financial documents are long, jargon-heavy, and regulation-dense. Pure vector search misses exact-match terms (section numbers, ratios, circular IDs); pure keyword search misses paraphrases. FinSight uses both, lets an agent decide which knowledge base to query, and cites every claim — the same architecture family I deployed in production during my AI/ML internship at Federal Bank, where a related pipeline improved NL2SQL accuracy from 25.9% to 83.0% on a 1,000-query test set.

Architecture text

User Query ↓ [Query Decomposition Agent] ← Groq Llama 3.3 70B + Tool Calling ↓ ↓ [Annual Reports] [RBI Circulars] ↓ ↓ [Hybrid Retriever: Dense (fastembed BGE) + BM25 → RRF Fusion] ↓ [Streamed Answer with Inline Citations] Key technical features

Hybrid RAG: dense (cosine similarity via ChromaDB) + sparse (BM25), fused with Reciprocal Rank Fusion Agentic: multi-step tool-calling — the agent decides which knowledge bases to query and when to stop Streaming: real-time SSE surfacing thinking steps, tool calls, and answer generation Grounded: every answer carries inline citations back to source pages Indian context: optimized for NSE/BSE annual reports, RBI circulars, SEBI regulations Roadmap: from demo to measured system The next phase is rigorous evaluation, not more features:

Benchmark the retrieval stack on public NL2SQL datasets (Spider, BIRD) — reproducible harness, accuracy tables, and per-error-category analysis Retrieval ablations: dense-only vs BM25-only vs hybrid vs hybrid+reranker A small gold-standard Q&A set over public RBI circulars for grounded-answer evaluation (faithfulness + citation precision) Latency/cost profiling per pipeline stage If you work on retrieval evaluation or financial NLP and want to collaborate, I'd love to hear from you — kevin.joseph@mba.christuniversity.in

Tech Stack Layer Technology LLM Groq — Llama 3.3 70B Versatile Embeddings fastembed — BAAI/bge-small-en-v1.5 (ONNX) Vector DB ChromaDB (persistent, cosine similarity) Sparse Retrieval BM25 (rank-bm25) Backend FastAPI + Uvicorn Frontend Next.js 14 + TailwindCSS PDF Parsing pypdf Quick Start Prerequisites Python 3.11+ Node.js 18+ Groq API key (free) Backend Bash

cd backend pip install -r requirements.txt cp .env.example .env # add your GROQ_API_KEY python main.py # → http://localhost:8000 Frontend Bash

cd frontend npm install npm run dev # → http://localhost:3000 Usage Open http://localhost:3000 Click Add Document in the sidebar Upload an Indian company annual report (PDF) or RBI circular Ask questions — the agent searches the knowledge base and cites sources 📂 Project Structure text

FinSight-India/ ├── backend/ │ ├── main.py # FastAPI application & endpoints │ ├── config.py # Configuration & constants │ └── rag/ │ ├── ingestion.py # PDF → chunks → ChromaDB pipeline │ ├── retriever.py # Hybrid retriever (dense + BM25 + RRF) │ └── agent.py # Agentic loop with streaming SSE └── frontend/ ├── app/ # Next.js chat interface └── components/ # Sidebar, ThinkingSteps, CitationPanel, Upload 🔌 API Endpoints Method Endpoint Description POST /api/chat Streaming SSE chat (agentic RAG) POST /api/documents/upload Upload & ingest PDF GET /api/documents List knowledge base documents DELETE /api/documents/{id} Remove document GET /api/health Health check ⚠️ Disclaimer FinSight India is for research and educational purposes only. It does not constitute financial, investment, or legal advice. Consult a SEBI-registered financial advisor for investment decisions.

Originally built for The Arch: RAG and Agentic AI Hackathon (Unstop); now maintained as an ongoing research project.

About

Agentic RAG financial research assistant for Indian markets Hybrid retrieval (ChromaDB + BM25) over annual reports & RBI circulars, powered by Groq Llama 3.3 70B with real-time streaming and cited answers.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages