A Discord Bot which uses zkApp Umstad infrastructure. Supports, helps users in MINA Protocol Discord Channels with Command Prefix, Slash Commands, Automatized Answers and Chat Interface.
Automated Responses for Forum Threads: The Umstad bot can answer the question immediately when a forum thread opened in the zkapps-questions forum channel.
Command Prefix & Slash Commands: The Umstad bot can get involved the conversation in spesific channels with command prefix or slash commands.
Chat Interface: People can use Direct Message interface for asking to the zkApp Umstad.
24/7 Availability: It will provide online 24/7 assistance to people.
Searcher Functionality: Umstad bot can query the Vector DB and find related threads and answer with their information(thread IDs, thread titles) etc.
Create .env file in the root folder:
DISCORD_TOKEN=XXXXXXXX
SEARCHER_DISCORD_TOKEN=XXXXXXXXXX
THREAD_UPLOADER_DISCORD_TOKEN=XXXXXXXXXXXX
OPENAI_API_KEY=XXXXXXXX
AUTH_TOKEN=XXXXXXXXX
PINECONE_API_KEY=XXXXXXXXXXX
PINECONE_ENVIRONMENT=XXXXXXXXX
Discord bot must have write and read permissions.
bot.py
in the root folder. Uses commands.py
, message.py
and forum_listener.py
- Slash Command with getting previous messages with number.
- Command prefix !umstad can call the bot.
- Can be used with DM.
- It listens recently created threads, if AI Support is needed, answers. Posts threads to api named lambda functions, currently FAST API.
It is an AI Search Engine, which gets threads from Pinecone Vector DB which are uploaded by thread uploader and lambda functions. Uses demo-search vector or search vector.
- Clone the repository and create .env file like in there
- Build Docker:
docker build -t search_umstad .
- Stop and remove if it is working:
docker stop search_umstad_container
docker rm search_umstad_container
- Run the Docker Container:
docker run --name search_umstad_container searchumstad
In thread_uploader/bot.py
,
- Scans the forum channel
- If these threads are not in tiny db,
- Decides if active threads are solved.
- Uses
process_thread.py
and post the thread data to lambda uploader.
In thread_uploader/archived_getter.py
and archived_uploader.py
- Gets archived threads and export them as
payloads.json
process and upload them to vector db.
Need 4 terminals, each of them requires activated env. ```source venv/bin/activate````
In config.py
IS_THREAD_PROCESSOR_DONE = True
-
In the root folder to run main bot: ```python bot.py````
-
In the root folder to run thread searcher bot: ```python search_bot.py````
-
In the thread_uploader folder to run thread scanner and uploader bot: ```python thread_uploader/bot.py````
-
In the lambda_functions folder to run helper api to process thread data:
cd lambda_functions && uvicorn main:app --host 127.0.0.1 --port 8000