This application automatically creates an FAQ based on messages for a given Discord server. When deployed via GitHub Actions and Ploomber Cloud, you have a pipeline that regenerates the FAQ for each commit on the ploomber_dev branch.
The application performs the following steps:
- Retrieve messages from the Discord server via the Discord API.
- Summarize the Discord messages into question-answer pairs using
OpenAIand theHaystacklibrary. - Display the results on a user interface using
Solara.- The user can browse all question-answer pairs by category and tag.
- The user can also enter a query which returns the most relevant question-answer pairs. This is done using
Haystack, which retrieves documents based on cosine similarity.
- Deploy the application to the web using
PloomberCloud.
Solarathon.GitHub.demo.mp4
This project was created as part of the 2023 Solarathon.
-
navigate to https://discord.com/developers/applications
-
create a new bot
-
save the token
-
Go in the "OAuth2" section --> URL Generator
-
Check the "bot" checkbox
-
assign the permission "Read Message History"
-
copy the generated URL:
-
install the Bot on your Discord Server
HAYSTACK_REMOTE_API_TIMEOUT_SEC=300
DISCORD_SERVER_ID=xxxxx
DISCORD_CHANNEL_ID=xxxxx
OPENAI_API_KEY=xxxxx
BOT_TOKEN=xxxxx
$ pip install -r backend/discord_pipeline/requirements.txt
$ python backend/discord_pipeline/get_messages.py
$ pip install -r backend/haystack_pipeline/requirements.txt
$ python backend/haystack_pipeline/step_1_generate_faqs.py
$ python backend/haystack_pipeline/step_2_indexing.py
pip install -e .
solara run solarathon.pages
HAYSTACK_REMOTE_API_TIMEOUT_SEC=300
DISCORD_SERVER_ID=xxxxx
DISCORD_CHANNEL_ID=xxxxx
OPENAI_API_KEY=xxxxx
BOT_TOKEN=xxxxx
PLOOMBER_CLOUD_KEY=XXXXX
Get your Ploomber API key and set it as PLOOMBER_CLOUD_KEY in GitHub (under Settings->Secrets and Variables->Actions, and click "New repository secret")
$ ploomber-cloud key YOURKEY
$ (cd ploomber && rm ploomber-cloud.json && ploomber-cloud init)
(add to git and commit)
$ git add ploomber/ploomber-cloud.json
$ git commit -m "ci: set ploomber id"
$ git push origin master:ploomber_dev
$ git push origin master:ploomber_dev
# add --force if needed
(Not recommended) See https://docs.cloud.ploomber.io/en/latest/user-guide/cli.html for more details
$ pip install ploomber-cloud
$ mkdir -p ploomber/wheels
$ ploomber-cloud key YOURKEY
$ (cd ploomber && ploomber-cloud init)
(type y)
# build the wheel
$ (hatch build && cp dist/*.whl ploomber/wheels)
$ (cd ploomber && ploomber-cloud deploy)
- Simone Frisco, Data Scientist
- Silvia Hua, Data Scientist
- Arunprasadh Senthil, Data Engineer
- Janet Mardjuki, Software Developer
- Roman Gampert, Product
- Iisakki Rotko from Widgetti BV
- Maarten Breddels from Widgetti BV
- Laura Funderburk from Ploomber


