Skip to content

Commit aa9e663

Browse files
authored
Update monday.mdx
1 parent 1b9d1de commit aa9e663

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

docs/showcase/monday.mdx

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ Our mission: make learning adaptive, inclusive, and hands-free—whether you’r
2020
- **Voice-first interaction** for hands-free learning.
2121
- **Real-time 3D visualizations** of concepts using Three.js & WebXR.
2222
- **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.
23+
- **Smart Search Algorithm** that extracts keywords from AI response content using NLP and filters results for educational, embeddable content.
2424
- **Multi-modal feedback** combining text, speech (via ElevenLabs), and spatial panels.
2525
- **VR-optional** design for immersive experiences without requiring a headset.
2626
- **Accessibility-focused interface** for mobility- and vision-impaired users.
2727

2828
## Example Flow:
2929

3030
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
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
3535

3636
## Prerequisites
3737

@@ -59,7 +59,7 @@ PERPLEXITY_API_KEY=your_api_key
5959
ELEVENLABS_API_KEY=your_api_key
6060
YOUTUBE_API_KEY=your_api_key
6161

62-
# Start Backend Server (Terminal 1)
62+
# Start Backend Server
6363
node backend-server.js
6464

6565
# Start frontend
@@ -81,7 +81,7 @@ npm run dev
8181

8282
## Code Explanation
8383

84-
# Voice Command Processing & Activation (Frontend)
84+
## Voice Command Processing & Activation (Frontend)
8585

8686
```ts
8787
private async processCommand(event: CommandEvent): Promise<void> {
@@ -118,11 +118,12 @@ private async processCommand(event: CommandEvent): Promise<void> {
118118

119119
event.processed = true
120120
}
121-
Description:
121+
```
122+
**Description**:
122123
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.
123124

124-
#Backend Voice Command Handler (Socket.IO Server)
125-
125+
## Backend Voice Command Handler (Socket.IO Server)
126+
```ts
126127
socket.on('voice_command', async (data: any) => {
127128
logger.info('Voice command received', { socketId: socket.id, command: data.command?.substring(0, 50) })
128129

@@ -202,11 +203,12 @@ socket.on('voice_command', async (data: any) => {
202203
// ... (spatial and focus commands omitted for brevity)
203204
}
204205
})
205-
# Description
206-
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 users query. The resulting answerincluding content, citations, and, where applicable, a reasoning chain or research sourcesis emitted back to the client as a monday_response with a type aligned to the mode.
207206

208-
#AI Query Processing (Perplexity Service Integration)
209-
ts
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
210212
Copy
211213
Edit
212214
const result = await this.makeRequest('/chat/completions', requestData)
@@ -221,12 +223,12 @@ return {
221223
responseTime: 0
222224
}
223225
}
224-
Description
225-
PerplexityService prepares a mode-specific request and calls the external API. It returns a structured result containing the main answer (content), any citations, andwhen in reasoning modea parsed list of reasoning steps. Using the Sonar API, it also includes metadata such as token usage and the model identifier.
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.
226228

227229

228-
#Reasoning WorkflowExtracting Step-by-Step Logic
229-
ts
230+
## Reasoning Workflow — Extracting Step-by-Step Logic
231+
```ts
230232
Copy
231233
Edit
232234
private extractReasoningSteps(content: string): ReasoningStep[] {
@@ -249,11 +251,11 @@ private extractReasoningSteps(content: string): ReasoningStep[] {
249251
}
250252
return steps
251253
}
252-
Description
253-
In reasoning mode, answers are expected to include an ordered thought process. This utility scans the text for step indicators (e.g., “Step 1:” or1.”), 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.
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.
254256

255-
#VR Spatial Response Visualization
256-
ts
257+
## VR Spatial Response Visualization
258+
```ts
257259
Copy
258260
Edit
259261
function createSpatialPanels(response: any, mode: string, query: string): any[] {
@@ -310,9 +312,9 @@ function createSpatialPanels(response: any, mode: string, query: string): any[]
310312

311313
return panels
312314
}
315+
```
313316

314-
Description
315-
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.
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.
316318

317319
## Links
318320

0 commit comments

Comments
 (0)