Inspiration
Accessing legal information, especially legal advice can be (and often is) both time-consuming and expensive. It is difficult to reach out and schedule consultation meetings with lawyers and law firms, considering the time conflicts with a work schedule and price. We wanted to create an AI-powered legal assistant that skips the consultation step of the process--with it, one can get free legal consultation and advice, at any time, and anywhere.
What it does
Lawrence is an AI-driven legal chatbot that engages in multiturn conversations to provide legal guidance and generates personalized standard legal summaries in the form of a PDF based on user conversations for future lawyers that the client may hire. Lawrence also has a feature to help users find local lawyer referrals based on location and field.
How we built it
We used FastAPI for the backend to handle chatbot interactions and PDF generation. Additionally, we used OpenAI's GPT-3.5 API for legally-driven conversations and FPDF package in Python to generate the structured summaries of conversations. JavaScript was used to connect the frontend and backend smoothly, and ensure they work well alongside each other.
Challenges we ran into
The most significant challenge that we ran into was handling GitHub push protection errors when securing API keys. Anytime a new iteration of code was needed to be pushed to GitHub, the painful and tedious process of securing the API keys entered our vision. Additionally, generating the PDFs was difficult without any errors at first, because it required locally storing data such that the privacy of users was not violated.
Accomplishments that we're proud of
It was the team's first time experimenting with a multiturn AI chatbot, and building onto that was definitely tricky but a really interesting learning experience as well. Backend integration proved to be quite smooth, and we are really glad it went well.
What we learned
We learned the most efficient ways to run an AI chatbot with several different features, and how to process user conversations and apply them in each feature. We also learned to polish API calls, because any unnecessary code would decrease performance and efficiency severely.
What's next for Lawrence
The first future goal we have in mind for Lawrence is to improve lawyer referral accuracy with real-time legal directories, which would require us connecting a real-time directory/location API that would provide us with insight on the information of different law firms. Additionally, the generated PDF file that we use is very finicky, and we want it to be more stable in terms of consistent output. Finally, multilingual support is an ultimate goal that we hope to achieve.
Built With
- css
- fastapi
- fpdf
- html
- javascript
- openai
- pypdf
- python
Log in or sign up for Devpost to join the conversation.