LawGPT is a Retrieval-Augmented Generation (RAG) AI attorney chatbot trained on the Indian Penal Code (IPC). Ask questions about your legal rights and get guidance according to the IPC. If you’re unfamiliar with your legal rights, this tool is perfect for you!
lawgpt.mp4
- Ask questions about your legal rights under the Indian Penal Code.
- Get accurate, context-aware responses using RAG and TogetherAI LLM.
- Easy to use via Streamlit or Hugging Face Spaces.
git clone https://github.com/harshitv804/LawGPT.git cd LawGPT
pip install -r requirements.txt
Run ingest.py (preferably on Kaggle or Colab for faster processing).
After processing, download the ipc_vector_db folder and save it locally.
This project uses the TogetherAI API for LLM inference.
To run the application, you need:
- A TogetherAI account
- Active TogetherAI credits
- An API key set as an environment variable
export TOGETHER_API_KEY="your_api_key_here" # Linux / macOS setx TOGETHER_API_KEY "your_api_key_here" # Windows
Note: TogetherAI is a paid service. Without active credits, the application will not generate responses.
If you do not have TogetherAI credits, you may replace the TogetherAI backend
with a local LLM (e.g., Ollama + LLaMA). This requires minor changes to app.py.
streamlit run app.py
Open the URL shown in the terminal to interact with LawGPT.
Questions or feedback? Raise a GitHub issue.
Contributions and feature requests are welcome!
