AbsoluteJS

OUTCOME PLAYBOOK

Build a voice agent

Connect one caller, resolve a provider stack, complete a turn, and retain the trace needed to operate the call.

  1. 1. Choose
  2. 2. Install
  3. 3. Run
  4. 4. Verify
  5. 5. Harden
  6. 6. Operate

#Choose the package boundaries

Required packages establish the local success path. Production and operate packages close durability and evidence boundaries.

#Prerequisites

Choose cascaded STT/TTS or one realtime provider path.
Provider credentials, expected audio format, and a public route for telephony.
An application-owned session and retention policy.

#Install the complete surface

BASH
bun add @absolutejs/voice @absolutejs/voice-tester elysia

Smallest useful file tree

TXT
src/
  voice.ts        # runtime and route
  assistant.ts    # prompt, tools, handoff
  providers.ts    # STT/TTS or realtime adapters
  ops.ts          # trace, recording, cost, readiness
  voice.test.ts   # synthetic caller scenario

#Run and verify

Verify providers

Run one adapter contract or deterministic tester scenario before opening a live route.

Proof of success: The fixture yields the expected transcript or audio without an application server.

  1. 1. Choose
  2. 2. Install
  3. 3. Run
  4. 4. Verify
  5. 5. Harden
  6. 6. Operate

#Expected results

A client connects and receives the configured greeting.
One spoken turn produces a transcript and assistant response.
The session trace contains provider, latency, cost, tool, and completion evidence.

#Development to production

DevelopmentFixtures or one low-friction providerProductionReadiness-checked provider route with explicit fallback
Provider latency and availability are independent failure domains.
DevelopmentMemory session and trace storesProductionDurable scoped stores with retention policy
Calls, recordings, costs, and evidence outlive a process.

#Failure decisions

The call connects but no transcript appears.
Check firstVerify audio format, sample rate, credentials, and provider readiness before assistant logic.
ThenCorrect the adapter boundary and rerun its contract test.
Responses are late or overlap the caller.
Check firstCompare turn detection, barge-in, and provider latency on the session trace.
ThenTune the responsible stage instead of the whole assistant.