Repository navigation
STUDY_ARENA_ROADMAP
⚠️ Historical (W30, 2026-07). This document describes the vendoredfeatures/ai-classroom/studyArenamicroservice, which was removed. The live implementation is native underserver/services/study-arena/(see study-arena-inspired-by-openmaic.md) and attribution is at OpenMAIC-ATTRIBUTION.md. Kept for historical reference only.
This document serves as an architectural blueprint for adding advanced AI classroom capabilities natively to the Study Arena, completely leveraging the internal backend (server/services/study-arena/) and the lightweight IniClaw LLM gateway.
Status (2026-06-30): Sections 1–3 are shipped, not future work — the implementation diverged from the original IniClaw-routed blueprint below.
- TTS —
POST /api/ai-classroom/tts(OpenAItts-1). ✅- ASR —
POST /api/ai-classroom/asr(multipart audio → OpenAIwhisper-1). ✅- Whiteboard —
client/src/components/ai-classroom/WhiteboardCanvas.tsx, driven bywb_*/widget_*director actions. ✅- Presentation export —
POST /api/ai-classroom/export/:id(PPTX),GET …/export/:id/html, and…/export/:id/zip, viaserver/services/study-arena/{pptx-export,html-export}.ts. ✅- Web search for agents (Section 4) — shipped at the service + API layer:
server/services/web-search.tsandPOST /api/ai/web-search. Works keyless via DuckDuckGo and upgrades to Tavily/Serper whenTAVILY_API_KEY/SERPER_API_KEYis set. Remaining follow-up: have the streaming director call it mid-generation (the current director uses a JSON-action protocol, not function-calling, so this is a deliberate next step rather than a gap). ✅The architecture notes below are retained for historical context.
Goal: Enable vocal interactions. The AI teacher and assistants can speak their dialogue, and the user can talk back using their microphone.
-
TTS Generation: Integrate an external provider like ElevenLabs, OpenAI TTS, or Google Cloud TTS via
server/services/study-arena/audio-service.ts. -
Playback Sync: When
orchestrator.tsgenerates dialogue events (text_delta), trigger TTS generation asynchronously. Send audio URLs down to the client via Server-Sent Events (SSE) alongside text. -
ASR (Speech-to-Text): Utilize the browser's native
SpeechRecognitionAPI (Web Speech API) or OpenAI Whisper API. If using Whisper, add a route/api/ai-classroom/transcribethat accepts audio blobs and forwards them to IniClaw.
- Add a new proxy route
/audio/transcribeinfeatures/ai-classroom/ini_claw/gateway.js. - Add a proxy route for
/audio/speech(TTS).
Goal: Allow multiple AI agents (e.g., teacher and assistant) to dynamically draw flowcharts, math equations, and diagrams on a shared whiteboard during chat.
-
State Management: The whiteboard state must be shared and appended to.
shared/study-arena.tsalready hasWhiteboardActionRecord. -
Agent Actions: In
director-prompt.ts, extend the allowed JSON tool calls to includedraw_shape,draw_text,draw_arrow,clear_board. -
Frontend Rendering: Implement an SVG-based whiteboard component in
client/src/components/study-arena/Whiteboard.tsx. When the frontend receives anactionevent of typedraw_*from the SSE stream, it animates the drawing on the SVG canvas.
- Update
AgentInfointypes.tsto ensure tools for drawing are strictly defined. - In the React frontend, maintain a local
Zustandstore for whiteboard elements.
Goal: Allow users to export generated AI classroom slides to .pptx or interactive self-contained .html.
-
PPTX Generation: Add a package like
pptxgenjsto the backend. Create a new serviceserver/services/study-arena/export-service.ts. -
Data Mapping: Translate the MongoAIClassroom slide schema (text, images, bullet points) into
PptxGenJSslide objects. -
API Endpoint: Create
/api/ai-classroom/export/:id?format=pptxthat generates the file buffer and returns it with aContent-Disposition: attachmentheader.
Goal: Allow the AI agents to pull real-time data from the web (e.g., current stock prices, recent news) when generating lessons or chatting.
-
Tool Definition: Add a
web_searchtool toai-sdk-adapter.tsandgemini-adapter.ts. - Search Provider: Use a provider like Tavily API, Serper.dev, or DuckDuckGo.
-
IniClaw Update: Create a
/tools/searchroute in IniClaw to rate-limit search API queries. Agents will pause generation, execute the search tool via IniClaw, inject the results into context, and resume generating.
Goal: Structured, multi-stage projects where the user selects a role, and the AI guides them through milestones (e.g., building a website, analyzing a dataset).
-
Schema Updates: Add
pbltoSceneTypeinshared/study-arena.ts(already present!). Define a new Mongo schemaMongoAIPBLJobto track milestones, tasks, and completion status. -
State Machine: In
orchestrator.ts, create a distinct branch for PBL mode that validates milestone completion before allowing progression. -
Frontend UI: Build a specialized
PBLDashboard.tsxshowing a progress tree, current tasks, and an embedded code editor or artifact viewer.
-
Phase 1: Implement Whiteboard actions in
director-prompt.tsand build the SVG React component. (Highest visual impact). -
Phase 2: Integrate TTS playback streaming in the
orchestrator.tsSSE pipeline. -
Phase 3: Build the
/exportAPI usingPptxGenJS.