The Infrastructure-Chatbot repository contains the necessary files to run the infrastructure services for the ACCESS AI project. The infrastructure services include the following components:
- Keycloak: An open-source identity and access management solution.
- PostgreSQL: An open-source relational database.
- Vector Store: A service for storing and querying vectors.
- Context Service: A service for storing and querying context information.
- Download the necessary repositories:
git clone https://github.com/ACCESS-AI/Frontend-Re.git git clone https://github.com/ACCESS-AI/Infrastructure-RE.git git clone https://github.com/ACCESS-AI/Context-Service.git git clone https://github.com/ACCESS-AI/Backend-Re.git git clone https://github.com/ACCESS-AI/Chatbot.git
- Insert your Mistral AI API key in the
MISTRAL_API_KEYvariable of the.envfile in theInfrastructure-Chatbotdirectory. - Choose a working directory for saving the course repositories and insert it in the
WORKING_DIRvariable of the.envfile in theInfrastructure-Chatbotdirectory. - If you wish to change the default values of the environment variables, you can do so by editing the
.envfile in theInfrastructure-Chatbotdirectory. - Run the following command to start the infrastructure services:
cd Infrastructure-Chatbot
docker compose up -d- Stop the context service container which is automatically started by the Infrastructure Chatbot
docker compose up -dcommand. - Follow the steps in the README.md file of the Context Service repository.
- If you want to change the default publishsing method, refer to the README.md file of the Chatbot repository.
- Run the following command to build and publish the Chatbot library:
cd Chatbot ./gradlew publish
- Load the Backend-Re-Chatbot project in IntelliJ.
- In the run configuration for
AccessApplicationKt, add the following environment variables:WORKING_DIRshould be an existing empty directory that ACCESS will use to clone course repos.API_KEYis a mock key used for the ACCESS API.MISTRAL_API_KEYis the API key for the Mistral API.MISTRAL_EMBEDDING_MODELis the URL of the Mistral embedding model.MISTRAL_EMBEDDING_HOSTis the host of the Mistral embedding model.MISTRAL_LLM_MODELis the URL of the Mistral LLM model.MISTRAL_LLM_HOSTis the host of the Mistral LLM model.VECTOR_STORE_HOSTis the host of the vector store.SIMILARITY_SCORE_THRESHOLDis the similarity score threshold for the vector store.TOP_K_RESULTSis the number of top results to return from the vector store.CHATBOT_DB_URLis the URL of the chatbot database.CHATBOT_DB_USERis the username of the chatbot database.CHATBOT_DB_PASSWORDis the password of the chatbot database.CHATBOT_CONTEXT_SERVICE_URLis the URL of the context service.
- Replace all occurrences of
0.0.0.0in the backend withlocalhost. - Run the backend.
-
Run the following command to install the frontend dependencies:
cd Frontend-Re-Chatbot npm install -
Run the following command to start the frontend:
npm start
- Make sure the
Backend-Rehas the correctgradle.propertiesfile based on the chosen publishing method. For more information, refer to the README.md file of the Chatbot repository.
- Add the correct values to the empty environment variables in the
.env_prodfile in theInfrastructuredirectory. - If you wish to change the default values of the environment variables, you can do so by editing the
.env_prodfile in theInfrastructuredirectory. - Run the following command to start the infrastructure services:
cd Infrastructure
docker compose -f docker-compose-prod.yml --env-file .env_prod up -d