An open-source RAG bot for Slack and Discord using Vectara. With this bot you can create a Slack or Discord bot that is connected to your server and answers user questions by querying a Vectara corpus.
@bot-name Your message hereYour message heregit clone https://github.com/vectara/ragtime.git
cd ragtime
pip3 install requirement.txt
.env file in the root of your project and add the following:SLACK_BOT_TOKEN=<OAuth level token>
SLACK_APP_TOKEN=<APP level token>
DISCORD_BOT_TOKEN=<Discord bot token>
VECTARA_CUSTOMER_ID="<VECTARA_CUSTOMER_ID>"
VECTARA_CORPUS_IDS="<VECTARA_CORPUS_IDS>"
VECTARA_API_KEY="<VECTARA_API_KEY>"
ACCOUNT_SID=<Twilio account SID>
Auth_TOKEN=<Twilio auth token>
TWILIO_WHATSAPP_NUMBER=<Whatsapp number configured in twilio>
ENABLE_AGENTIC_RAG=True ## To enable agentic rag. By default ragtime uses vanilla RAG.
AGENTIC_RAG_DATA_DESCRIPTION='Vectara website, docs and forum data'
AGENTIC_RAG_ASSISTANT_SPECIALTY='Vectara'
AGENTIC_RAG_TOOL_NAME='ask_vectara'
VECTARA_CUSTOMER_ID and VECTARA_CORPUS_IDS point to your Vectara account and relevant corpora to use.VECTARA_CORPUS_IDS can be a single corpus ID (numeric) or a comma-separated list of corpora.RagTime supports Slack bot, Discord bot and Whatsapp bot. You can run one of these, or all.
python3 main.pypython3 main.py slackpython3 main.py discordpython3 main.py whatsappBuild and Run with docker.
bash run_docker.shbash run_docker.sh slackbash run_docker.sh discordbash run_docker.sh whatsappIn orer to connect your ragtime bot to your Slack service, follow these steps:
app_mentions:read, channels:history, chat:write, chat:write.public, groups:history, im:history, mpim:history, mpim:read, mpim:write, users:read scopes. Create the token and save it as SLACK_BOT_TOKEN in your .env file.connection:write scope. Save this token as SLACK_APP_TOKEN in your .env file.In order to connect your ragtime bot to your Discord server, follow these steps:
DISCORD_BOT_TOKEN.In order to connect your ragtime whatsapp bot, follow these steps:
/whatsapp endpoint for communication..env? Vectara
Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.
Give a ️ if this project helped you!
Copyright © 2024 Vectara.
This project is Apache 2.0 licensed.