Skip to content

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

License

Notifications You must be signed in to change notification settings

biniyam69/AI-Contract-Lawyer

Repository files navigation

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 [email protected]: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?

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published