Skip to content

Quickstart

Syrinx is published on npm as @kuralle-syrinx/*. Install the packages you need, plug in your providers, and you have a voice agent — no repository to clone.

Terminal window
npm install @kuralle-syrinx/core @kuralle-syrinx/deepgram @kuralle-syrinx/cartesia @kuralle-syrinx/aisdk ai @ai-sdk/openai
Terminal window
DEEPGRAM_API_KEY=...
OPENAI_API_KEY=...
CARTESIA_API_KEY=...
CARTESIA_VOICE_ID=...

Wire a cascade — Deepgram STT → an AI SDK reasoner → Cartesia TTS — with Deepgram owning turn detection:

import { VoiceAgentSession } from '@kuralle-syrinx/core';
import { DeepgramSTTPlugin } from '@kuralle-syrinx/deepgram';
import { CartesiaTTSPlugin } from '@kuralle-syrinx/cartesia';
import { ReasoningBridge, fromStreamText } from '@kuralle-syrinx/aisdk';
import { createOpenAI } from '@ai-sdk/openai';
const openai = createOpenAI({ apiKey: process.env.OPENAI_API_KEY });
const session = new VoiceAgentSession({
plugins: {
stt: { api_key: process.env.DEEPGRAM_API_KEY!, model: 'nova-3', sample_rate: 16000, emit_eos_on_final: true },
bridge: {},
tts: { api_key: process.env.CARTESIA_API_KEY!, voice_id: process.env.CARTESIA_VOICE_ID! },
},
endpointingOwner: 'provider_stt',
});
session.registerPlugin('stt', new DeepgramSTTPlugin());
session.registerPlugin('bridge', new ReasoningBridge(fromStreamText({
model: openai('gpt-4.1-mini'),
system: 'You are a helpful voice assistant. Keep your replies short.',
})));
session.registerPlugin('tts', new CartesiaTTSPlugin());

That’s the whole agent: audio in becomes a transcript, the transcript becomes a reply, the reply becomes audio. Swap any provider — a different STT vendor, or a realtime speech-to-speech model instead of a cascade — and the session shape stays the same.

The session above is the conversation logic; to feed it live audio you attach a transport:

  • Browser — Syrinx’s resumable WebSocket audio protocol.
  • Telephony — a Twilio or Telnyx phone call.
  • Cloudflare Workers — run the whole thing on the edge, one Durable Object per call. See Deploy on Cloudflare.

Want a complete, runnable headless demo — audio fixture in, transcript, reply, audio out, with per-stage latency timings — before wiring your own transport? Browse or run run-kuralle-cascade-clean.ts in examples/02-hello-voice-headless on GitHub.