if run manually, only supported on unix
-
create virtual environment
python3 -m venv venv source venv/bin/activate -
install packages
Highly recommend to install package manually as put in
installer.txtor
pip3 install -r requirements.txt -
create
.envsuchexample.envfile -
setup database
setup the database as put in
.envfile. then create database namechatbotCREATE DATABASE chatbotor you can simply use docker compose of postgres in
compose/postgres.yaml -
Apply the Alembic migrations
make migrate-checkout r=head -
download embeeding model
python3 model.download.py -
embed basic knowledge for vectorstore db
python3 embed.init.py -
Configure preprocessing file as mention at preprocessing section (optional)
-
run the app
for development
python3 app.pyfor deployment testing
fastapi run app.py
-
create .env such example.env file
-
Configure preprocessing file as mention at preprocessing section (optional)
-
run docker compose command
docker compose build --no-cache
docker compose up -d
-d means running as daemon
exposing port 5001 as default
sometimes, the code was error. Keep build the image untill get succeed then
compose up
you need to configure of three things:
-
create folder name by following rule
documents/preprocessing-<your custom name> -
provide
.pdffile in your directory as downloadable file later on -
provide
.txtfile in your directory which contains.pdffile content as chatbot knowledge due to not all.pdffile is readable
the program will automatically recognize as preprocessing stuff and will be loaded when it get starts.
Documentation able to see on url/docs. It is generated automatically by fastapi. It also provides API playground.