This project is in an experimental phase and remains under active development. Please use it with caution and understand that you do so at your own risk.
- Prepare the docker environment:
- Open the file named
.env-example.-
Replace the placeholder configurations with your actual settings:
# For OpenAI configuration OPENAI_KEY="your-openai-key" # Default model settings MODEL_NAME="gpt-4o-mini" EMBEDDING_MODEL_NAME="text-embedding-3-small" TEMPERATURE=0.0
-
If using OpenAI models, make sure
OPENAI_KEYis set, and you can selectMODEL_NAMEandEMBEDDING_MODEL_NAMEfrom https://platform.openai.com/docs/models. -
If using Ollama, remove
OPENAI_KEYfrom the environment to avoid conflicts, and you can selectMODEL_NAMEandEMBEDDING_MODEL_NAMEfrom https://www.ollama.com/search. -
Save and close the file.
-
Rename the file to
.env.
-
- Prepare the ollama environment:
- Start the Ollama Docker image using
docker-compose
docker-compose start ollama- Pull a model supported by Ollama. You can find Ollama models here and replace
mistralwith another model, andavr/sfr-embedding-mistralwith another embedding.
docker exec -it ollama ollama pull mistral
docker exec -it ollama ollama pull avr/sfr-embedding-mistralSince this project is based on context (RAG), all files in the *.txt format should be added to the backend/docs folder.
Please note that if you modify the models, you should ensure the embedding dimensions are correct. Otherwise, you can delete the existing data in chromaDB by calling the following function from your browser after running the server, and then restart the server to re-embed the docs automatically:
http://localhost:5000/delete-collection docker compose up --build -d docker compose up -dYou can skip this part if your system meets all the requirements listed below 👇
-
Clone the project in your preferred IDE (e.g. VScode)
-
Prepare the backend environment:
- Navigate to the backend using
backendfolder:cd backend - Create a virtual environment for dependencies called
envusing the following command:python -m venv env
- Activate the created
envby running:- Windows:
env\Scripts\activate.bat
- Unix/MacOS:
env/bin/activate
- Install the required libraries listed in
requirements.txtby running:pip install -r requirements.txt
- Navigate to the backend using
-
Prepare the frontend environment:
- Navigate to the
frontendfolder:cd ../frontend - follow the same steps of the
backendenvironment
- Navigate to the
-
Set Up Environment Variables:
-
Open the file named
.env-example. -
Replace the placeholder configurations with your actual settings:
# For OpenAI configuration OPENAI_KEY="your-openai-key" # For Ollama configuration LLM_BASE_URL="http://localhost:11434" # Default model settings MODEL_NAME="gpt-4o-mini" EMBEDDING_MODEL_NAME="text-embedding-3-small" TEMPERATURE=0.0 #for backend configuration API_BASE_URL="http://localhost:5000" # Database configuration CHROMA_DB_SERVER_HOST="localhost" CHROMA_DB_SERVER_PORT=8000 CHROMA_DB_COLLECTION_NAME="docs_collection"
-
If using OpenAI models, make sure
OPENAI_KEYis set, and you can selectMODEL_NAMEandEMBEDDING_MODEL_NAMEfrom https://platform.openai.com/docs/models. -
If using Ollama, remove
OPENAI_KEYfrom the environment to avoid conflicts, and you can selectMODEL_NAMEandEMBEDDING_MODEL_NAMEfrom https://www.ollama.com/search. -
Save and close the file.
-
Rename the file to
.env.
-
-
Prepare the ollama environment:
- Start the Ollama Docker image using
docker-compose
docker-compose start ollama
- Pull a model supported by Ollama. You can find Ollama models here and replace
mistralwith another model, andavr/sfr-embedding-mistralwith another embedding.
docker exec -it ollama ollama pull mistral docker exec -it ollama ollama pull avr/sfr-embedding-mistral
- Start the Ollama Docker image using
-
Prepare the ChromaDB environment:
- Start the ChromaDB Docker image using
docker-compose
docker-compose start chromadb
- Start the ChromaDB Docker image using
Since this project is based on context (RAG), all files in the *.txt format should be added to the backend/docs folder.
Please note that if you modify the models, you should ensure the embedding dimensions are correct. Otherwise, you can delete the existing data in chromaDB by calling the following function from your browser after running the server, and then restart the server to re-embed the docs automatically:
http://localhost:5000/delete-collection- Navigate to the backend using
backendfolder:cd backend - Run the application:
uvicorn app:app --host 0.0.0.0 --port 5000 --reload
- Open a new terminal and navigate to the
frontendfolder:cd frontend - Run the development web server:
streamlit run app.py --server.port=8080 --server.address=0.0.0.0
- Access the web application on the displayed localhost: http://localhost:8080
