NyayaSetu

Inspiration

India's Right to Information Act gives citizens a powerful way to access public information. But exercising that right can become difficult as soon as a response is rejected.

RTI responses may contain technical legal language, unfamiliar exemptions, incomplete appeal instructions, and deadlines that are already running. A citizen should not need legal training to understand what a rejection says or determine the next procedural step.

Generic legal chatbots are not a safe solution. They can mix extracted facts, generated explanations, legal rules, and calculations into one confident answer. For a deadline-sensitive legal workflow, that lack of transparency can cause real harm.

I built NyayaSetu to explore a safer approach:

Use AI to understand language, deterministic software to apply legal rules, official sources to support conclusions, and human confirmation before action.


What It Does

NyayaSetu is an explainable AI copilot for Indian Central Government RTI responses.

A user can:

  • Photograph a response
  • Paste its text
  • Upload a plain-text document
  • Explore a prepared sample case

NyayaSetu then:

  • Uses on-device OCR to read photographed responses
  • Extracts dates, registration numbers, authorities, and cited exemptions
  • Asks the user to verify important facts before continuing
  • Uses an LLM to explain the response in plain language
  • Identifies document-level issues and ambiguities
  • Suggests useful questions for a first appeal
  • Explicitly states what the AI cannot determine
  • Calculates procedural deadlines using deterministic code
  • Checks for missing appeal information
  • Connects every legal rule to an official government source
  • Generates an editable first-appeal working packet
  • Provides an evidence checklist and print-to-PDF export

How It Works

NyayaSetu uses a hybrid architecture:

Photograph or response text
        |
        v
On-device Tesseract OCR
        |
        v
Human verification checkpoint
        |
        +-----------------------------+
        |                             |
        v                             v
Guarded Llama 3.3 LLM          Deterministic RTI engine
        |                             |
Plain-language explanation      Dates and procedural checks
Issues and questions             Official legal sources
Uncertainty disclosure          Auditable calculations
        |                             |
        +--------------+--------------+
                       |
                       v
             First-appeal packet

The production AI layer uses Llama 3.3 70B through Groq for low-latency interpretation.

The model must return a constrained JSON structure containing:

  • A plain-language summary
  • Document-grounded issues
  • Questions that may be raised
  • Explicit uncertainties
  • A safety limitation

The document is treated as untrusted data. Instructions found inside an uploaded document are never treated as system instructions.


Explainable AI, Not a Black Box

NyayaSetu separates every high-stakes conclusion into four visible stages:

  1. Document fact
  2. Official legal rule
  3. Deterministic calculation
  4. Suggested action

For example:

Fact

The response was received on 18 September 2026.

Rule

Section 19(1) provides a 30-day first-appeal period.

Calculation

$$ 18\text{ September} + 30\text{ calendar days} = 18\text{ October} $$

Suggested action

Prepare the first appeal by 18 October, after confirming the receipt date.

The language model cannot change this calculation.


AI Safety

Legal AI should be useful without pretending to be authoritative.

NyayaSetu therefore does not allow the LLM to:

  • Calculate legal deadlines
  • Select or invent legal rules
  • Generate unsupported citations
  • Decide whether an exemption was legally valid
  • Predict whether an appeal will succeed
  • Replace a lawyer or RTI practitioner

The user confirms extracted facts before analysis.

Missing information is shown as uncertainty instead of being guessed.

The prepared demonstration case uses a cached AI interpretation for reliability. Live documents use the deployed Groq-powered analysis endpoint.


Official Sources

The deterministic engine currently uses curated provisions and guidance from official sources, including:

  • Section 7(1): Standard response period
  • Section 7(6): Information after a delayed response
  • Section 7(8): Required rejection communication details
  • Section 10(1): Severability of non-exempt information
  • Section 19(1): First-appeal period
  • Official RTI Online first-appeal guidance

Every displayed legal rule includes:

  • Source authority
  • Relevant passage
  • URL
  • Review date

Privacy

Photographed documents are processed locally in the browser using Tesseract.js. The source image is not uploaded.

After the user verifies the extracted information, the confirmed text is sent to the configured AI provider for interpretation.

NyayaSetu does not intentionally persist:

  • Uploaded documents
  • User accounts
  • Analytics data
  • A document database

The application clearly discloses this privacy boundary before analysis.


Challenges I Faced

Separating AI From Legal Authority

The largest challenge was deciding what the model must never control.

It was tempting to ask one model to perform extraction, legal analysis, deadline calculation, and drafting. Instead, I divided the system into probabilistic and deterministic layers.

Making AI Output Auditable

A fluent answer is not necessarily a trustworthy answer.

I designed a reasoning ledger that lets users inspect the fact, rule, calculation, and action behind each recommendation.

Handling OCR Errors

A single incorrect date can change an appeal deadline.

I added a mandatory human checkpoint so users can correct OCR and extraction mistakes before the legal engine runs.

Preserving a Reliable Demo

External AI services can fail or become rate-limited.

NyayaSetu includes a prepared sample with cached AI output and a safe fallback state, while live documents still use the real production model endpoint.

Building Under Legal Uncertainty

RTI procedure contains exceptions and context-dependent questions.

Instead of pretending to cover every possibility, I limited the initial scope to the Central Government first-appeal workflow and surfaced assumptions explicitly.


What I Learned

The most important lesson was that responsible legal AI is not created by adding a disclaimer to a chatbot.

It requires architecture.

AI is effective for:

  • Understanding unstructured language
  • Translating technical text
  • Identifying ambiguity
  • Generating questions
  • Explaining uncertainty

Deterministic software is better for:

  • Deadline calculations
  • Required-field checks
  • Rule application
  • Citation control
  • Reproducible results

Combining these approaches produced a system that is both more useful and easier to audit.


Testing

The repository includes 13 automated checks covering:

  • Calendar arithmetic
  • Leap-year boundaries
  • Response-delay calculations
  • Expired appeal windows
  • Missing rejection details
  • Written and numeric Indian date formats
  • Prepared-case behavior
  • Official-source domain allowlisting
  • Source metadata integrity

I intentionally do not claim an unsupported AI, OCR, or legal-accuracy percentage.


Accomplishments

I am proud that NyayaSetu:

  • Uses real AI without giving it control over legal deadlines
  • Performs OCR locally in the browser
  • Requires human verification before analysis
  • Produces an actionable appeal packet rather than only a chatbot response
  • Shows uncertainty instead of hiding it
  • Links legal rules to official sources
  • Works on desktop and mobile
  • Has a live deployed application and public source code
  • Passes its complete automated test suite

What's Next

The next steps are:

  • Review with RTI practitioners and legal-aid organizations
  • Usability testing with students and first-time RTI applicants
  • Hindi and regional-language OCR and explanations
  • Verified First Appellate Authority lookup
  • Sandboxed PDF processing
  • A larger anonymized evaluation dataset
  • Additional administrative appeal workflows after expert review

NyayaSetu is not intended to replace legal professionals.

Its purpose is to make the first step understandable, transparent, and easier to take.


Try It

Live application: https://nyayasetu-neon.vercel.app

Source code: https://github.com/Utpal-Kalita/NyayaSetu

Built With

  • access
  • ai
  • artificial
  • civic
  • generative
  • groq
  • intelligence
  • justice
  • language
  • legal
  • llama
  • natural
  • ocr
  • processing
  • react
  • responsible
  • tech
  • tesseract.js
  • to
  • typescript
  • vercel
  • vite
Share this project:

Updates

Submission history