AbhaySingh71
AI-Lawyer-RAG-with-Deepseek
Python

AI Lawyer is an intelligent reasoning legal assistant powered by DeepSeek , Ollama RAG and LangChain, designed to streamline legal research and document analysis. By leveraging retrieval-augmented generation (RAG), it provides precise legal insights, and contract summarization. With an intuitive Streamlit-based UI, analyze legal documents.

Last updated Aug 2, 2026
53
Stars
13
Forks
1
Issues
0
Stars/day
Attention Score
16
Language breakdown
Python 100.0%
โ–ธ Files click to expand
README

GitHub Stars

โš–๏ธ AI Lawyer - RAG with DeepSeek R1

An AI-powered legal chatbot that leverages Retrieval-Augmented Generation (RAG) with DeepSeek R1 and Ollama for advanced legal reasoning.

This chatbot is designed to assist users in understanding complex legal documents, retrieving relevant case laws, and providing structured legal insights. By integrating DeepSeek R1, a sophisticated reasoning model, with the RAG framework, AI Lawyer ensures that responses are grounded in factual legal texts, reducing hallucinations and enhancing reliability. The chatbot can process large legal documents, break them down into meaningful sections, and retrieve the most pertinent information to answer user queries accurately.

Features

    • ๐Ÿ“‚ Upload and analyze legal documents (PDFs)
    • ๐Ÿ” Retrieve relevant legal information using FAISS vector database
    • ๐Ÿค– Answer legal questions using DeepSeek R1 with Groq
    • ๐Ÿ“œ Summarize legal documents
    • ๐Ÿ“„ Generate downloadable AI-generated legal reports

https://github.com/user-attachments/assets/003b6247-9faa-4c9a-b9b6-e1311d1d61d5

๐Ÿ“ธ Project Demo

| Screenshot 1 | Screenshot 2 | |---------------------------------|---------------------------------| | Screenshot 3 | Screenshot 4 |


๐Ÿ“ Project Structure

    โ”œโ”€โ”€ frontend.py          # Streamlit UI for AI Lawyer
    โ”œโ”€โ”€ rag_pipeline.py      # Retrieval-Augmented Generation pipeline
    โ”œโ”€โ”€ vector_database.py   # FAISS-based vector database
    โ”œโ”€โ”€ requirements.txt     # Python dependencies
    โ””โ”€โ”€ README.md            # Project documentation
    

๐Ÿ› ๏ธ Technologies Used

    • DeepSeek R1 - AI model for complex reasoning
    • Ollama - Local LLM hosting
    • LangChain - AI framework for LLM applications
    • Streamlit - Frontend UI for chatbot
    • FAISS - Vector search for document retrieval
    • pdfplumber - PDF document processing

โš™๏ธ Installation & Setup

1๏ธโƒฃ Clone the Repository

git clone https://github.com/AbhaySingh71/AI-Lawyer-RAG-with-Deepseek.git
cd AI-Lawyer-RAG-with-Deepseek

2๏ธโƒฃ Set Up the Virtual Environment

python -m venv venv
source venv/bin/activate  # On macOS/Linux
venv\Scripts\activate  # On Windows

3๏ธโƒฃ Install Dependencies

pip install -r requirements.txt

Deployment on Streamlit Cloud

1๏ธโƒฃ Push code to GitHub

git add .
git commit -m "Initial commit"
git push origin main

2๏ธโƒฃ Deploy on Streamlit

    • Set GROQAPIKEY in Streamlit Secrets.
    • Click Deploy! ๐ŸŽ‰

๐Ÿš€ Usage

    • Run the Streamlit application:
    streamlit run frontend.py
    • Upload a legal document (PDF)
    • Ask legal questions and get AI-powered responses
    • Download AI-generated legal reports

๐Ÿ“œ How It Works

    • Upload PDF: Documents are uploaded and processed.
    • Vector Database: FAISS indexes the document text.
    • Query Handling: AI retrieves relevant information.
    • LLM Response: DeepSeek R1 generates answers.
    • Report Generation: AI generates a downloadable PDF report.

๐ŸŒ Deployed Version

The app is deployed on Streamlit! You can check out the live version and explore the analysis on your own:Streamlit App.

๐ŸŽฏ Future Improvements

    • ๐Ÿ“ Add support for multiple document formats (DOCX, TXT)
    • โšก Improve response speed and accuracy
    • ๐Ÿ”— Integrate legal databases for richer context

๐Ÿ“ฌ Contact Us

Have questions or need support? Reach out to us at:


๐ŸŒ Connect With Me

๐Ÿ™ GitHub | ๐Ÿ”— LinkedIn | ๐Ÿฆ Twitter

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท AbhaySingh71/AI-Lawyer-RAG-with-Deepseek ยท Updated daily from GitHub