For recruiters and engineers
What I built, how it works, and how I know it works.
RegLens reads the Reserve Bank of India’s directions paragraph by paragraph and answers compliance questions with a citation on every sentence, or says the rules don’t cover it. I built it end to end: scraping, parsing, versioning, retrieval, evaluation, the product and its deployment, on free tiers only.
The two-minute tour
No account needed for the first five steps.
- 1Open with the question filled in
Ask a real compliance question
Every sentence of the answer carries the paragraph it came from. Hover a citation to see the source on the right.
- 2Try both dates
Ask about the past
Set “Rules in force on” to 1 October 2025 and ask about the cooling-off period on digital loans: the answer cites the repealed 2025 Digital Lending Directions, while today’s cites the rules that replaced them.
- 3Open the history
See a paragraph’s history
Click any paragraph number in a direction to see every version of it and the change that produced each.
- 4Open the repealed direction
See how a repeal is handled
Repealed directions stay available for earlier dates and are never used after the repeal.
- 5Open the gap check
Check a policy against every requirement
Paste a policy (or load the example) and see each RBI requirement in force marked covered, partly covered or missing, beside the closest passage. Compared by meaning in memory: never stored, never sent to an AI model.
- 6Sign in with Google
Share, follow and track (sign in)
Share any cited answer as a public page with a link preview, follow paragraphs to get an email when a reviewed change lands, and track obligations with your team.
How a question becomes a cited answer
Four services, one Postgres. No queues or microservices: each piece is small enough to read in an afternoon.
Decisions worth asking me about
- Every sentence cites a paragraph, or RegLens declines
- The model must tag each claim with source labels; a validator checks every label exists and every number appears in the cited text. Anything unsupported is dropped, and if nothing survives, the answer is “not covered”. Read the code
- Paragraph-level versions, so you can ask about any date
- Each direction is split at RBI’s own numbering (5(1)(ii), 38(d)). Amendments become new versions with effective dates, so “rules in force on 1 Oct 2025” is a filter, not a guess. Read the code
- Real regulatory churn, handled
- On 28 Nov 2025 RBI repealed 9,445 circulars, including the KYC and Digital Lending directions RegLens covered. A corrections layer records repeals by official URL; repealed text stays for earlier dates and is never used after. Read the code
- Hybrid search with measured trade-offs
- pgvector embeddings and a BM25-style full-text score fused with weighted reciprocal rank fusion; the weight was tuned on the dev set only. A cross-encoder reranker is built in but off in production, where memory is capped at 512 MB. Read the code
- A parser that respects legal numbering
- A label stack tells (i) the roman numeral from (i) the letter after (h), keeps lists as siblings, and resets on chapters. Parser changes are diffed across every stored document before release. Read the code
- Teams can’t see each other’s data
- Postgres row-level security scopes trackers and question history per organisation; the API runs those queries as a restricted role, and the web server signs every call with an HMAC token. Read the code
- Exactly-once change alerts
- Following a paragraph emails you when a reviewed change is approved. Alerts are claimed with row locks, so the API and the daily job can both run without double-sending. Read the code
- Production on free tiers, hardened
- ONNX embeddings fit Render’s 512 MB; a fallback chain spreads load over free LLM tiers; notes are AES-GCM encrypted at rest; strict CSP, rate limits and signed requests keep the API closed. Read the code
Measured, not assumed
Questions are split 60/40 before any tuning. Everything is tuned on the development set; the held-out set is written separately and run once per release. A retrieval gate in CI blocks merges that make search worse.
Stack
- Backend
- Python 3.12, FastAPI, SQLAlchemy 2, Alembic, uv workspace
- Data
- PostgreSQL 17 (Neon), pgvector, full-text search, row-level security
- Retrieval
- fastembed / ONNX (bge-small), RRF fusion, optional cross-encoder reranker
- LLMs
- Gemini, Groq and OpenRouter free tiers behind one fallback chain
- Frontend
- Next.js 16 (cache components, server actions), React 19, Tailwind, Auth.js
- Ops
- Render, Vercel, GitHub Actions (CI, quality gate, scheduler), Resend email
- Testing
- pytest against real Postgres, a dev and a held-out question set, CI retrieval gate
Built by Hemendu Tapraniya
Happy to walk through any part of it, from the parser to the evaluation.