Skip to content

ghostreindeer09/LawGPT

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚖️ LawGPT - RAG-based Generative AI Attorney Chatbot

Know Your Rights! Better Citizen, Better Nation!

About The Project

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

Features ✅

  • 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.

Getting Started 🚀

1. Clone the repository

git clone https://github.com/harshitv804/LawGPT.git
cd LawGPT

2. Install required packages

pip install -r requirements.txt

3. Generate embeddings

Run ingest.py (preferably on Kaggle or Colab for faster processing).
After processing, download the ipc_vector_db folder and save it locally.


TogetherAI API Setup 💡

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

Set the API key

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.


Alternative (Local LLM) 🔄

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.


4. Run the App 🖥️

streamlit run app.py

Open the URL shown in the terminal to interact with LawGPT.


Contact 📬

Questions or feedback? Raise a GitHub issue.
Contributions and feature requests are welcome!

About

A RAG based Generative AI Attorney fed with Indian Penal Code data. Developed using Streamlit, LangChain and TogetherAI API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%