Agentic RAG Financial Parser AI Agent
Enterprise RAG ecosystem managing 32000+ semantic chunks. Features hybrid parsing (LlamaParse/PyMuPDF) and 256-dim MRL embeddings for 512MB RAM environments
Agentic RAG Financial Parser is an open-source ai agent by Ambuj123-lab, written mainly in Python, with 110 GitHub stars and the AGPL-3.0 license. Its code was last updated Sep 30, 2026.
<a href="https://git.io/typing-svg"><img src="https://readme-typing-svg.demolab.com?font=Fira+Code&weight=600&size=22&pause=1000&color=D4A574&background=00000000¢er=true&vCenter=true&repeat=true&width=700&height=70&lines=11-Node+LangGraph+StateGraph+%7C+Agentic+RAG;WhatsApp+Bot+%7C+Gemini+Tool+Calling+%7C+HITL+Guards;Jina+MRL+%2B+Cohere+Rerank+%7C+%E2%82%B90%2Fmonth+Infra" alt="Typing SVG" /></a>
<br/> <p align="center"> <a href="https://onesvibe.app/projects/agentic-rag-financial-parser-onrender?ref=badge"> <img src="https://onesvibe.app/badge/agentic-rag-financial-parser-onrender.svg" alt="Live & checked on One's Vibe" height="32" /> </a> </p> </div>[!TIP]
🏆 Industry Recognition & Third-Party Audits
- Featured in UptimeRobot's Global Case Study: "How Ambuj Kumar Tripathi built an 11-Node Agentic RAG system with 99.9% uptime on $0 infrastructure" — Officially featured for resilient production architecture on 512MB RAM and cold-start elimination. 👉 Read Full Spotlight on UptimeRobot Blog →
- Verified & Showcased on One's Vibe: Discovered and verified on the global maker platform under Finance & Business with automated daily live checks, SSRF-guarded verification, and public try-count logging. 👉 View Live Project Wall on One's Vibe →
⚡ What Is This?
An autonomous, 11-node Agentic RAG pipeline that parses and queries complex Indian financial & legal documents — Union Budget, Finance Bill, Tax Laws, PF/Pension Schemes, RBI KYC, and Constitution of India — using a purpose-built state machine that thinks before it answers.
Unlike traditional RAG (retrieve → generate), this system employs an agentic flow where each query passes through specialized nodes that classify intent, cross-question vague queries, guard against hallucinations, and verify answer grounding — all orchestrated via LangGraph StateGraph.
🌿 Branches
| Branch | Description |
|---|---|
main | Production — stable, lean version live on Render (512MB RAM constraints) |
v2-local-heavy | Parallel Vector Retrieval + Cohere Neural Reranking. 👉 View Architecture |
🏗️ System Architecture
<div align="center"> <br/><img src="assets/rag_architecture_diagram_dark.png" width="100%" alt="Agentic Financial Parser — 11-Node Architecture"/> <br/> <sub>✨ Classifier → 6-Path Routing → Retrieval → Rerank → Generate → Hallucination Guard → Post-Process</sub> </div>🔮 11-Node LangGraph StateGraph — Animated Architecture
🧠 The 11-Node Agentic RAG Pipeline
| Node | Purpose | Key Detail |
|---|---|---|
| 1. Classifier | Intent detection + 6-path routing | Returns structured JSON: intent · doc_type · confidence · search_intents |
| 2. Reject | Safety guard | Blocks abusive + jailbreak queries with regex blocklist guardrail |
| 3. Greet | Efficiency bypass | Handles greetings without hitting vector DB (zero cost) |
| 4. CrossQuestioner | HITL clarification | Asks clarifying questions for vague queries (max 2 rounds) |
| 5. Retriever | Dual vector search | Jina MRL → Pinecone → Parent-Child Resolution → Cohere Rerank Top 10 |
| 6. Web Search | Out-of-scope fallback | Tavily API — only fires after HITL user permission |
| 7. Stock Tool | Native LLM tool calling | Gemini functionDeclarations + yfinance for live market data |
| 8. Generator | LLM synthesis | Gemini 3.5 Flash Lite (primary) with pybreaker circuit breakers |
| 9. HallucinationGuard | Answer verification | LLM-as-Judge — advisory mode (appends disclaimer, doesn't block) |
| 10. PostProcess | Persistence + streaming | MongoDB + Redis cache + Langfuse tracing + SSE stream |
| 11. Fallback | Circuit breaker recovery | pybreaker pattern: 3 API failures → graceful fallback message |
🔧 Tech Stack
<table> <tr> <td><b>Category</b></td> <td><b>Technology</b></td> <td><b>Purpose</b></td> </tr> <tr> <td rowspan="5"><b>RAG Engine</b></td> <td>LangGraph StateGraph</td> <td>11-node autonomous state machine orchestration</td> </tr> <tr> <td>Jina v3 (MRL)</td> <td>Matryoshka Representation Learning embeddings</td> </tr> <tr> <td>Cohere Neural Reranker</td> <td>Advanced Stage-2 semantic filtering (V2)</td> </tr> <tr> <td>LlamaParse</td> <td>LLM-native 3-tier document parsing</td> </tr> <tr> <td>Tavily Search API</td> <td>Live Web Search fallback for Out-of-Scope queries</td> </tr> <tr> <td rowspan="3"><b>Backend & APIs</b></td> <td>FastAPI + Uvicorn</td> <td>Async REST API with SSE streaming</td> </tr> <tr> <td>Authlib + PyJWT</td> <td>Google OAuth 2.0 + JWT session management</td> </tr> <tr> <td>WhatsApp Meta Cloud API</td> <td>Real-time user bot interaction via Webhooks</td> </tr> <tr> <td><b>Frontend</b></td> <td>React 19 + Vite</td> <td>SPA with lazy loading, dark theme, real-time streaming UI</td> </tr> <tr> <td rowspan="4"><b>Data Layer</b></td> <td>Pinecone Serverless</td> <td>14,662 vectors — core brain + ephemeral user uploads</td> </tr> <tr> <td>Supabase (PostgreSQL)</td> <td>Parent chunk storage + file registry</td> </tr> <tr> <td>MongoDB (Motor)</td> <td>Async chat history, feedback, user sessions</td> </tr> <tr> <td>Upstash Redis</td> <td>Semantic caching (<100ms) + rate limiting + analytics</td> </tr> <tr> <td rowspan="3"><b>Reliability</b></td> <td>Pybreaker</td> <td>Circuit breaker pattern — 3 failures → auto-open → 30s reset</td> </tr> <tr> <td>Langfuse</td> <td>Distributed tracing — LLM latency, token usage, cost tracking</td> </tr> <tr> <td>UptimeRobot</td> <td>GET/HEAD health monitoring — zero cold starts</td> </tr> <tr> <td><b>Deployment</b></td> <td>Docker (Multi-stage) + Render</td> <td>Frontend build → backend image → production serve</td> </tr> </table>📊 Infrastructure Scale
| Metric | Value |
|---|---|
| Total Chunks | 15,408 (Financial Parser Portfolio) |
| Live Vectors | 14,662 high-dimensional vectors in Pinecone (256d MRL) |
| Documents Indexed | 20+ Indian Government Acts & Financial Frameworks |
| Parent Chunks | Stored in Supabase for full-context retrieval |
| Cache Latency | <100ms (Upstash Redis semantic cache) |
| Rate Limit | 10 queries/min per user (Redis sliding window) |
| Session TTL | 24h auto-cleanup (MongoDB TTL indexes) |
📄 Documents Indexed
| Category | Documents |
|---|---|
| Financial | Union Budget 2024-25, Finance Bill 2024-25, Income Tax Amendments |
| Pension/PF | EPF Scheme 1952, EPS Pension Scheme 1995, PMVVY, APY |
| Banking | RBI KYC Master Direction 2016, UPI Guidelines |
| Legal | Constitution of India, Consumer Protection Act |
🔐 Security Architecture
7-Layer Upload Security Framework
─────────────────────────────────
Layer 1 │ Frontend Gating │ .pdf only, 10MB limit, accept='.pdf'
Layer 2 │ Magic Byte Verify │ %PDF- header validation (anti-spoofing)
Layer 3 │ Rate Limiting │ 5 uploads/day per user+IP (Redis)
Layer 4 │ SHA-256 Dedup │ Content-hash prevents re-indexing identical files
Layer 5 │ Session Isolation │ is_temporary: true — auto-deletes on logout
Layer 6 │ TTL Auto-Cleanup │ MongoDB 24h TTL on chunks + temp_uploads
Layer 7 │ Auth Guard │ JWT verification on every API endpoint
🚀 Quick Start
Prerequisites
- Python 3.11+
- Node.js 18+
- API Keys: OpenRouter, Pinecone, MongoDB, Supabase, Google OAuth
Local Development
# Clone
git clone https://github.com/Ambuj123-lab/agentic-rag-financial-parser.git
cd agentic-rag-financial-parser
# Backend
python -m venv venv && venv\Scripts\activate # Windows
pip install -r requirements.txt
cp .env.example .env # Fill in your API keys
uvicorn app.main:app --reload
# Frontend (new terminal)
cd frontend
npm install && npm run dev
Docker (Production)
docker build -t financial-parser .
docker run -p 8000:8000 --env-file .env financial-parser
📁 Project Structure
agentic-rag-financial-parser/
├── app/
│ ├── main.py # FastAPI app + SPA serving + health check
│ ├── api/
│ │ ├── auth.py # Google OAuth + JWT + dev-login
│ │ ├── oauth.py # Authlib Google client config
│ │ └── upload.py # 7-layer secure file upload
│ ├── core/
│ │ └── config.py # Pydantic Settings (env vars)
│ ├── db/
│ │ ├── mongodb.py # Async Motor client + indexes
│ │ ├── pinecone_client.py # Pinecone Serverless init
│ │ └── supabase_client.py # Supabase PostgreSQL client
│ └── rag/
│ ├── graph.py # ⭐ 11-Node LangGraph StateGraph
│ ├── routes.py # Chat endpoints + SSE streaming
│ ├── embedder.py # Jina v3 MRL embeddings
│ └── chunker.py # Markdown + recursive splitting
├── frontend/
│ ├── src/
│ │ ├── pages/ # Landing, Dashboard, Admin, AuthCallback
│ │ ├── context/ # AuthContext (JWT state)
│ │ └── api/ # Axios client with interceptors
│ └── vite.config.js # Dev proxy + code splitting
├── Dockerfile # Multi-stage: Node build → Python serve
├── requirements.txt # Pinned Python dependencies
└── .dockerignore # Minimal Docker context
🌐 Live Links
| Resource | URL |
|---|---|
| 🚀 Live Application | agentic-rag-financial-parser.onrender.com |
| 📖 RAG Documentation | ambuj-rag-docs.netlify.app |
| 👤 Portfolio | ambuj-ai-portfolio.vercel.app |
| 💻 Source Code | GitHub Repository |
👨💻 Author
Ambuj Kumar Tripathi GenAI Engineer & RAG Systems Specialist | LLMOps
📜 License
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
Due to the integration of PyMuPDF (which is licensed under AGPL-3.0) for high-performance PDF parsing, this repository inherits the AGPL-3.0 license to comply with open-source copyleft requirements.
<div align="center"> <img src="https://capsule-render.vercel.app/api?type=waving&color=gradient&customColorList=12,14,16,18,20&height=100§ion=footer" width="100%"/>
<sub>Built with 🧠 LangGraph • ⚡ FastAPI • ⚛️ React • 🔍 Pinecone • 🐘 Supabase • 🍃 MongoDB • 🔴 Redis</sub>
</div> <parameter name="Complexity">7Agentic RAG Financial Parser alternatives
View more →Similar ai agents in Data Science & ML, ranked by GitHub stars. Compare licence, recent activity and scan status before you choose.
| Name | Stars | Licence | Last updated | Scan |
|---|---|---|---|---|
| Agentic RAG Financial Parser (this page) Ambuj123-lab | 110 | AGPL-3.0 | Sep 30, 2026 | Scanned, no flagged issues |
| Ragflow infiniflow | 93k | Apache-2.0 | Oct 31, 2026 | Scanned, no flagged issues |
| Cherry Studio CherryHQ | 53k | AGPL-3.0 | Nov 1, 2026 | Scanned, no flagged issues |
| PageIndex VectifyAI | 40k | MIT | Oct 29, 2026 | Scanned, no flagged issues |
| Graphiti getzep | 32k | Apache-2.0 | Nov 1, 2026 | Scanned, no flagged issues |
| Cua trycua | 31k | MIT | Nov 1, 2026 | Scanned, no flagged issues |