Own the realtime voice stack
Build browser and phone voice agents with streaming STT, model routing, tools, RAG, TTS, telephony, framework helpers, fallback, reconnection, and session storage.
Self-hosted voice operations for AbsoluteJS: realtime browser voice, phone-call routes, provider routing, assistants, handoffs, traces, evals, readiness proof, storage adapters, and framework-native UI helpers.
bun add @absolutejs/voice @absolutejs/voice-deepgram @absolutejs/voice-elevenlabs elysia| Entrypoint | Purpose |
|---|---|
@absolutejs/voice | Server runtime, Elysia plugin, assistants, routing, ops, telephony, proof, storage, and core types. |
@absolutejs/voice/angular | Angular injectable services for streams, controllers, widgets, and dashboards. |
@absolutejs/voice/client | Browser primitives, stores, Web Components, HTMX bindings, audio players, and dashboard renderers. |
@absolutejs/voice/drizzle | Drizzle table schemas for runtime storage, memory, handoff, evals, observability, incidents, and proof trends. |
@absolutejs/voice/embed | Embeddable browser voice widget ESM entry. |
@absolutejs/voice/embed/voice-widget.js | Prebuilt IIFE widget bundle for script-tag embedding. |
@absolutejs/voice/react | React hooks and components for voice widgets, operational dashboards, timelines, and live consoles. |
@absolutejs/voice/svelte | Svelte store factories and helper creators for voice UI surfaces. |
@absolutejs/voice/testing | Provider simulators, STT/TTS fixtures, benchmarks, resilience harnesses, and review helpers. |
@absolutejs/voice/vue | Vue components and composables for the same browser and ops surfaces. |
Runnable provider-backed start: set DEEPGRAM_API_KEY, ELEVENLABS_API_KEY, and ELEVENLABS_VOICE_ID, then run this file. It constructs both adapters, starts the server on port 3000, and prints the exact WebSocket URL. The first successful connection receives the greeting; one spoken turn is transcribed and echoed through TTS.
import { Elysia } from "elysia";
import { createVoiceMemoryStore, voice } from "@absolutejs/voice";
import { deepgram } from "@absolutejs/voice-deepgram";
import { elevenlabs } from "@absolutejs/voice-elevenlabs";
const sessions = createVoiceMemoryStore();
const stt = deepgram({ apiKey: process.env.DEEPGRAM_API_KEY! });
const tts = elevenlabs({
apiKey: process.env.ELEVENLABS_API_KEY!,
voiceId: process.env.ELEVENLABS_VOICE_ID!
});
new Elysia()
.use(voice({
path: "/voice/realtime",
session: sessions,
stt,
tts,
greeting: "Hi, how can I help?",
context: async ({ session }) => ({ sessionId: session.id }),
onTurn: async (_session, turn, api) => {
await api.say(`You said: ${turn.text}`);
}
}))
.listen(3000);
console.log("voice websocket: ws://localhost:3000/voice/realtime");The full example app uses one shared channelDefaults() factory and spreads it into browser intake, OpenAI Realtime, and telephony bridge routes. That keeps phrase hints, correction, handoff, live ops, assistant ops, profile switching, session storage, and completion persistence consistent across channels.
import { createVoiceConfiguration, voice } from "@absolutejs/voice";
const channelDefaults = (channelPath: string) => ({
correctTurn,
handoff: handoffAdapters.length > 0 ? { adapters: handoffAdapters, deliveryQueue } : undefined,
liveOps: liveOpsRuntime,
onTurn: contractAwareOnTurn,
ops: assistant.ops,
preset: "reliability" as const,
profileSwitchGuard: createProfileSwitchGuard(channelPath),
session: sessionStore,
onComplete: async ({ session }) => persistIntake(buildSavedIntake(session)),
phraseHints: async ({ context, sessionId }) => {
await rememberSessionRoutingMode({ context, sessionId });
return VOICE_DEMO_PHRASE_HINTS;
}
});
export const voiceConfig = createVoiceConfiguration({
...channelDefaults("/voice/intake"),
path: "/voice/intake",
stt,
tts,
htmx: renderSavedIntakeHtmx
});
app.use(voice(voiceConfig));| Feature Family | Included Surfaces |
|---|---|
Agent and workflow logic | Assistants, agents, squads, model routing, tools, RAG, MCP, Vapi import, pathways, pathway compiler/runtime/generator/visualizer, pathway slot collector, IVR plans, outcome recipes, workflow contracts, and tool contracts. |
Voice runtime | Reconnect, barge-in, cached TTS, filler audio, audio conditioning, noise suppression, semantic turns, turn profiles, correction, scribe, recording, redaction, prompt-injection guard, guardrails, and zero-data-retention controls. |
Telephony and outbound | Twilio, Telnyx, Plivo, phone agents, phone provisioning, carrier matrices, media proof, webhook verification, DTMF, AMD, hold audio, whisper channel, backchannel, live coach, supervisor presence, campaigns, dialers, DNC registry, calling windows, call quotas, no-show prediction, reminders, and telephony outcome policy. |
Business systems | Caller memory, assistant memory, CRM caller linking, CRM call logging, CRM contracts, calendar adapters, calendar slots, booking flows, variable analytics, cost accounting, cost prediction, post-call analysis, post-call surveys, transcript annotation, call disposition, call scorecards, AI scorecards, calibration, and quality drift detection. |
Production proof | Production readiness, readiness profiles, proof assertions, proof runner, proof packs, proof trends, provider health, provider orchestration, provider decision traces, provider router traces, provider SLOs, provider stack recommendations, provider contract matrices, platform coverage, competitive coverage, realtime provider contracts, reconnect contracts, multilingual proof, resilience, diagnostics, trace timelines, incident bundles, and operations records. |
Client and framework surfaces | Core browser client, microphone capture, duplex controller, reactive sources, HTMX, Web Components, embed bundle, React, Vue, Svelte, Angular, dashboards, live call viewer, live agent console, call player, cost dashboard, provider dashboards, replay timeline, proof trends, turn quality, turn latency, routing status, session observability, and session snapshots. |
Storage and delivery | Memory, file, S3, SQLite, Postgres, Drizzle runtime storage, recording stores, audit stores, trace stores, ops stores, delivery sinks, audit delivery, trace delivery, observability export, OpenTelemetry export, retention, data control, and webhook fanout. |
Testing ecosystem | Core testing helpers, fixtures, provider simulators, I/O simulators, STT/TTS testing, duplex testing, resilience testing, accuracy benchmarks, session benchmarks, telephony tests, corrected transcript tests, voice-tester scenarios, Twilio WS transport, Discord transport, outbound Twilio transport, Aura TTS, Deepgram STT, LLM caller decisions, and μ-law utilities. |
Current package surface
Import surface · click to copy
Outcomes
Build browser and phone voice agents with streaming STT, model routing, tools, RAG, TTS, telephony, framework helpers, fallback, reconnection, and session storage.
Run support, scheduling, outreach, meeting-recording, and compliance-sensitive workflows with simulations, proof packs, live monitoring, operator controls, and post-call analysis.
Hardening checklist
Follow in order