Skip to content

This repository contains code that enables the integration of Zoom email functionality with AstraDB, along with the capability to vectorize email content for advanced processing. Zoom is a widely-used video conferencing platform with email features, and AstraDB is a distributed cloud database built on Apache Cassandra™.

Notifications You must be signed in to change notification settings

avb-is-me/zmail_astradb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zoom AstraDB RAG Chatbot

Overview

Table of Contents

======= 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.

What We're Trying to Achieve

The main goals of this project are:

  1. Fetch Zoom meeting data, including recordings and summaries.
  2. Store this data in Astra DB for efficient retrieval.
  3. Provide a chatbot interface in Zoom Team Chat for users to query this data.
  4. Use AI to interpret user queries and generate relevant responses based on the stored data.

File Structure and Functionality

server.js

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

Zoom/api/zoomApiCalls.js

This file contains functions for interacting with the Zoom API. Key functions:

  • fetchAllData(): Retrieves user data and their recordings
  • fetchUserRecordings(): Gets recordings for a specific user
  • fetchMeetingSummary(): Retrieves the summary of a specific meeting

Zoom/authentication/serverToServerAuth.js

Handles server-to-server authentication with Zoom's OAuth 2.0 system. It manages token generation and caching for API calls.

Zoom/authentication/chatbotTokenAuth.js

Manages authentication for the Zoom chatbot, generating tokens for sending messages back to users.

Zoom/chatbot/sendMessage.js

Contains logic for processing bot events and sending responses. Key functions:

  • handleBotEvent(): Processes incoming bot events and determines the appropriate response
  • sendChatMessage(): Sends a message back to the user via Zoom Chat
  • updateZoomData(): Triggers the data update process

datastax/astra_db.py

Python script for interacting with Astra DB. It sets up the database connection and provides functions for creating and accessing collections.

datastax/load_data.py

Handles the process of loading fetched Zoom data into Astra DB.

datastax/zoom_ai_bot.py

Contains the AI logic for processing user queries and generating responses based on the data stored in Astra DB.

utils/pythonUtils.js

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.

Environment Variables (.env)

The .env file contains crucial configuration and credentials. Here's what each variable represents:

  • ASTRA_DB_*: Credentials and endpoints for your Astra DB instance
  • OPENAI_API_KEY: API key for OpenAI services
  • GROQ_API_KEY: API key for Groq (if used)
  • ZOOM_CLIENT_ID and ZOOM_CLIENT_SECRET: Credentials for Zoom OAuth app
  • ZOOM_BOT_JID: Jabber ID for your Zoom chatbot
  • ZOOM_ACCOUNT_ID: Your Zoom account ID
  • OAuth_Client_ID and OAuth_Client_Secret: Credentials for Zoom server-to-server OAuth app
  • zoomApiBaseUrl: Base URL for Zoom API calls

Setting Up Credentials

Zoom Teams Chatbot Configuration

  1. Go to the Zoom App Marketplace and create a new Chat App.
  2. Set up the necessary permissions (chat:write, etc.).
  3. Configure the bot endpoint URL to point to your server's /anthropic endpoint.
  4. Note down the Bot JID and Credentials (Client ID and Secret).

Zoom Server-to-Server OAuth App Configuration

  1. In the Zoom App Marketplace, create a new Server-to-Server OAuth app.
  2. Grant it the necessary permissions to access user data and recordings.
  3. Note down the Account ID, Client ID, and Client Secret.

Astra DB Setup

  1. Create an Astra DB account and set up a new database.
  2. Create an application token with the necessary permissions.
  3. Note down the Database ID, Application Token, and API Endpoint.

OpenAI API Key

Obtain an API key from OpenAI's platform.

Testing the App

  1. Ensure all environment variables are correctly set in the .env file.
  2. Run npm install to install dependencies.
  3. Start the server with node server.js.
  4. Use the Zoom Chat interface to send messages to your bot.

Message Flow

When a user sends a message:

  1. Zoom sends a POST request to your server's /anthropic endpoint.
  2. handleBotEvent() in sendMessage.js processes the request.
  3. If the message is "update", it triggers the data update process.
  4. For other messages, it runs the zoom_ai_bot.py script to generate a response.
  5. The response is sent back to the user via Zoom Chat using sendChatMessage().

Additional Notes

  • 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.

About

This repository contains code that enables the integration of Zoom email functionality with AstraDB, along with the capability to vectorize email content for advanced processing. Zoom is a widely-used video conferencing platform with email features, and AstraDB is a distributed cloud database built on Apache Cassandra™.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 60.8%
  • JavaScript 39.2%