Inspiration

We were inspired by OpenAI's ChatGPT and wanted to utilise its generative abilities in a field with an excess of documentation i.e. law.

What it does

AI Legal Assistant, as the name suggests, is an AI chatbot to help users with all law-related queries, providing legal answers with accurate judicial context. It has a RAG model trained on the Indian Penal Code, and a Judgement Predictor neural network model trained on a corpus of 35000 Supreme Court cases. It also has a built-in feature to generate ready-to-download legal documents with just a single prompt.

How we built it

We used LangChain and HuggingFace to use the InLegalBERT model to leverage LLM's generative features, with a few embedding and vector store systems to manage the RAG model trained on IPC texts. We also referred to several research papers on developing a Bi-GRU neural network for judgment prediction based on the analysis of provided case files. All this is under a slick-looking dark-themed Streamlit user interface.

Challenges we ran into

We ran into challenges with LangChain while trying to get the chatbot to remember conversations and store chats. Due to several deprecated functions and updates in the LangChain library, we had to read the LangChain docs heavily during the dev process to fix the issues. We also faced a few issues while training the Judgment Predictor model, as it required over 35000 documents as training data to accurately predict the court verdict.

Accomplishments that we're proud of

We're very proud of the way AI Legal Assistant works, it handles all the functionalities quite neatly without any under-the-hood issues. We're also very proud of our RAG model, allowing the user to converse with the Indian Penal Code, ensuring their legal queries are solved correctly. Our innovative features ie. the Legal Doc Generator and the Judgment Predictor are also key accomplishments of this project.

What we learned

We learned about the potential of AI in law and justice. With new laws and amendments introduced yearly, LLM and RAG-based chatbots like AI Legal Assistant are set to become essential tools for lawyers and judges to maintain legal standards. We've also learned much about ourselves as developers and as a team.

What's next for AI Coding Assistant

Future of AI Legal Assistant: Adding more law texts to the RAG model to solve legal issues from around the globe, and also international laws from the UN. Integrating more tools and features to help lawyers with document creation and editing, along with file management.

Built With

Share this project:

Updates

Submission history