A smart chatbot leveraging RAG (Retrieval-Augmented Generation) to update LLM context in real-time for Zoom meeting transcripts and summaries, powered by DataStax's AI Platform.
This project integrates Zoom's API with Astra DB to create a chatbot that can fetch, process, and store Zoom meeting data, and respond to user queries about this data. The bot uses OpenAI's language models for natural language processing and understanding.
The main goals of this project are:
- Fetch Zoom meeting data, including recordings and summaries.
- Store this data in Astra DB for efficient retrieval.
- Provide a chatbot interface in Zoom Team Chat for users to query this data.
- Use AI to interpret user queries and generate relevant responses based on the stored data.
This is the main entry point of the application. It sets up an Express server to handle incoming requests from Zoom's chatbot integration. Key functions:
- Initializes the server and middleware
- Defines routes for handling bot events
- Sets up error handling for uncaught exceptions and unhandled rejections
This file contains functions for interacting with the Zoom API. Key functions:
fetchAllData()
: Retrieves user data and their recordingsfetchUserRecordings()
: Gets recordings for a specific userfetchMeetingSummary()
: Retrieves the summary of a specific meeting
Handles server-to-server authentication with Zoom's OAuth 2.0 system. It manages token generation and caching for API calls.
Manages authentication for the Zoom chatbot, generating tokens for sending messages back to users.
Contains logic for processing bot events and sending responses. Key functions:
handleBotEvent()
: Processes incoming bot events and determines the appropriate responsesendChatMessage()
: Sends a message back to the user via Zoom ChatupdateZoomData()
: Triggers the data update process
Python script for interacting with Astra DB. It sets up the database connection and provides functions for creating and accessing collections.
Handles the process of loading fetched Zoom data into Astra DB.
Contains the AI logic for processing user queries and generating responses based on the data stored in Astra DB.
Provides utility functions for running Python scripts from Node.js, which is crucial for integrating the Python-based AI and database operations with the Node.js server.
The .env file contains crucial configuration and credentials. Here's what each variable represents:
ASTRA_DB_*
: Credentials and endpoints for your Astra DB instanceLANGFLOW_*
: Credentials and endpoints for your DataStax Langflow instanceZOOM_CLIENT_ID
andZOOM_CLIENT_SECRET
: Credentials for Zoom OAuth appZOOM_BOT_JID
: Jabber ID for your Zoom chatbotZOOM_ACCOUNT_ID
: Your Zoom account IDOAuth_Client_ID
andOAuth_Client_Secret
: Credentials for Zoom server-to-server OAuth appzoomApiBaseUrl
: Base URL for Zoom API calls
Take a look at the provided .env.example for reference.
- Go to the Zoom App Marketplace and create a new Chat App.
- Set up the necessary permissions (chat:write, etc.).
- Configure the bot endpoint URL to point to your server's /anthropic endpoint.
- Note down the Bot JID and Credentials (Client ID and Secret).
- In the Zoom App Marketplace, create a new Server-to-Server OAuth app.
- Grant it the necessary permissions to access user data and recordings.
- Note down the Account ID, Client ID, and Client Secret.
- Create an Astra DB account and set up a new database.
- Create an application token with the necessary permissions.
- Note down the Database ID, Application Token, and API Endpoint.
Obtain an API key from OpenAI's platform.
- Python: Ensure you have Python 3.7 or later installed. You can download it from python.org.
- Node.js: Ensure you have Node.js installed. You can download it from nodejs.org.
-
Clone the repository:
git clone https://github.com/ojusave/zmail_astradb.git cd zmail_astradb
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Create a
.env
file:- Copy the contents of
.env.example
into a new file named.env
. - Fill in the required environment variables with your own values.
- Copy the contents of
-
Install the required dependencies:
npm install
-
Run the Node.js application:
node server.js
- Ensure all environment variables are correctly set in the .env file.
- Start the server with
node server.js
as stated above. - Use the Zoom Chat interface to send messages to your bot.
When a user sends a message:
- Zoom sends a POST request to your server's /anthropic endpoint.
handleBotEvent()
in sendMessage.js processes the request.- If the message is "update", it triggers the data update process.
- For other messages, it runs the zoom_ai_bot.py script to generate a response.
- The response is sent back to the user via Zoom Chat using
sendChatMessage()
.
- Ensure your server is accessible to Zoom's servers for webhook delivery.
- Regularly update your Zoom data to keep the Astra DB current.
- Implement proper error handling and logging for production use.