This repository contains the backend code for NyaySathi project. Nyay Sathi is an AI powered platform where people can get legal guidance and advice for their legal quiries through voice input and output in their regional language.
The backend is build using FLask and it is deployed on replit. This flask server is responsible for the following tasks.
- Handling the incoming requests from the frontend.
- Using RAG (Retrival Augemented Generation) model with OpenAI's GPT 3 embeddings to generate response for the user's query.
- Using Indian Kanoon API to fetch relevant legal documents for the user's query to train the RAG model.
- Using Narakeet API to convert the generated response into audio.
- Sending the response back to the frontend.
- Setup a virtual environment and install the dependencies.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- Create a .env file and add the following variables.
OPENAI_KEY=<your openai api key>
ORG=<your openai org id>
NARAKEET_KEY=<your narakeet api key>
- Run the flask server.
flask run
- The server will be running on port 5000.