this is an implemneation of RAG archiecutre for answering questions related to the medical field
python 3.8 or above the version used was 3.12.3 using WSL on windows or using linux natively is completly up to you i prefer linux at this point as it is easier in some cases
to create a virtual enviroment use the following command
python -m venv venvthe second venv is the name of the virtual enviroment you can change it to any name you like to activate the virtual enviroment use the following command
source venv/bin/activateon windows use the following command
venv\Scripts\activateafter activating the virtual enviroment you need to install the requirments using the following command
pip install -r requirements.txtif you want to run the app use the following command
uvicorn src.app.main:app --reload --host 0.0.0.0 --port 5000this will run the app on localhost port 8000 you can change the port to any port you like also you can change localhost to 0.0.0.0 to make it accessible from other devices on the same network remove it to run the app in development and -- reload is used to reload the app automatically when you make changes to the code to make sure everything is working you can access the following endpoint
you can just use
uvicorn src.app.main:appto test the apis you can use pytest and use the file test_api.py to test the apis as you would create more apis you can add more tests to the test_api.py file to test the new apis to run the tests use the following command
pytestin order to store the chunks we generated from the documents we need to store it in a database beacuse of this we need to use mongoDB , just you need to famalirize yourself just a bit with docker and docker-compose first thing you need is to install docker this is the docker url
how to install docker on linux
afer verifying that docker works on your system go the directory where the docker file presents
cd docker , docker compose up --watcha quick guide on docker compose and what the commands mean
your mongodb will be running on port 27017 we can download studio 3t to view your database studio 3t