Skip to content

Commit 1659151

Browse files
Merge pull request #143 from SmythOS/dev
Add Zoom RTMS example
2 parents ae376a0 + e7d51fa commit 1659151

File tree

9 files changed

+14084
-0
lines changed

9 files changed

+14084
-0
lines changed
Lines changed: 394 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,394 @@
1+
# Zoom RTMS + SmythOS SRE Integration
2+
3+
This example demonstrates how to integrate **Zoom's Real-Time Media Streaming (RTMS)** with **SmythOS SRE** to create intelligent meeting analysis agents that process live meeting data in real-time.
4+
5+
## Features
6+
7+
- **Real-time Transcript Processing**: Captures and analyzes Zoom meeting transcripts as they happen
8+
- **AI-Powered Analysis**: Uses SRE agents to extract insights, action items, and key decisions
9+
- **Vector Database Integration**: Stores transcript segments for semantic search (Pinecone)
10+
- **Cloud Storage**: Saves meeting summaries and data to AWS S3
11+
- **Meeting Intelligence**: Generates comprehensive meeting summaries and insights
12+
- **Scalable Architecture**: Built on SmythOS SRE for enterprise-grade performance
13+
14+
## Three Implementation Options
15+
16+
This example provides three implementation approaches:
17+
18+
### 1. JavaScript Version (`index.js`) - **Recommended**
19+
- **No TypeScript Issues**: Pure JavaScript implementation that runs immediately
20+
- **SRE Integration Ready**: Placeholder structure for easy SRE SDK integration
21+
- **Complete RTMS Integration**: Full Zoom WebSocket and webhook handling
22+
- **Zero Configuration**: Works with just `npm start`
23+
- **Production Ready**: Can be easily extended with real SRE functionality
24+
25+
### 2. TypeScript Version (`index.ts`)
26+
- **Complete AI Agent Integration**: Uses SmythOS SRE agents for advanced transcript analysis
27+
- **VectorDB Support**: Semantic search and indexing with Pinecone
28+
- **Cloud Storage**: AWS S3 integration for persistent data storage
29+
- **Advanced Analytics**: Sophisticated sentiment analysis, action item extraction, and decision tracking
30+
- **Requires**: SmythOS SRE SDK and additional API keys (may have dependency issues)
31+
32+
### 3. Simple Example (`simple-example.ts`)
33+
- **Basic Transcript Processing**: Simple keyword-based analysis without external AI dependencies
34+
- **Lightweight**: Only requires Node.js, Express, and WebSocket libraries
35+
- **Easy to Understand**: Clear demonstration of Zoom RTMS integration patterns
36+
- **No External APIs**: Works without OpenAI, Anthropic, Pinecone, or AWS credentials
37+
- **Perfect for**: Learning, testing, and basic transcript capture
38+
39+
## Architecture
40+
41+
```mermaid
42+
graph TB
43+
A[Zoom Meeting] --> B[RTMS Webhook]
44+
B --> C[Express Server]
45+
C --> D[SRE Agent]
46+
D --> E[LLM Analysis]
47+
D --> F[VectorDB Storage]
48+
D --> G[Cloud Storage]
49+
E --> H[Meeting Insights]
50+
F --> I[Transcript Search]
51+
G --> J[Meeting Summaries]
52+
```
53+
54+
## Quick Start
55+
56+
### Prerequisites
57+
58+
1. **Zoom App**: Create a Zoom app with RTMS permissions in the [Zoom Marketplace](https://marketplace.zoom.us/)
59+
2. **Node.js**: Version 18 or higher
60+
3. **API Keys**: OpenAI or Anthropic for AI analysis
61+
4. **Optional**: Pinecone for vector search, AWS S3 for storage
62+
63+
### Installation
64+
65+
1. **Clone and navigate to the example**:
66+
```bash
67+
cd sre/examples/11-zoom-rtms-integration
68+
```
69+
70+
2. **Install dependencies**:
71+
```bash
72+
npm install
73+
```
74+
75+
3. **Configure environment**:
76+
```bash
77+
cp env.example .env
78+
# Edit .env with your credentials
79+
```
80+
81+
4. **Start the server**:
82+
```bash
83+
# JavaScript version (recommended - no TypeScript issues)
84+
npm start
85+
86+
# TypeScript version with full SRE integration
87+
npm run ts
88+
89+
# Simple example without SRE dependencies
90+
npm run simple
91+
```
92+
93+
### Environment Configuration
94+
95+
Copy `env.example` to `.env` and configure:
96+
97+
```env
98+
# Required - Zoom RTMS Configuration
99+
ZOOM_CLIENT_ID=your_zoom_client_id
100+
ZOOM_CLIENT_SECRET=your_zoom_client_secret
101+
ZOOM_SECRET_TOKEN=your_zoom_secret_token
102+
103+
# Required - AI Model (choose one)
104+
OPENAI_API_KEY=your_openai_api_key
105+
# OR
106+
ANTHROPIC_API_KEY=your_anthropic_api_key
107+
108+
# Optional - VectorDB for transcript search
109+
PINECONE_API_KEY=your_pinecone_api_key
110+
PINECONE_INDEX_NAME=zoom-meetings
111+
112+
# Optional - Storage for meeting data
113+
AWS_ACCESS_KEY_ID=your_aws_access_key
114+
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
115+
AWS_S3_BUCKET=zoom-meeting-data
116+
```
117+
118+
## Zoom App Setup
119+
120+
### 1. Create Zoom App
121+
122+
1. Go to [Zoom Marketplace](https://marketplace.zoom.us/)
123+
2. Create a new **General App****User-Managed**
124+
3. Configure basic information
125+
126+
### 2. Configure RTMS Permissions
127+
128+
**Scopes Required**:
129+
- `meeting:read`
130+
- `meeting:write`
131+
- `rtms:read`
132+
- `rtms:write`
133+
134+
**Event Subscriptions**:
135+
- `meeting.rtms_started`
136+
- `meeting.rtms_stopped`
137+
- `endpoint.url_validation`
138+
139+
### 3. Webhook Configuration
140+
141+
Set your webhook endpoint URL to:
142+
```bash
143+
https://your-domain.com/webhook
144+
```
145+
146+
For local development, use [ngrok](https://ngrok.com/):
147+
```bash
148+
ngrok http 3000
149+
# Use the HTTPS URL: https://abc123.ngrok.io/webhook
150+
```
151+
152+
## SRE Agent Capabilities
153+
154+
The integration creates intelligent agents with these skills:
155+
156+
### 1. Real-time Transcript Analysis
157+
- Extracts key topics and themes
158+
- Identifies action items and decisions
159+
- Analyzes participant sentiment
160+
- Tracks important questions
161+
162+
### 2. Meeting Summarization
163+
- Generates comprehensive meeting summaries
164+
- Identifies next steps and follow-ups
165+
- Highlights key decisions and outcomes
166+
- Provides participant insights
167+
168+
### 3. Vector Search Integration
169+
- Indexes transcript segments for semantic search
170+
- Enables finding specific topics across meetings
171+
- Supports historical meeting analysis
172+
173+
### 4. Intelligent Storage
174+
- Saves meeting data to cloud storage
175+
- Organizes by meeting ID and timestamp
176+
- Preserves analysis results and summaries
177+
178+
## Usage Examples
179+
180+
### Basic Meeting Analysis
181+
182+
When a Zoom meeting starts with RTMS enabled:
183+
184+
1. **Webhook Triggered**: Server receives `meeting.rtms_started`
185+
2. **Agent Created**: SRE agent is instantiated for the meeting
186+
3. **WebSocket Connection**: Connects to Zoom's media stream
187+
4. **Real-time Processing**: Transcripts are analyzed as they arrive
188+
5. **Insights Generated**: Key information is extracted and stored
189+
190+
### Example Output
191+
192+
```json
193+
{
194+
"speaker": "John Doe",
195+
"timestamp": "2024-01-15T10:30:00Z",
196+
"transcript": "Let's schedule a follow-up meeting for next Tuesday to review the project proposal",
197+
"analysis": {
198+
"topics": ["meeting scheduling", "project review"],
199+
"actionItems": ["Schedule follow-up meeting for Tuesday"],
200+
"decisions": [],
201+
"questions": [],
202+
"sentiment": "positive"
203+
}
204+
}
205+
```
206+
207+
### Meeting Summary
208+
209+
```markdown
210+
# Meeting Summary - Project Review Call
211+
212+
## Overview
213+
Team discussion about Q1 project proposal and next steps.
214+
215+
## Key Decisions
216+
- Approved budget increase for additional resources
217+
- Selected vendor for cloud infrastructure
218+
219+
## Action Items
220+
- [ ] John: Schedule follow-up meeting for Tuesday
221+
- [ ] Sarah: Prepare vendor contract by Friday
222+
- [ ] Team: Review technical specifications
223+
224+
## Next Steps
225+
- Technical review session scheduled for next week
226+
- Final approval expected by month-end
227+
```
228+
229+
## API Endpoints
230+
231+
### Health Check
232+
```http
233+
GET /health
234+
```
235+
Returns server status and active meeting count.
236+
237+
### Webhook Endpoint
238+
```http
239+
POST /webhook
240+
```
241+
Receives Zoom RTMS events and processes meeting data.
242+
243+
## Advanced Configuration
244+
245+
### Custom SRE Configuration
246+
247+
You can customize the SRE initialization for production:
248+
249+
```typescript
250+
import { SRE } from '@smythos/sre';
251+
252+
// Custom SRE setup for enterprise
253+
SRE.init({
254+
Storage: {
255+
Connector: 'S3',
256+
Settings: { bucket: 'enterprise-meetings' }
257+
},
258+
VectorDB: {
259+
Connector: 'Pinecone',
260+
Settings: { indexName: 'company-meetings' }
261+
},
262+
Cache: {
263+
Connector: 'Redis',
264+
Settings: { url: 'redis://prod-cluster' }
265+
}
266+
});
267+
```
268+
269+
### Custom Agent Behaviors
270+
271+
Modify the agent behavior for specific use cases:
272+
273+
```typescript
274+
const agent = new Agent({
275+
name: 'Sales Meeting Assistant',
276+
behavior: `You are a sales meeting specialist. Focus on:
277+
- Lead qualification insights
278+
- Deal progression indicators
279+
- Customer objections and responses
280+
- Follow-up opportunities`,
281+
model: 'gpt-4o'
282+
});
283+
```
284+
285+
## Monitoring and Debugging
286+
287+
### Logging
288+
289+
Set `LOG_LEVEL=debug` for detailed logs:
290+
291+
```bash
292+
LOG_LEVEL=debug npm start
293+
```
294+
295+
### Health Monitoring
296+
297+
Check active meetings and agents:
298+
299+
```bash
300+
curl http://localhost:3000/health
301+
```
302+
303+
Response:
304+
```json
305+
{
306+
"status": "healthy",
307+
"activeMeetings": 2,
308+
"activeAgents": 2,
309+
"timestamp": "2024-01-15T10:30:00Z"
310+
}
311+
```
312+
313+
## Troubleshooting
314+
315+
### Common Issues
316+
317+
1. **No Transcript Data**:
318+
- Verify RTMS is enabled in Zoom settings
319+
- Check webhook URL is accessible
320+
- Ensure proper scopes are configured
321+
322+
2. **Agent Creation Fails**:
323+
- Verify AI API keys (OpenAI/Anthropic)
324+
- Check SRE initialization
325+
- Review log output for errors
326+
327+
3. **Storage Issues**:
328+
- Verify AWS credentials and permissions
329+
- Check S3 bucket exists and is accessible
330+
- Ensure proper IAM policies
331+
332+
4. **VectorDB Problems**:
333+
- Verify Pinecone API key and index name
334+
- Check index dimensions match embedding model
335+
- Ensure sufficient Pinecone quota
336+
337+
### Debug Commands
338+
339+
```bash
340+
# Test webhook endpoint
341+
curl -X POST http://localhost:3000/webhook \
342+
-H "Content-Type: application/json" \
343+
-d '{"event": "endpoint.url_validation", "payload": {"plainToken": "test"}}'
344+
345+
# Check server health
346+
curl http://localhost:3000/health
347+
```
348+
349+
## Security Considerations
350+
351+
- Store sensitive credentials in environment variables
352+
- Use HTTPS for webhook endpoints in production
353+
- Implement proper authentication for API endpoints
354+
- Regular rotation of API keys and tokens
355+
- Monitor access logs and usage patterns
356+
357+
## Scaling for Production
358+
359+
### Performance Optimization
360+
361+
- Use Redis for caching meeting data
362+
- Implement connection pooling for databases
363+
- Use load balancers for multiple instances
364+
- Monitor memory usage and optimize accordingly
365+
366+
### Enterprise Features
367+
368+
- Multi-tenant isolation with SRE scoping
369+
- Custom storage backends (enterprise databases)
370+
- Advanced security with HashiCorp Vault
371+
- Custom LLM models and fine-tuning
372+
373+
## Contributing
374+
375+
This example is part of the SmythOS SRE ecosystem. Contributions welcome!
376+
377+
1. Fork the repository
378+
2. Create a feature branch
379+
3. Add your improvements
380+
4. Submit a pull request
381+
382+
## License
383+
384+
MIT License - see the main SRE repository for details.
385+
386+
## Support
387+
388+
- [SmythOS Documentation](https://smythos.github.io/sre/)
389+
- [Discord Community](https://discord.gg/smythos)
390+
- [GitHub Issues](https://github.com/SmythOS/sre/issues)
391+
392+
---
393+
394+
## Built using SmythOS SRE - The Operating System for Agentic AI

0 commit comments

Comments
 (0)