Inspiration

Access to legal information in India is often difficult for ordinary citizens. Legal language is complex, professional help is expensive or inaccessible for many people, and most legal resources are not designed for mobile-first access. The goal of this project was to build a simple and accessible mobile application that allows people to understand legal provisions, explore important acts, and ask legal questions directly from their phones. By combining AI assistance with structured legal datasets, the project aims to make basic legal awareness more accessible to everyone.

What it does

This project is an AI-assisted mobile legal information platform designed to help users explore laws and understand legal provisions easily.

Key features include:

AI Legal Assistant (Powered by Google Gemini) Users can ask legal questions in natural language such as “What happens if someone files a false FIR?” or “What IPC section applies to theft?”. The query is processed using the Google Gemini API, which analyzes the question and generates a structured explanation along with relevant legal sections.

Bare Acts Explorer The application includes searchable datasets of important legal acts such as:

Indian Penal Code (IPC)

Code of Criminal Procedure (CrPC)

Civil Procedure Code (CPC)

Indian Evidence Act (IEA)

Motor Vehicles Act (MVA)

These acts are stored locally in structured JSON format, allowing users to browse and search legal provisions efficiently.

FIR Draft Generator The app provides a guided FIR form that helps users generate a structured FIR draft. The final output can be exported as a PDF document.

Document and Case Organizer Users can store legal documents and maintain simple case notes locally within the app for personal reference.

Voice Query Support Users can also speak their legal question using voice input, which is converted into text and processed by the AI assistant.

How we built it

The application follows a mobile-first architecture built with modern cross-platform technologies:

React Native with Expo SDK

TypeScript for maintainable and safe code structure

Google Gemini API for natural language understanding and legal explanation generation

Local JSON legal datasets for offline browsing of bare acts

AsyncStorage for local persistence of documents and case data

react-native-html-to-pdf for FIR document generation

react-native-voice for speech-to-text legal queries

The system combines AI responses generated by Gemini with locally stored legal datasets, enabling fast responses while keeping the application lightweight.

Why Gemini was the best choice for this project

Legal questions are often written in casual language, while legal provisions are written in formal legal terminology. This gap makes it difficult for traditional search systems to map user questions to the correct law sections.

The Google Gemini API was used because of its strong capabilities in:

Natural Language Understanding Gemini can interpret everyday questions and convert them into structured legal explanations.

Contextual Reasoning Instead of returning raw legal text, Gemini generates simplified explanations of relevant legal provisions.

Structured Output Generation Through prompt design, the AI assistant returns responses in a predictable structure, making it easier for the app to display explanations and related sections.

Scalability for Future Legal Features Gemini makes it possible to extend the system toward features such as multilingual legal guidance, legal document summarization, and conversational legal assistance.

Using Gemini allows the application to act as an AI legal guide, bridging the gap between complex legal documents and everyday users.

Challenges we ran into

Large legal datasets Legal acts contain thousands of sections and large text blocks. Efficient data loading and list rendering were required to maintain performance.

Data normalization Legal documents had to be converted into structured JSON format before they could be used inside the mobile application.

Mobile performance optimization Rendering large legal texts while keeping the application responsive required careful UI optimization.

Form validation for FIR generation Handling various input combinations such as multiple accused or optional details required structured validation logic.

Accomplishments that we're proud of

Built a fully functional AI-assisted legal mobile application

Successfully integrated Google Gemini API for legal query assistance

Created a mobile-friendly searchable legal acts database

Implemented FIR PDF generation directly from mobile devices

Designed an interface that makes legal information easier for non-lawyers to understand

What we learned

Structuring large legal datasets is critical for building usable legal tools.

Mobile UX design must be carefully optimized when displaying text-heavy content.

TypeScript helps reduce errors in complex forms and data structures.

AI systems like Gemini can significantly improve accessibility to domain-specific knowledge when paired with structured data.

What’s next for LawAI Mobile

Multilingual Legal Assistance Future versions will support multiple Indian languages such as Hindi, Bengali, and Tamil so that users can ask legal questions and read explanations in their preferred language. This will make the platform accessible to a much larger population.

Improved AI Legal Guidance The AI assistant powered by Gemini will be improved with better prompts and structured responses so that it can provide clearer explanations, identify relevant legal sections more accurately, and guide users step-by-step through common legal scenarios.

Advanced Legal Search The bare acts database will be expanded with better filtering, keyword search, and section linking so users can quickly navigate large legal documents and find relevant provisions.

Enhanced Voice Interaction Voice query support will be improved to make it easier for users to ask legal questions through speech, helping people who are not comfortable typing long queries.

Legal Document Tools Additional document templates such as complaints, affidavits, and simple legal notices may be added so users can generate commonly used legal documents directly from the mobile app.

Case Tracking Features Future versions may allow users to track basic case information, maintain notes, and organize related documents within the application.

Better Accessibility and UI Improvements Continuous improvements in design, typography, and navigation will make the application easier to use for people unfamiliar with legal terminology.

The long-term vision is to evolve LawAI Mobile into a simple, AI-assisted legal companion that helps citizens understand laws, generate basic legal documents, and access legal information directly from their mobile devices.

Built With

  • asyncstorage
  • axios
  • cpc-json
  • crpc-json
  • expo-file-system
  • expo.io
  • google-gemini-api
  • iea-json
  • ipc-json
  • react-native
  • react-native-html-to-pdf
  • react-native-paper
  • react-native-reanimated
  • react-native-voice
  • react-navigation
  • typescript
Share this project:

Updates