LawGPT is an AI-driven legal assistant designed to provide instant legal guidance, simplify complex legal concepts, and help users navigate legal matters efficiently. It leverages Retrieval-Augmented Generation (RAG) to enhance responses with document-based legal knowledge.
- AI-Powered Legal Guidance: Get instant answers to legal queries.
- Legal Research: Retrieve legal precedents, statutes, and regulations.
- Privacy & Security: User data is securely processed.
- Python 3.8+
- FastAPI
- Next.js (with TypeScript, Tailwind CSS, ShadCN, DrizzleORM, Clerk, NeonDB)
- HuggingFace Instruct Embeddings
- FAISS Vectorstore
- Gemini API
- Vercel
git clone https://github.com/ayuugoyal/lawgpt
cd lawgpt
pnpm install
pnpm run dev
-
Document Upload & Embeddings:
- Upload PDFs via FastAPI endpoint.
- Extract text using
PyPDF2
. - Split text into chunks using
langchain.text_splitter
. - Generate embeddings using
HuggingFaceInstructEmbeddings
. - Store embeddings in
FAISS
vector database.
-
Search & Retrieval:
- Accepts user query.
- Encodes query using
SentenceTransformer
. - Searches vector store for relevant text.
-
Chat with Gemini AI:
- Uses retrieved context for response generation.
- Integrates Google Gemini API for enhanced answers.
Try LawGPT live at: https://lawgpt.ayuugoyal.tech/