-
-
Effortlessly unlock the insights within legal documents AI technology.
-
-
A finished product giving relevant and important information about a deposition document we loaded into it.
-
LegalIQ giving a quick and succinct summary of the inputted legal doc.
-
The document loader as a modal, creating a new case and customized case ID.
-
The web app prompting the user to upload a case or select an existing case.
Inspiration
We were excited and inspired to use innovative and trending technologies such as OpenAI's GPT model and LangChain. These technologies have grabbed the world's attention and this hackathon is a perfect excuse to learn something new and build something incredible.
What it does
The application prompts the user to drag and drop files for a certain case number. After the user submits, an API route is called to upload the submitted files to local storage and a pinecone database, transcribing the text from PDFs and DocX into readable chunks for GPT. Afterward, the user can select the case number and prompt the bot for information regarding the documents for the case. The user, for instance, can ask to summarize the case into bulleted points, and GPT will respond as appropriate. Key points of the case can be queried as well, including the plaintiff, the client, or elements of the case.
How we built it
We started out by using a PERN stack (PineconeDb, Express, React, Node). From there, it was on to learning Langchain and learning the OpenAI API. We started with a small AI template and built off of it, making sure to incorporate LangChain's DocumentLoaders for pushing documents to the database. We initially used a script to load documents inserted into a docs folder but eventually moved on to programmatically uploading files with Express routes. After the backend is finished, we incorporated elements from Morgan and Morgan's branding and website with React components to create a convenient and respectable user experience.
Challenges we ran into
- Mobile
Our UI was difficult to program in the short time span on desktop, and we ran out of time before we were able to make the correct media queries and adaptable interface components. The backend took a lot of energy and commitment, taking away from user experience in mobile environments.
- Lack of Experience
Our team was a diverse group of individuals at different skill levels with different experiences in coding. Due to this, we had a bit of a hierarchy and had trouble working on multiple pieces of the project in tandem. We overcame this with hard learning effort and collaboration!
- Ports, routing
Using different operating systems, we took up unnecessary time resolving conflicts and fixing small errors in the ports and hosts.
- LangChain's confusing DocumentLoaders
LangChain's document loaders were one of the biggest obstacles on our path to a completed and thorough project. This was another portion where we had to learn entirely from scratch (hence the branch name "scratch"!).
- NPM packages
We had a large number of npm packages to import and install, giving us a lot to keep track of and a hard time with this.
Accomplishments that we're proud of
The functionality is seamless, and our UI is very user-friendly. Again, we learned a lot during this hackathon and we are all extremely proud of that. Our utilization of the OpenAI API in tandem with LangChain and Pinecone was something incredibly gratifying to finally piece together successfully.
What we learned
As stated before, we learned Pinecone Vector Databases, how to use the OpenAI API, React.js functionality, LangChain, and how to work together as a team in a time-crunch. We also learned a lot about legal documents and processes!
What's next for Legal IQ
Our app is incredibly scalable, and we believe it could be utilized in real-world situations at a variety of law firms. With more time, dedication, and learning, this web app could be a revolutionary change in the legal industry!
References
During the development process of our application, we referenced a prior repository following Github repo. The developers behind Legal IQ added more functionality, including (but not limited to): accepting and transcribing Word documents, prompt engineering to encourage more accuracy in the GPT responses, frontend development, and express routes.
Built With
- css
- express.js
- gpt
- html
- langchain
- node.js
- openai
- pinecone
- react.js



Log in or sign up for Devpost to join the conversation.