{"id":15714375,"url":"https://github.com/vectara/ragtime","last_synced_at":"2025-10-19T07:37:38.243Z","repository":{"id":245950211,"uuid":"808260715","full_name":"vectara/ragtime","owner":"vectara","description":"An open source implementation of a bot that can respond to user questions from Slack, Discord by utilizing Vectara RAG","archived":false,"fork":false,"pushed_at":"2024-10-24T18:53:42.000Z","size":94,"stargazers_count":42,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-25T02:38:47.010Z","etag":null,"topics":["chat","discord","discord-bot","rag","slack","slack-bot"],"latest_commit_sha":null,"homepage":"http://vectara.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vectara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-30T17:47:03.000Z","updated_at":"2024-10-24T18:53:46.000Z","dependencies_parsed_at":"2024-06-25T01:31:40.997Z","dependency_job_id":"f0f48a6b-3888-4dd6-b4b7-24da40a83ea7","html_url":"https://github.com/vectara/ragtime","commit_stats":null,"previous_names":["vectara/ragtime"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectara%2Fragtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectara%2Fragtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectara%2Fragtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectara%2Fragtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vectara","download_url":"https://codeload.github.com/vectara/ragtime/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248814685,"owners_count":21165802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chat","discord","discord-bot","rag","slack","slack-bot"],"created_at":"2024-10-03T21:36:32.316Z","updated_at":"2025-10-19T07:37:33.213Z","avatar_url":"https://github.com/vectara.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ragtime\n\nAn open-source RAG bot for Slack and Discord using Vectara.\nWith 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.\n\n## Usage\n\n- Mention the bot in a message to receive a reply.\n- Send a direct message to the bot for a 1:1 conversation.\n- The bot stores message and thread IDs to provide context-aware replies in threads or while replying.\n\n## Example Commands\n- Mention the bot: `@bot-name Your message here`\n- Send a direct message: `Your message here`\n\n## Installation\n\n### Prerequisites\n\n- Python 3.8 or higher\n\n### Setup\n\n1. **Clone the repository:**\n   ```bash\n   git clone https://github.com/vectara/ragtime.git\n   cd ragtime\n   \n2. **Install the required dependencies:**\n   ```bash\n    pip3 install requirement.txt\n\n3. **Set Up Environment Variables:**\n   - Create a `.env` file in the root of your project and add the following:\n   ```\n   SLACK_BOT_TOKEN=\u003cOAuth level token\u003e\n   SLACK_APP_TOKEN=\u003cAPP level token\u003e\n   DISCORD_BOT_TOKEN=\u003cDiscord bot token\u003e\n   VECTARA_CUSTOMER_ID=\"\u003cVECTARA_CUSTOMER_ID\u003e\"\n   VECTARA_CORPUS_IDS=\"\u003cVECTARA_CORPUS_IDS\u003e\"\n   VECTARA_API_KEY=\"\u003cVECTARA_API_KEY\u003e\"\n   ACCOUNT_SID=\u003cTwilio account SID\u003e\n   Auth_TOKEN=\u003cTwilio auth token\u003e\n   TWILIO_WHATSAPP_NUMBER=\u003cWhatsapp number configured in twilio\u003e\n   ```\n   #### To enable [agentic rag](https://github.com/vectara/py-vectara-agentic) add the following variables.\n   ```\n   ENABLE_AGENTIC_RAG=True ## To enable agentic rag. By default ragtime uses vanilla RAG.\n   AGENTIC_RAG_DATA_DESCRIPTION='Vectara website, docs and forum data'\n   AGENTIC_RAG_ASSISTANT_SPECIALTY='Vectara'\n   AGENTIC_RAG_TOOL_NAME='ask_vectara'\n   ```\n   - The `VECTARA_CUSTOMER_ID` and `VECTARA_CORPUS_IDS` point to your Vectara account and relevant corpora to use. \n   - `VECTARA_CORPUS_IDS` can be a single corpus ID (numeric) or a comma-separated list of corpora.\n   \n## Running ragtime bots\n\nRagTime supports [Slack bot](#Steps-to-create-slack-bot),  [Discord bot](#Steps-to-create-discord-bot) and [Whatsapp bot](). \nYou can run one of these, or all. \n\n### How to Run It Locally\n- #### Running both bots\n   ```bash\n   python3 main.py\n   ```\n  \n- #### Running only Slack bot\n   ```bash\n   python3 main.py slack\n   ```\n\n- #### Running only Discord bot\n   ```bash\n   python3 main.py discord\n   ```\n  \n- #### Running only WhatsApp bot\n   ```bash\n   python3 main.py whatsapp\n   ```  \n\n### Run the application using Docker\n**Build and Run with docker.**\n- #### Running both bots\n   ```bash\n   bash run_docker.sh\n   ```\n- #### Running only Slack bot\n   ```bash\n   bash run_docker.sh slack\n   ``` \n - #### Running only Discord bot\n   ```bash\n   bash run_docker.sh discord\n   ```\n - #### Running only Whatsapp bot\n   ```bash\n   bash run_docker.sh whatsapp\n   ```   \n\n## Steps to create Slack bot\nIn orer to connect your ragtime bot to your Slack service, follow these steps:\n\n- Log in to your Slack workspace and navigate to the Slack API website. Click on \"Your Apps\" and then \"Create New App.\" Provide a name for your app, select the workspace where you want to install it, and click \"Create App.\"\n- In the app settings, you can configure various details such as the app name, icon, and description. Make sure to fill out the necessary information accurately.\n- Once you've configured your app, navigate to the \"Install App\" section. Click on the \"Install App to Workspace\" button to add the bot to your Slack workspace. This step will generate an OAuth access token that you'll need to use to authenticate your bot.\n- To add user token scope, navigate to the \"OAuth \u0026 Permissions\" section in your app settings. Under the \"OAuth Tokens for Your Workspace\" section, you'll need to add  `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.\n- Create an app level token with the `connection:write` scope. Save this token as `SLACK_APP_TOKEN` in your `.env` file.\n- Make sure to save any changes you've made to your app settings and install/reinstall the bot to workplace.\n\n## Steps to create Discord bot\nIn order to connect your ragtime bot to your Discord server, follow these steps:\n\n- Navigate to [Discord Developer Portal Applications Page](https://discord.com/developers/applications) and create a new application by clicking on the ‘New Application‘ button on the top-right corner.\n- Go to the ‘Bot‘ page by selecting the ‘Bot‘ option from the left column.\n- Copy the provided token and save it as `DISCORD_BOT_TOKEN`.\n- Choose ‘OAuth2’ from the left column and select the URL Generator.\n- In the ‘Bot Permissions’ section at the bottom, select the necessary permissions.\n- Choose the ‘bot’ option in the ‘Scope’ box, and the ‘BOT PERMISSIONS’ box will appear below it.\n- Select ‘Read Message’, ‘Send Message’, and ‘Manage Message’ options.\n- Copy the generated URL and paste it into your web browser. It will redirect you to the Discord page to add the bot to your server.\n\n\n## How to setup whatsapp bot using twilio\nIn order to connect your ragtime whatsapp bot, follow these steps:\n\n- Sign in to your [twilio console](https://console.twilio.com/).\n- Navigate to the WhatsApp sandbox.\n- Configure the `/whatsapp` endpoint for communication.\n- Copy the Account SID, Auth Token, and WhatsApp Sandbox Number into `.env`\n\n## Author\n\n👤 **Vectara**\n\n- Website: https://vectara.com\n- Twitter: [@vectara](https://twitter.com/vectara)\n- GitHub: [@vectara](https://github.com/vectara)\n- LinkedIn: [@vectara](https://www.linkedin.com/company/vectara/)\n- Discord: [@vectara](https://discord.gg/GFb8gMz6UH)\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!\u003cbr/\u003e\nFeel free to check [issues page](https://github.com/vectara/ragtime/issues). You can also take a look at the [contributing guide](https://github.com/vectara/vectara-answer/blob/master/CONTRIBUTING.md).\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n## 📝 License\n\nCopyright © 2024 [Vectara](https://github.com/vectara).\u003cbr /\u003e\nThis project is [Apache 2.0](https://github.com/vectara/ragtime/blob/main/LICENSE) licensed.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvectara%2Fragtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvectara%2Fragtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvectara%2Fragtime/lists"}