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.
- 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.
The project is structured into several tasks, including:
- Literature Review and Trend Analysis
- Understanding RAG Performance Metrics
- Efficiency and Scalability Optimization
- Personalization and Contextualization
- Bias Reduction
- Planning and Design of Q&A Pipeline
- Development of Retrieval and Generation Components
- Integration and Testing
- Building a RAG Evaluation Pipeline
- Optimization Ideas for Contract Q&A
- Implementation of Enhancements
- Interpretation & Reporting
- Python 3.x
- Langchain framework
- TensorFlow or PyTorch
- langchain
- RAGAS
- TruLens
- Cohere API
- FastAPI
-
Clone the Repository:
git clone [email protected]:biniyam69/AI-Contract-Lawyer.git
-
Create a New Virtual Environment:
python -m venv <env_name>
Replace
<env_name>
with your desired environment name. -
Activate the Virtual Environment:
- For Windows:
.\<env_name>\Scripts\activate
- For macOS/Linux:
source <env_name>/bin/activate
- For Windows:
-
Install Requirements:
pip install -r requirements.txt
-
Start the FastAPI Backend:
cd backend uvicorn app:api
-
Install Node Dependencies and Start the Frontend:
cd frontend npm install npm run dev
-
Access the Application:
- Open your browser and go to http://localhost:3000/chat to access the chat interface.
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.