Inspiration

In today’s fast-paced world, people often have to sign long, complex legal documents without fully understanding their contents. Studies show that over 80% of people skip reading terms and conditions entirely, leading to missed risks and obligations. Unfortunately, this can result in signing documents that contain hidden clauses, liabilities, or unfavorable terms, leading to serious consequences later. Legal professionals are expensive, and consulting a lawyer for every document may not be feasible for everyone. LegalAI was born out of the need to help individuals understand legal documents before consulting a lawyer. With the help of AI, we aim to reduce the time, cost, and effort associated with legal document review, empowering users to make informed decisions.

What it does

LegalAI allows users to upload legal documents and instantly receive a comprehensive analysis powered by advanced AI models. The platform automatically breaks down key sections, highlights risks, and provides recommendations, giving users clarity on: Clarity and Accuracy of Terms, Liabilities and Risks, Termination Clauses, Payment Terms, Confidentiality and Intellectual Property, Dispute Resolution, Obligations and Responsibilities, Warranties and Guarantees. Users can securely sign up via Google or email using PropelAuth for authentication, upload their documents via Uploadthing, and access detailed summaries, saving time and preventing costly mistakes.

How we built it

LegalAI is built using Next.js for the frontend and backend API routes, creating a seamless user experience. We use MongoDB Atlas to store user data and legal documents, ensuring scalability and security. User authentication is handled with PropelAuth, allowing for smooth OAuth and email-based signups. The document upload process is streamlined with Uploadthing, making it easy to manage files. The entire platform is hosted on AWS for reliable performance and scalability, with Terraform managing infrastructure as code to automate and maintain our AWS resources efficiently.

Challenges we ran into

One of the key challenges we faced was integrating authentication with MongoDB to securely link user documents to their accounts. Additionally, fine-tuning the LLM (Large Language Model) for accurate legal document analysis proved challenging. The AI model needed to be optimized through careful prompt engineering to extract meaningful insights, as the initial results weren’t delivering the depth of analysis we desired.

Accomplishments that we're proud of

We’re incredibly proud of creating a platform that makes legal document review accessible to everyone. LegalAI empowers users to make informed decisions without the immediate need for costly legal consultations. We’ve also successfully integrated a powerful LLM to generate reliable and accurate document summaries, which is a major accomplishment given the complexities of the legal domain.

What we learned

Through this project, we gained invaluable experience in connecting databases, handling user authentication, and deploying applications on AWS using Terraform. Moreover, this was our first time integrating a large language model into a real-world application, and we learned a lot about the complexities of AI and prompt engineering for legal document analysis.

What's next for Legal AI

We envision LegalAI evolving into a full-fledged legal assistant that can handle more complex documents, including international laws and regulations. We plan to integrate multi-language support, making the platform accessible to users worldwide. Additionally, we’re exploring the possibility of offering customized legal advice based on document types, further bridging the gap between AI analysis and human legal expertise.

Built With

Share this project:

Updates