biniyam69 / AI-Contract-Lawyer

Ever wanted a fully autonomous AI contract assistant for your legal concerns?

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OPTIMIZED CONTRACT LAWYER RAG

Overview

This repository contains the implementation of a Retrieval Augmented Generation (RAG) system for Contract Q&A. In this project I aim to build, evaluate, and improve a RAG system capable of answering questions related to legal contracts autonomously. The system leverages Langchain, a leading LLM application framework, for development and evaluation. Fastapi for backend and React on the frontend.

Objectives

  • Build a RAG system for Contract Q&A using Langchain.
  • Evaluate the performance of the RAG system using predefined metrics and benchmarks.
  • Implement enhancements to optimize the Contract Q&A process.
  • Interpret and report the findings, including incremental improvements achieved.

Tasks

The project is structured into several tasks, including:

  1. Literature Review and Trend Analysis
  2. Understanding RAG Performance Metrics
  3. Efficiency and Scalability Optimization
  4. Personalization and Contextualization
  5. Bias Reduction
  6. Planning and Design of Q&A Pipeline
  7. Development of Retrieval and Generation Components
  8. Integration and Testing
  9. Building a RAG Evaluation Pipeline
  10. Optimization Ideas for Contract Q&A
  11. Implementation of Enhancements
  12. Interpretation & Reporting

Dependencies

  • Python 3.x
  • Langchain framework
  • TensorFlow or PyTorch
  • langchain
  • RAGAS
  • TruLens
  • Cohere API
  • FastAPI

How to setup


Setup Instructions

  1. Clone the Repository:

    git clone git@github.com:biniyam69/AI-Contract-Lawyer.git
  2. Create a New Virtual Environment:

    python -m venv <env_name>

    Replace <env_name> with your desired environment name.

  3. Activate the Virtual Environment:

    • For Windows:
      .\<env_name>\Scripts\activate
    • For macOS/Linux:
      source <env_name>/bin/activate
  4. Install Requirements:

    pip install -r requirements.txt
  5. Start the FastAPI Backend:

    cd backend
    uvicorn app:api
  6. Install Node Dependencies and Start the Frontend:

    cd frontend
    npm install
    npm run dev
  7. Access the Application:


Screenshots

Screenshot from 2024-03-20 13-18-10


lawyerbro

Contributors

License

This project is licensed under the MIT License - see the LICENSE file for details.


Feel free to customize this README template according to your project specifics and requirements. Ensure it provides clear instructions for setup, dependencies, and usage, as well as an overview of the project objectives and structure.

About

Ever wanted a fully autonomous AI contract assistant for your legal concerns?

License:MIT License


Languages

Language:Jupyter Notebook 79.3%Language:HTML 9.1%Language:Python 8.3%Language:JavaScript 2.4%Language:CSS 0.8%