Inspiration

From Jaipur to Jakarta, Nairobi to New York, everyday people face the same problem: dense legal text in refund policies, rental agreements, and online terms that few can understand. When a product arrives damaged or a service is not delivered, many do not know how to respond or draft a complaint. We built Nyaya Saathi (“justice companion”) to make basic legal understanding and consumer advocacy accessible to anyone with a smartphone—starting in India, but designed for the world.

What it does

Nyaya Saathi is an AI-powered web app that:

Accepts any legal or consumer text (refund policies, agreements, terms of service) in any country.

  • Uses Google Gemini API to:
    • Identify key clauses (refund, cancellation, payment, privacy, penalties, auto-renewal).
    • Explain each clause in simple, globally understandable language.
    • Flag potentially unfair or one-sided terms.
  • Lets users describe a consumer problem and generates a polite, structured complaint draft they can send via email or messaging.
  • Saves analyses and drafts in the user’s personal history.

This tool provides general information, not legal advice. Laws vary by country; users should consult local resources for specific rights.

How we built it

Backend: Python + Flask Database: SQLite (users, cases, clauses, complaints) AI: Google Gemini API (gemini-3.5-flash lite) Frontend: HTML, CSS, JavaScript (mobile-friendly) Auth: Session-based login/register with hashed passwords chatbots:ChatGPT and perplexity to make code more better and scalable . **I use AI to make a voice for my video .

Key endpoints:

  • /api/simplify: Sends document text to Gemini, returns simplified clauses as JSON.
  • /api/complaint: Sends problem type + description to Gemini, returns a complaint draft.

We designed prompts to be jurisdiction-neutral and added error handling for API limits so the app remains usable worldwide.

Challenges we ran into

  • Replacing hardcoded responses with dynamic AI calls that work across different document types.
  • Designing prompts that return stable, clause-focused JSON without assuming any one country’s laws.
  • Handling free-tier quota limits gracefully with fallback messages.
  • Keeping explanations simple, accurate, and globally relevant.

Accomplishments that we're proud of

  • A working end-to-end app that can help a student in India, a freelancer in Brazil, or a shopper in Kenya understand their agreements and take action.
  • Real AI integration so answers change based on the user’s actual text, not templates.
  • Secure, deployable design: API keys server-side, clear disclaimers, and fallback behavior.

What we learned

  • How to integrate an LLM API into Flask securely and scalably.
  • The importance of structured prompts and JSON output for legal-adjacent tasks across cultures.
  • That plain-language explanations can empower people everywhere, not just in one region.
  • Practical lessons in error handling, global UX, and Git workflows under hackathon pressure.

What's next for Nyaya Saathi

Multilingual support: Hindi, Spanish, Arabic, French, and more to reach non-English speakers. Region-aware guidance: Optional country selection to tailor explanations and complaint templates to local consumer-protection frameworks. Mobile app & PWA: Make Nyaya Saathi installable on low-end phones with offline caching. Partnerships: Collaborate with global consumer-rights NGOs, legal clinics, and civic-tech groups to distribute the tool where legal help is scarce. Open-source core: Release the clause-analysis logic so developers worldwide can adapt it to their local laws and languages.

Nyaya Saathi started as a hackathon prototype in India, but our vision is global: a free, accessible companion that helps anyone—anywhere—understand their rights and speak up when things go wrong.

Built With

Share this project:

Updates

Submission history