- Sign-in or sign-up at Qdrant Cloud
- Create a free 1GB cluster
- Note down the Qdrant API key and the Qdrant Cluster Url
- Sign-in or sign-up at OpenAI
- Setup your account with enough credits
- Note down the OpenAI API key
- You need to be a Slack admin for your workspace.
- Go to Slack apps and click on “Create a new app”, select “From scratch” in the popup window, and choose a name (for me, it is “PlivoAskMe”), then click on “Create App”.
- Click on “New Slack Commands” and point it to your application API hosted on fly.io (you can do that later if the fly.io application is not online yet)
- From the left menu, click on “OAuth & Permissions” then in the “Bot Token Scopes” section, click on “Add an Oauth scope” and select “commands”
- Go back to the “Basic information” section in the left menu and click “Install to workspace”
- You should be able to see the “App Credentials” section.
- Note down the Slack "Verification Token"
Copy the settings.py example file
cp settings.py.example settings.py
Edit and configure the following variables:
- INGEST_GIT_REPO_URLS
- INGEST_SITEMAP_URLS
- INGEST_SITEMAP_URLS_FILTERS
Create the application
fly apps create <app_name>
Copy the fly.toml example file
cp fly.toml.example fly.toml
Change the "app" with the <app_name>, and "OPENAI_MODEL" and "VECTOR_DATABASE" settings.
fly secrets QDRANT_API_KEY=xxxx # replace 'xxxx' with your Qdrant API key
fly secrets OPENAI_API_KEY=xxxx # replace 'xxxx' with your OpenAI API key
fly secrets SLACK_TOKEN_ID=xxxx # replace 'xxxx' with your Slack Verification token
fly deploy --force-machines --local-only --region iad --vm-size shared-cpu-2x
fly scale memory 4096 # scale up memory to ingest the data
fly ssh console --pty -C 'python3 /app/ingest.py' # collect and inject data into the vector database
fly scale memory 2048 # scale down memory
fly deploy --local-only