About

BudgetLens is an AI-powered interface for Indian government financial data. It lets you ask plain-English questions and get sourced, accurate answers in seconds — a task that currently takes a data journalist 2 days.

The system combines Text-to-SQL (for structured budget and spending queries) with RAG (for document-based questions about CAG audit reports) to answer a wide range of questions.

Data Sources

  • Union Budget (Expenditure Profile Statement 3) — FY 2022-23 to 2026-27
  • CGA Monthly Accounts — actual spend vs budget, updated monthly
  • CAG Audit Reports — findings on government debt, railways, GST, and more
  • GEM Portal — government purchase orders and contracts
  • MGNREGA MIS — district-level fund flows across 37 states/UTs

How It Works

When you ask a question, a query router classifies it as either a data question (Text-to-SQL) or a document question (RAG). For data questions, AI generates a SQL query against the structured database. For document questions, it searches embedded CAG report chunks and synthesizes an answer with citations.

Every answer includes source references linking back to the original government documents.

Built With

Python, FastAPI, PostgreSQL + pgvector, Claude (Anthropic), OpenAI Embeddings, Next.js, Tailwind CSS, shadcn/ui, Recharts.