Skip to content

Replace AssemblyAI STT with Inworld STT API#55

Merged
cherylafichter merged 6 commits into
mainfrom
claude/inworld-stt-integration-uAqiI
Mar 16, 2026
Merged

Replace AssemblyAI STT with Inworld STT API#55
cherylafichter merged 6 commits into
mainfrom
claude/inworld-stt-integration-uAqiI

Conversation

@cherylafichter
Copy link
Copy Markdown
Contributor

  • Create InworldSTTNode using Inworld's REST API (POST /stt/v1/transcribe) with energy-based VAD for end-of-turn detection
  • Remove assembly-ai-stt-ws-node.ts and its WebSocket-based streaming logic
  • Update ConversationGraphWrapper to hold inworldSTTNode reference
  • Update ConversationGraphConfig to accept inworldApiKey (was assemblyAIApiKey)
  • Replace ASSEMBLY_AI_API_KEY env var with INWORLD_API_KEY in graph-service, .env.example, and render.yaml (single key for all Inworld services)
  • Replace AssemblyAI turn-detection presets in server config with equivalent Inworld STT VAD presets (silenceThresholdMs / minSpeechMs / energyThreshold)
  • Rename ASSEMBLY_AI_EAGERNESS env var to INWORLD_STT_EAGERNESS
  • Update comments in connection-manager, transcript-extractor-node, server, and audio-processor.js to reflect the new STT provider

https://claude.ai/code/session_01EDqcCeQHNj2f2TVeFb5Dxh

- Create InworldSTTNode using Inworld's REST API (POST /stt/v1/transcribe)
  with energy-based VAD for end-of-turn detection
- Remove assembly-ai-stt-ws-node.ts and its WebSocket-based streaming logic
- Update ConversationGraphWrapper to hold inworldSTTNode reference
- Update ConversationGraphConfig to accept inworldApiKey (was assemblyAIApiKey)
- Replace ASSEMBLY_AI_API_KEY env var with INWORLD_API_KEY in graph-service,
  .env.example, and render.yaml (single key for all Inworld services)
- Replace AssemblyAI turn-detection presets in server config with equivalent
  Inworld STT VAD presets (silenceThresholdMs / minSpeechMs / energyThreshold)
- Rename ASSEMBLY_AI_EAGERNESS env var to INWORLD_STT_EAGERNESS
- Update comments in connection-manager, transcript-extractor-node, server, and
  audio-processor.js to reflect the new STT provider

https://claude.ai/code/session_01EDqcCeQHNj2f2TVeFb5Dxh
@cherylafichter cherylafichter requested a review from a team as a code owner March 11, 2026 22:43
Copilot AI review requested due to automatic review settings March 11, 2026 22:43
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

claude added 2 commits March 11, 2026 22:46
- Fix prettier line-length formatting for Buffer.from() call in inworld-stt-node.ts
- Remove unused samplesPerMs variable in inworld-stt-node.ts
- Fix prettier line-length formatting for description string in server.ts

https://claude.ai/code/session_01EDqcCeQHNj2f2TVeFb5Dxh
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the backend speech-to-text pipeline from AssemblyAI’s streaming WebSocket node to a new Inworld STT REST-based node with energy-based VAD, and removes AssemblyAI-specific configuration/env keys accordingly.

Changes:

  • Removed AssemblyAI env/config usage and updated logs/comments to reference Inworld STT.
  • Added InworldSTTNode (REST transcription + energy-based VAD) and rewired the conversation graph to use it.
  • Updated server config to provide VAD “eagerness” presets for the new STT approach.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
render.yaml Removes ASSEMBLY_AI_API_KEY from Render env vars.
frontend/public/audio-processor.js Updates comments to reflect Inworld STT + energy-based VAD chunking rationale.
backend/src/services/graph-service.ts Switches graph init env validation from AssemblyAI key to INWORLD_API_KEY.
backend/src/server.ts Updates documentation/log strings to reflect Inworld STT usage.
backend/src/helpers/connection-manager.ts Updates STT naming + changes session teardown behavior for STT cleanup.
backend/src/graphs/nodes/transcript-extractor-node.ts Updates node documentation to reference Inworld STT output.
backend/src/graphs/nodes/inworld-stt-node.ts New node implementing energy-based VAD + REST transcription.
backend/src/graphs/nodes/assembly-ai-stt-ws-node.ts Removes the AssemblyAI WebSocket STT node implementation.
backend/src/graphs/conversation-graph.ts Replaces AssemblyAI STT node with InworldSTTNode and updates graph wiring/config.
backend/src/config/server.ts Replaces AssemblyAI turn-detection presets with Inworld STT VAD presets and env var.
backend/.env.example Removes ASSEMBLY_AI_API_KEY from the example env file.
Files not reviewed (1)
  • backend/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/src/helpers/connection-manager.ts Outdated
Comment thread backend/src/graphs/nodes/inworld-stt-node.ts
Comment thread backend/src/graphs/nodes/inworld-stt-node.ts Outdated
cherylafichter pushed a commit that referenced this pull request Mar 12, 2026
- Add 30s timeout protection to callInworldSTT to prevent network stalls
- Fix session lifecycle: remove shared STT node destruction from
  ConnectionManager.destroy() since the node is shared across sessions

https://claude.ai/code/session_01TJxsn7u4AVgj7UHWPffSha
claude and others added 3 commits March 12, 2026 18:01
- Add AbortController with 15s timeout to callInworldSTT fetch to prevent
  indefinite stalls on network/endpoint hangs
- Remove inworldSTTNode.destroy() from ConnectionManager.destroy(): the graph
  wrapper is a singleton shared across sessions, so tearing down the STT node
  during per-session cleanup would disrupt other active sessions

https://claude.ai/code/session_01EDqcCeQHNj2f2TVeFb5Dxh
…method

- Add src/__tests__/graphs/inworld-stt-node.test.ts with 16 tests covering:
  constructor validation, text-input bypass, VAD end-of-turn detection,
  onSpeechDetected callback, STT API error handling, 15s AbortController
  timeout, pendingTranscript stitching, session validation, metadata fields,
  and iteration tracking
- Remove never-called private sendPartialTranscript method (fixes TS6133)
- All 57 backend tests pass; tsc --noEmit clean

https://claude.ai/code/session_01EDqcCeQHNj2f2TVeFb5Dxh
- Add backend/.prettierignore to exclude dist/ and node_modules/
- Replace all no-explicit-any in inworld-stt-node.test.ts with proper types
- Fix (message.data as any) in websocket-handler.ts with typed DataWithMessages

Made-with: Cursor
@cherylafichter cherylafichter merged commit 86c827f into main Mar 16, 2026
1 of 2 checks passed
@cherylafichter cherylafichter deleted the claude/inworld-stt-integration-uAqiI branch March 16, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants