Skip to content

Commit 84c8478

Browse files
committed
Unify Monday showcase page structure to match other showcase pages
1 parent aa9e663 commit 84c8478

File tree

1 file changed

+25
-273
lines changed

1 file changed

+25
-273
lines changed

docs/showcase/monday.mdx

Lines changed: 25 additions & 273 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,25 @@ sidebar_position: 9
55
keywords: [monday, AI, VR, education, accessibility, voice-assistant, 3D-visualization, multimodal-learning, perplexity, elevenlabs]
66
---
77

8-
# Monday – Voice-First AI Learning Assistant
9-
10-
**Monday** is a voice-enabled AI learning companion designed to bridge the gap between natural language queries and high-quality educational content. Inspired by Marvel’s JARVIS and FRIDAY, and educational platforms like Khan Academy and 3Blue1Brown, Monday delivers tailored responses in three modes—Basic, Reasoning, and Deep Research—while integrating immersive visualizations, curated video content, and accessibility-first design.
11-
12-
Our mission: make learning adaptive, inclusive, and hands-free—whether you’re seeking quick facts, step-by-step reasoning, or deep academic research.
8+
**Monday** is a voice-enabled AI learning companion designed to bridge the gap between natural language queries and high-quality educational content. Inspired by Marvel's JARVIS and FRIDAY, Monday delivers tailored responses in three modes—Basic, Reasoning, and Deep Research—while integrating immersive visualizations, curated video content, and accessibility-first design.
139

1410
## Features
1511

16-
- **Three Learning Modes**:
17-
- **Basic Mode** – Quick factual answers with citations.
18-
- **Reasoning Mode** – Step-by-step logical explanations (triggered by the phrase "think about").
19-
- **Deep Research Mode** – Multi-source investigations visualized as connected knowledge webs (triggered by the phrase "research into").
20-
- **Voice-first interaction** for hands-free learning.
21-
- **Real-time 3D visualizations** of concepts using Three.js & WebXR.
22-
- **Curated educational Youtube video integration** from trusted sources.
23-
- **Smart Search Algorithm** that extracts keywords from AI response content using NLP and filters results for educational, embeddable content.
24-
- **Multi-modal feedback** combining text, speech (via ElevenLabs), and spatial panels.
25-
- **VR-optional** design for immersive experiences without requiring a headset.
26-
- **Accessibility-focused interface** for mobility- and vision-impaired users.
27-
28-
## Example Flow:
29-
30-
User: "Hey Monday, think about photosynthesis"
31-
- AI Response: "Photosynthesis involves chlorophyll, sunlight, and carbon dioxide..."
32-
- Keywords Extracted: ["photosynthesis", "chlorophyll", "sunlight"]
33-
- YouTube Query: "photosynthesis chlorophyll sunlight explained tutorial analysis"
34-
- Result: 3 relevant educational videos about photosynthesis
12+
* **Three Learning Modes**: Basic factual answers, step-by-step reasoning, and deep research investigations
13+
* **Voice-first interaction** for hands-free learning with natural language processing
14+
* **Real-time 3D visualizations** of concepts using Three.js & WebXR
15+
* **Curated educational YouTube video integration** from trusted sources
16+
* **Multi-modal feedback** combining text, speech (via ElevenLabs), and spatial panels
17+
* **VR-optional design** for immersive experiences without requiring a headset
18+
* **Accessibility-focused interface** for mobility- and vision-impaired users
3519

3620
## Prerequisites
3721

38-
Before using Monday, ensure you have:
39-
40-
- A device with a microphone.
41-
- Modern web browser (Chrome, Edge, or Firefox recommended).
42-
- Optional: VR headset for immersive mode (WebXR compatible).
43-
- Internet connection for API-driven responses and 3D assets.
22+
* Node.js 18 LTS or newer
23+
* Modern web browser (Chrome, Edge, or Firefox recommended)
24+
* Microphone for voice interaction
25+
* Optional: VR headset for immersive mode (WebXR compatible)
26+
* Perplexity API key, ElevenLabs API key, and YouTube API key
4427

4528
## Installation
4629

@@ -68,253 +51,22 @@ npm run dev
6851

6952
## Usage
7053

71-
1. Launch the app in your browser.
72-
2. Say **"Hey Monday"** to activate the assistant.
54+
1. Launch the app in your browser
55+
2. Say **"Hey Monday"** to activate the assistant
7356
3. Ask a question in one of three modes:
74-
- **Basic Mode** – “What is photosynthesis?”
75-
- **Reasoning Mode** – “Think about how blockchain works.”
76-
- **Deep Research Mode** – “Research into the history of quantum mechanics.”
77-
4. View answers as:
78-
- Floating text panels.
79-
- Voice responses.
80-
- Interactive 3D models (when relevant)
57+
- **Basic Mode** – "What is photosynthesis?"
58+
- **Reasoning Mode** – "Think about how blockchain works."
59+
- **Deep Research Mode** – "Research into the history of quantum mechanics."
60+
4. View answers as floating text panels, voice responses, and interactive 3D models
8161

8262
## Code Explanation
8363

84-
## Voice Command Processing & Activation (Frontend)
85-
86-
```ts
87-
private async processCommand(event: CommandEvent): Promise<void> {
88-
const normalizedTranscript = event.transcript.toLowerCase().trim()
89-
const isActivation = normalizedTranscript.includes('hey monday')
90-
const isWithinConversation = this.isConversationActive()
91-
92-
console.log(`🔍 CommandProcessor: Evaluating command: "${event.transcript}"`, {
93-
isActivation,
94-
isWithinConversation,
95-
conversationActive: this.conversationContext.active,
96-
timeSinceLastCommand: this.conversationContext.lastCommandTime ?
97-
Date.now() - this.conversationContext.lastCommandTime : 'N/A'
98-
})
99-
100-
if (isActivation || isWithinConversation) {
101-
console.log(`✅ CommandProcessor: Processing command: "${event.transcript}"`)
102-
103-
// Update context
104-
if (isActivation && !this.conversationContext.active) {
105-
this.startConversation()
106-
}
107-
this.conversationContext.lastCommandTime = event.timestamp
108-
this.conversationContext.commandCount++
109-
110-
// Send to backend
111-
await this.sendToBackend(event.transcript, isActivation)
112-
113-
// Notify UI listeners
114-
this.notifyListeners()
115-
} else {
116-
console.log(`🚫 CommandProcessor: Ignoring non-conversation command: "${event.transcript}"`)
117-
}
118-
119-
event.processed = true
120-
}
121-
```
122-
**Description**:
123-
The CommandProcessor manages voice-command routing and conversation context on the client. It checks whether the transcript contains the wake phrase (“hey monday”) or an ongoing conversation is active. Only then is the user’s command treated as actionable. On activation, it may start a new conversation session, timestamp the interaction, and dispatch the raw transcript to the backend (sendToBackend). Inputs outside an active session without the trigger phrase are ignored.
124-
125-
## Backend Voice Command Handler (Socket.IO Server)
126-
```ts
127-
socket.on('voice_command', async (data: any) => {
128-
logger.info('Voice command received', { socketId: socket.id, command: data.command?.substring(0, 50) })
129-
130-
const command = parseCommand(data.command || '')
131-
if (!command) {
132-
socket.emit('monday_response', {
133-
type: 'error',
134-
content: 'Please start your command with "Monday"',
135-
timestamp: Date.now()
136-
})
137-
return
138-
}
139-
140-
// Handle different command types
141-
switch (command.type) {
142-
case 'greeting':
143-
socket.emit('monday_response', {
144-
type: 'greeting',
145-
content: "Hello! I'm Monday, your AI learning companion. ... What would you like to learn about today?",
146-
timestamp: Date.now()
147-
})
148-
break
149-
150-
case 'basic':
151-
if (command.content) {
152-
const response = await perplexityService.processQuery({
153-
query: command.content,
154-
mode: 'basic',
155-
sessionId: data.sessionId
156-
})
157-
socket.emit('monday_response', {
158-
type: 'basic_response',
159-
content: response.content,
160-
citations: response.citations,
161-
metadata: response.metadata,
162-
timestamp: Date.now()
163-
})
164-
}
165-
break
166-
167-
case 'reasoning':
168-
if (command.content) {
169-
const response = await perplexityService.processQuery({
170-
query: command.content,
171-
mode: 'reasoning',
172-
sessionId: data.sessionId
173-
})
174-
socket.emit('monday_response', {
175-
type: 'reasoning_response',
176-
content: response.content,
177-
reasoning: response.reasoning,
178-
citations: response.citations,
179-
metadata: response.metadata,
180-
timestamp: Date.now()
181-
})
182-
}
183-
break
184-
185-
case 'deepResearch':
186-
if (command.content) {
187-
const response = await perplexityService.processQuery({
188-
query: command.content,
189-
mode: 'research',
190-
sessionId: data.sessionId
191-
})
192-
socket.emit('monday_response', {
193-
type: 'research_response',
194-
content: response.content,
195-
sources: response.sources,
196-
citations: response.citations,
197-
metadata: response.metadata,
198-
timestamp: Date.now()
199-
})
200-
}
201-
break
202-
203-
// ... (spatial and focus commands omitted for brevity)
204-
}
205-
})
206-
207-
```
208-
**Description**: The server receives voice_command events and parses them to infer intent (e.g., greeting, basic Q&A, reasoning, deep research). For each type, it invokes the Perplexity service with the corresponding mode and the user’s query. The resulting answer—including content, citations, and, where applicable, a reasoning chain or research sources—is emitted back to the client as a monday_response with a type aligned to the mode.
209-
210-
## AI Query Processing (Perplexity Service Integration)
211-
```ts
212-
Copy
213-
Edit
214-
const result = await this.makeRequest('/chat/completions', requestData)
215-
return {
216-
id: result.id || 'reasoning_query',
217-
model: result.model || 'sonar-reasoning',
218-
content: result.choices?.[0]?.message?.content || 'No response generated',
219-
citations: this.extractCitations(result),
220-
reasoning: this.extractReasoningSteps(result.choices?.[0]?.message?.content || ''),
221-
metadata: {
222-
tokensUsed: result.usage?.total_tokens || 0,
223-
responseTime: 0
224-
}
225-
}
226-
```
227-
**Description**: PerplexityService prepares a mode-specific request and calls the external API. It returns a structured result containing the main answer (content), any citations, and—when in reasoning mode—a parsed list of reasoning steps. Using the Sonar API, it also includes metadata such as token usage and the model identifier.
228-
229-
230-
## Reasoning Workflow — Extracting Step-by-Step Logic
231-
```ts
232-
Copy
233-
Edit
234-
private extractReasoningSteps(content: string): ReasoningStep[] {
235-
const steps: ReasoningStep[] = []
236-
const lines = content.split('\n')
237-
let stepCount = 0
238-
239-
for (const line of lines) {
240-
// Look for step indicators like "Step 1:" or "1."
241-
const stepMatch = line.match(/^(?:Step\s+)?(\d+)[:.]?\s*(.+)$/i)
242-
if (stepMatch) {
243-
stepCount++
244-
steps.push({
245-
step: stepCount,
246-
content: stepMatch[2].trim(),
247-
confidence: 0.8,
248-
sources: []
249-
})
250-
}
251-
}
252-
return steps
253-
}
254-
```
255-
**Description:** In reasoning mode, answers are expected to include an ordered thought process. This utility scans the text for step indicators (e.g., “Step 1:” or “1.”), producing a structured array of steps with content and an initial confidence score. This enables the client to render reasoning as a clear, enumerated sequence.
256-
257-
## VR Spatial Response Visualization
258-
```ts
259-
Copy
260-
Edit
261-
function createSpatialPanels(response: any, mode: string, query: string): any[] {
262-
const panels: any[] = []
263-
264-
// Main content panel
265-
panels.push({
266-
id: `panel_${Date.now()}_main`,
267-
type: 'content',
268-
position: [0, 1.5, -2],
269-
rotation: [0, 0, 0],
270-
title: mode === 'greeting' ? 'Welcome to Monday' : `Learning: ${query}`,
271-
content: response.content,
272-
isActive: true,
273-
opacity: 1,
274-
createdAt: Date.now()
275-
})
276-
277-
// Citations panel if available
278-
if (response.citations && response.citations.length > 0) {
279-
panels.push({
280-
id: `panel_${Date.now()}_citations`,
281-
type: 'content',
282-
position: [2, 1.2, -1.5],
283-
rotation: [0, -30, 0],
284-
title: 'Sources & Citations',
285-
content: response.citations.map((c, i) =>
286-
`${i + 1}. ${c.title}\n${c.snippet}`
287-
).join('\n\n'),
288-
citations: response.citations,
289-
isActive: false,
290-
opacity: 0.8,
291-
createdAt: Date.now()
292-
})
293-
}
294-
295-
// Reasoning panel for complex queries
296-
if (response.reasoning && response.reasoning.length > 0) {
297-
panels.push({
298-
id: `panel_${Date.now()}_reasoning`,
299-
type: 'reasoning',
300-
position: [-2, 1.2, -1.5],
301-
rotation: [0, 30, 0],
302-
title: 'Reasoning Steps',
303-
content: response.reasoning.map((r) =>
304-
`Step ${r.step}: ${r.content}`
305-
).join('\n\n'),
306-
reasoning: response.reasoning,
307-
isActive: false,
308-
opacity: 0.8,
309-
createdAt: Date.now()
310-
})
311-
}
312-
313-
return panels
314-
}
315-
```
316-
317-
**Description**: To bridge AI output into a 3D presentation, the backend constructs spatial panel objects. A main content panel is centered; optional citations and reasoning panels are positioned to the sides. Each panel has an ID, type, position/rotation, title, content, and opacity. These definitions are sent with the response so the client can render floating informational boards in VR.
64+
* **Frontend**: TypeScript with Three.js for 3D visualizations and WebXR for VR support
65+
* **Backend**: Node.js with Socket.IO for real-time voice command processing
66+
* **AI Integration**: Perplexity Sonar API for intelligent responses with reasoning extraction
67+
* **Voice Processing**: ElevenLabs for speech synthesis and natural language understanding
68+
* **Content Curation**: YouTube API integration with smart keyword extraction for educational videos
69+
* **Accessibility**: Voice-first design with spatial audio and haptic feedback support
31870

31971
## Links
32072

0 commit comments

Comments
 (0)