Inspiration
India is home to over 500,000 IPO-eligible SMEs, yet only 150–200 of them list publicly each year. The bottleneck isn't ambition — it's paperwork. Preparing a Draft Red Herring Prospectus (DRHP) under SEBI ICDR Regulations costs ₹15–25 lakhs in advisory and legal fees and takes 4–6 months of manual auditing, drafting, and cross-verification. We kept hearing the same story from SME promoters: capable businesses, ready for capital markets, priced and timed out of the process by compliance complexity. We wanted to see if an agentic AI system could do for DRHP drafting what tax software did for filing returns — compress months of specialist labor into hours, without requiring the promoter to become a securities lawyer overnight.
What it does
IPO Sahayak is an agentic AI platform that takes an SME promoter from a bare Corporate Identification Number (CIN) to a substantially complete, SEBI ICDR-compliant DRHP:
- Auto-population — pulls and verifies company data via MCA21, GSTN, and Account Aggregator APIs, and uses LlamaParse + PyMuPDF to extract data from scanned MoAs, ITRs, and CA certificates, auto-filling ~70% of the required disclosures.
- Guided 8-panel wizard — a plain-language questionnaire covering Corporate Identity, Business Overview, Financial Dossier, Market & Channels, Use of Funds, Risk Assessment, Legal Disclosures, and Final Review.
- Hybrid RAG retrieval — combines BM25 lexical search with FAISS kNN semantic search (all-MiniLM-L6-v2 embeddings) and Reciprocal Rank Fusion to ground every generated clause in the right SEBI ICDR provisions and precedent disclosures.
- AI drafting engine — DeepSeek-V4-Flash converts raw business/financial input into formal legal clauses; DeepSeek-V4-Pro handles layout, statutory header hierarchies, and complex financial tables.
- Live SEBI ICDR compliance engine — real-time checks against eligibility norms (net worth thresholds, 3-year profitability, promoter dilution limits) with discrepancy alerts before finalization.
- ISO 27001 document vault — dual-panel viewer with in-browser highlighting, threaded comments, SHA-256 signature validation, and audit history for Merchant Bankers, CAs, and Legal Counsel to collaborate.
- Final output — a 200+ page DRHP and a 10-page Abridged Prospectus, generated and downloadable in one click, with Brevo-powered email handoff to the review team.
How we built it
- Frontend: Next.js 15 + React 18 + TypeScript + Tailwind CSS, with
react-pdf/PDF.js for the split-panel document viewer and in-browser highlighter, and Zustand/Context API for wizard and generation state. - Backend: Python 3.10+ FastAPI service exposing REST endpoints for upload, parsing, and status polling; Pydantic schemas map raw input to SEBI DRHP field structures.
- Document intelligence: PyMuPDF, pdfplumber, and LlamaParse extract text and structured tables (Revenue from Operations, EBITDA, Restated PAT, Net Worth) from scanned financials into normalized JSON.
- Retrieval: Elasticsearch (BM25) + FAISS (dense kNN) fused via Reciprocal Rank Fusion (RRF) to surface the most relevant statutory language into the LLM prompt window.
- Generation pipeline: A dedicated
jio_drhp_pipelinewith per-section runners (corporate/legal, financials, legal/regulatory, capital structure), a classifier for routing content into SEBI's 5 disclosure categories, a validator for ICDR compliance, and a layout/compiler stack (WeasyPrint, ReportLab, PyPDF2, pikepdf, LaTeX) for final PDF rendering, watermarking, and versioning. - Async processing: Celery + Redis queues offload PDF compilation and batch AI calls so the UI stays responsive during long-running generation jobs.
- Data layer: PostgreSQL for relational filing data, SQLite3 for document metadata, Redis for caching/broker duties.
- Communications: Brevo API for verification codes, team invites, and review handoff notifications.
Challenges we ran into
- Grounding LLM output in statute, not hallucination — getting DeepSeek-V4 to cite the correct SEBI ICDR clause required tuning the hybrid BM25 + FAISS + RRF retrieval so lexical exactness (act/section names) and semantic similarity (precedent disclosures) were weighted correctly.
- Messy source documents — scanned ITRs, CA certificates, and MoAs came in wildly inconsistent formats; building a table extractor robust enough to reliably normalize financials (EBITDA, Restated PAT, Net Worth) across formats took significant iteration.
- Compliance is a moving target across company types — encoding SEBI ICDR Chapter XB eligibility logic (net worth, 3-year profitability, promoter dilution) as a rules engine that scores and flags discrepancies in real time, rather than just a static checklist.
- Multi-party collaboration on legal documents — designing an in-browser highlighter/annotation and threaded comment system that Merchant Bankers, CAs, and Legal Counsel could all trust for a document with 200+ pages and audit-history requirements.
- Keeping the UI responsive — full DRHP compilation (layout + PDF rendering + compliance scoring) is heavy; moving this to Celery/Redis background workers without breaking the live progress indicators took careful orchestration.
Accomplishments that we're proud of
- Cutting projected DRHP preparation cost by 60–70% (₹15–25L → ₹5–8L) and timeline by ~70% (4–6 months → 4–6 weeks).
- Auto-filling ~70% of required disclosures directly from government APIs and OCR extraction, with zero specialist legal knowledge required from the promoter.
- A working hybrid retrieval engine (BM25 + FAISS + RRF) that keeps generated legal language anchored to real SEBI ICDR provisions.
- A full collaborative review loop — split-panel viewing, highlighting, comments, digital signatures, and email handoff — built on top of an ISO 27001-oriented document vault.
What we learned
- Regulatory-domain generation is as much a retrieval problem as a generation problem — the quality of the DRHP depends heavily on what context reaches the LLM, not just the model itself.
- Real-world financial documents are far messier than clean sample data, and OCR/table-extraction robustness is often the actual bottleneck in "AI for compliance" products.
- Async task design (Celery/Redis) is essential once you're compiling 200+ page legal PDFs with layout and compliance scoring in the loop.
What's next for IPO_SAHAYAK
- Expanding the SEBI rule engine to cover additional ICDR schedules and post-listing continuous disclosure requirements.
- Adding more government data integrations (deeper GSTN reconciliation, PAN verification workflows).
- Supporting additional exchanges/board segments beyond SME listings.
Built With
- deepseek
- elasticsearch
- email-checker
- faiss
- fastapi
- latex
- llamaparse
- next.js
- pdfplumber
- pikepdf
- postgresql
- pydantic
- pymupdf
- python
- react
- redis
- reportlab
- sqlite
- tailwindcss
- typescript
- uvicorn
- weasyprint


Log in or sign up for Devpost to join the conversation.