mcpbeat Sign in

Deepgram Js Voice Agent Agent Skill

Use when writing or reviewing JavaScript/TypeScript in this repo that builds an interactive voice agent via `agent.deepgram.com/v1/agent/converse`. Covers `client.agent.v1.createConnection()` / `connect()`, `sendSettings`, `sendMedia`, runtime updates, event handling, and function-call responses. Use `deepgram-js-text-to-speech` for one-way synthesis, `deepgram-js-speech-to-text` or `deepgram-js-conversational-stt` for transcription only, and `deepgram-js-management-api` for project/model admin rather than live agent runtime. Triggers include "voice agent", "agent converse", "full duplex", "barge-in", "function calling", and "agent.v1".

2k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
269
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/deepgram/deepgram-js-sdk --skill deepgram-js-voice-agent

The instruction itself

10 sections, as written by the author

Using Deepgram Voice Agent (JavaScript / TypeScript SDK)

Full-duplex voice agent runtime over wss://agent.deepgram.com/v1/agent/converse: audio in, LLM orchestration, audio out, plus function calling and prompt/runtime updates.

When to use this product

  • You want an interactive voice assistant where the user speaks, the agent thinks, and the agent responds with speech.
  • You need function / tool calling inside the conversation loop.
  • You want Deepgram to host the STT + think + TTS orchestration.

Use a different skill when:

  • You only need transcription → deepgram-js-speech-to-text or deepgram-js-conversational-stt.
  • You only need synthesis → deepgram-js-text-to-speech.
  • You want project keys, usage, models, or other admin APIs → deepgram-js-management-api.

Authentication

require("dotenv").config();

const { DeepgramClient, DeepgramEnvironment } = require("@deepgram/sdk");

const deepgramClient = new DeepgramClient({
  apiKey: process.env.DEEPGRAM_API_KEY,
  environment: DeepgramEnvironment.Agent,
});

The websocket itself is routed to the agent host by src/CustomClient.ts, but the repo example uses DeepgramEnvironment.Agent so client.agent.v1.settings.think.models.list() also points at the agent base.

Quick start

From examples/09-voice-agent.ts:

const deepgramConnection = await deepgramClient.agent.v1.createConnection();

deepgramConnection.on("message", (data) => {
  if (data.type === "ConversationText") {
    console.log("Conversation text:", data);
  } else if (typeof data === "string") {
    console.log("Audio received (length):", data.length);
  }
});

deepgramConnection.connect();
await deepgramConnection.waitForOpen();

deepgramConnection.sendSettings({
  type: "Settings",
  audio: {
    input: { encoding: "linear16", sample_rate: 24000 },
    output: { encoding: "linear16", sample_rate: 16000, container: "wav" },
  },
  agent: {
    language: "en",
    listen: { provider: { type: "deepgram", model: "nova-3" } },
    think: {
      provider: { type: "open_ai", model: "gpt-4o-mini" },
      prompt: "You are a friendly AI assistant.",
    },
    speak: { provider: { type: "deepgram", model: "aura-2-thalia-en" } },
    greeting: "Hello! How can I help you today?",
  },
});

The same example also shows client.agent.v1.settings.think.models.list() for discovering supported think models.

Key parameters / API surface

  • Connection setup: client.agent.v1.createConnection() / connect().
  • First outbound control message: sendSettings(AgentV1Settings).
  • Runtime updates: sendUpdatePrompt(...), sendUpdateThink(...), sendUpdateSpeak(...), sendInjectUserMessage(...), sendInjectAgentMessage(...), sendFunctionCallResponse(...), sendKeepAlive(...), sendMedia(...).
  • Important inbound events from src/api/resources/agent/resources/v1/client/Socket.ts: Welcome, SettingsApplied, ConversationText, UserStartedSpeaking, AgentThinking, FunctionCallRequest, AgentStartedSpeaking, AgentAudioDone, Warning, Error, plus audio payloads.

Limitations

This SDK exposes the live agent runtime plus settings.think.models.list(), but it does not expose persisted Voice Agent configuration CRUD endpoints in the current generated surface.

API reference (layered)

  • In-repo reference: reference.mdAgent V1 Settings Think Models; live websocket behavior is defined in src/CustomClient.ts and src/api/resources/agent/resources/v1/client/{Client,Socket}.ts.
  • Canonical OpenAPI (REST): https://developers.deepgram.com/openapi.yaml
  • Canonical AsyncAPI (WSS): https://developers.deepgram.com/asyncapi.yaml
  • Context7: library ID /llmstxt/developers_deepgram_llms_txt
  • Product docs:
  • https://developers.deepgram.com/reference/voice-agent/voice-agent
  • https://developers.deepgram.com/docs/voice-agent
  • https://developers.deepgram.com/docs/configure-voice-agent
  • https://developers.deepgram.com/docs/voice-agent-message-flow

Gotchas

  • Settings must be first. Send sendSettings({ type: "Settings", ... }) immediately after the socket opens.
  • Audio and JSON events share the same message stream. Your message handler must branch on typeof data and data.type.
  • Keepalive matters. examples/09-voice-agent.ts sends KeepAlive every 5 seconds to preserve long sessions.
  • Encoding/sample rates must line up on both sides. Mismatches cause distorted uploads or unusable playback.
  • Think-model discovery is separate from the websocket. Use client.agent.v1.settings.think.models.list() before choosing providers.
  • Function-call requests arrive as arrays. Inspect data.functions[], then answer with sendFunctionCallResponse({ type: "FunctionCallResponse", id, name, content }).
  • Persisted agent configurations are not in this SDK today. If you need stored configs, use raw HTTP or another SDK surface.

Example files in this repo

  • examples/09-voice-agent.ts
  • examples/34-agent-custom-providers.ts
  • examples/35-agent-provider-combinations.ts
  • examples/36-agent-inject-message.ts

Central product skills

For cross-language Deepgram product knowledge — the consolidated API reference, documentation finder, focused runnable recipes, third-party integration examples, and MCP setup — install the central skills:

npx skills add deepgram/skills

This SDK ships language-idiomatic code skills; deepgram/skills ships cross-language product knowledge (see api, docs, recipes, examples, starters, setup-mcp).

Other skills for the same job

different authors, same section of the catalogue
Pydicom
by christophacham
×3

Python library for working with DICOM (Digital Imaging and Communications in Medicine) files. Use this skill when reading, writing, or modifying medical imaging data in DICOM format, extracting pixel data from medical images (CT, MRI, X-ray, ultrasound), anonymizing DICOM files, working with DICOM metadata and tags, converting DICOM images to other formats, handling compressed DICOM data, or processing medical imaging datasets. Applies to tasks involving medical image analysis, PACS systems, radiology workflows, and healthcare imaging applications.

13k tokens scripts
Pydicom
by ComeOnOliver
×3

Python library for working with DICOM (Digital Imaging and Communications in Medicine) files. Use this skill when reading, writing, or modifying medical imaging data in DICOM format, extracting pixel data from medical images (CT, MRI, X-ray, ultrasound), anonymizing DICOM files, working with DICOM metadata and tags, converting DICOM images to other formats, handling compressed DICOM data, or processing medical imaging datasets. Applies to tasks involving medical image analysis, PACS systems, radiology workflows, and healthcare imaging applications.

15k tokens scripts
Remotion Best Practices
by ncklrs
×3

Best practices for Remotion - Video creation in React

19k tokens
Podcast Generation
by microsoft
vendor ×2

Generate AI-powered podcast-style audio narratives using Azure OpenAI's GPT Realtime Mini model via WebSocket. Use when building text-to-speech features, audio narrative generation, podcast creation from content, or integrating with Azure OpenAI Realtime API for real audio output. Covers full-stack implementation from React frontend to Python FastAPI backend with WebSocket streaming.

4k tokens scripts
Remotion Best Practices
by ComeOnOliver
×2

Best practices for Remotion - Video creation in React

23k tokens
Remotion To Hyperframes
by aiskillstore
×1

Port an existing Remotion (React) composition''s source to HyperFrames HTML. Use ONLY on an explicit ask to port/convert/migrate/translate a Remotion source — one-way, Remotion-only. A passing Remotion mention, reference-only code, or "make something like my Remotion video" is a fresh build (/general-video). Unclear → /hyperframes.

88k tokens scripts
Gemini API Dev
by lingxling
×1

Use this skill when building applications with Gemini API hosted models, including Gemini and Gemma 4, working with multimodal content (text, images, audio, video), implementing function calling, using structured outputs, or needing current model specifications. Covers SDK usage...

2k tokens
Github Issue Creator
by lingxling
×1

Turn error logs, screenshots, voice notes, and rough bug reports into crisp, developer-ready GitHub issues with repro steps, impact, and evidence.

1k tokens

How to use it

Copy the folder

Take deepgram/deepgram-js-voice-agent from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference npx. Without those the skill loads but fails at the first command.