- Create a
.envfile inside the/rag/backend/directory. - Add the following lines to the
.envfile:OPENAI_API_KEY=openai_api_key COHERE_API_KEY=cohere_api_key
Note: OPENAI_API_KEY requires credits to work and one need to purchase the credit and you can obtain the COHERE_API_KEY by going to its official webiste signing Up and generating a trial key.
-
Open Docker Desktop.
-
Navigate to the project directory:
cd rag -
Build and run the Docker containers:
docker-compose up --build
-
Open another terminal and navigate to the backend directory:
cd rag/backend -
Find the container name:
docker ps
-
Access the PostgreSQL database:
docker exec -it rag-db-1 psql -U user -d rag_chatbotNote: Replace
rag-db-1with your container name if it differs. The database namerag_chatbotis fixed as defined insettings.py. -
Run the following command in the PostgreSQL shell:
CREATE EXTENSION IF NOT EXISTS vector;
-
Quit the PostgreSQL shell:
- Use
Ctrl + Cto exit.
- Use
-
To Re-Run Docker if applicable
- docker-compose up
Ensure that the Docker containers are running and that the API keys are correctly set in the .env file and then click on the http://localhost:3000.