Skip to content

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.

License

Notifications You must be signed in to change notification settings

AbhaySingh71/AI-Lawyer-RAG-with-Deepseek

Repository files navigation

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
AI.Lawer.mp4

📸 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

  • Go to Streamlit Cloud → Deploy a new app.
  • Set GROQ_API_KEY in Streamlit Secrets.
  • Click Deploy! 🎉

🚀 Usage

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

📜 How It Works

  1. Upload PDF: Documents are uploaded and processed.
  2. Vector Database: FAISS indexes the document text.
  3. Query Handling: AI retrieves relevant information.
  4. LLM Response: DeepSeek R1 generates answers.
  5. 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

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages