LegalEase – AI-Powered Legal Chatbot for Constitutional Law
Inspiration
Understanding legal documents, especially the Indian Constitution, can be overwhelming for the average citizen. We were inspired by the idea of using AI to make constitutional law more accessible through a conversational interface. This project was our effort to democratize legal knowledge using modern language models and voice technology.
What We Learned
- How to integrate LLMs (Groq LLaMA-3) into real-time applications using LangChain.
- Using Pinecone vector databases for fast, context-based document retrieval.
- Building voice-enabled interfaces with the Google Web Speech API.
- Designing clean, modular UIs in Streamlit for both text and voice interaction.
- Managing tasks and collaboration through GitHub and Trello in an Agile environment.
How We Built It
- Frontend: Built with Streamlit for a responsive UI with modules like Chat, Explorer, and History.
AI Pipeline:
- Preprocessed Constitution PDFs into chunks.
- Created vector embeddings using HuggingFace Sentence Transformers.
- Stored them in Pinecone and retrieved them using LangChain’s RetrievalQA.
- Queried Groq LLaMA-3 for accurate legal responses.
Voice Integration: Added speech-to-text via Google Web Speech API.
Deployment: Hosted on Streamlit Cloud for accessibility.
Version Control: Managed source code on GitHub, with project tasks on Trello.
Challenges We Faced
Voice transcription inaccuracies due to noise or complex legal terms. Ensuring legal accuracy in AI-generated responses required expert validation. Optimizing vector search parameters for better relevance. Managing API rate limits under free-tier restrictions (Groq, Pinecone, Google).
Tech Stack
Python, Streamlit, Groq API (LLaMA-3), LangChain, Pinecone, HuggingFace Transformers, Google Web Speech API, GitHub, Trello, StarUML
Built With
- github
- google-web-speech-api
- groq
- groq-api-(llama-3)
- huggingface
- huggingface-transformers
- langchain
- pinecone
- python
- streamlit
- trello
Log in or sign up for Devpost to join the conversation.