Skip to main content

Dual-agent voice orchestration built on livekit-agents

Project description

stimm

stimm logo

Dual-agent voice orchestration built on livekit-agents: one agent talks fast, one agent thinks deep, both collaborate in real-time.

Why Stimm

  • Low-latency conversational voice loop (VAD → STT → fast LLM → TTS).
  • High-capability supervisor loop (tool use, planning, contextual steering).
  • Typed protocol for Python + TypeScript supervisors.
  • Runtime-safe provider contract + generated provider catalog from LiveKit docs.
  • Integrator-friendly onboarding flow (discover providers first, install extras second).

Install

# 1) Core package only (best first step for setup wizards)
pip install stimm

# 2) Install only the providers selected by the user
pip install stimm[deepgram,openai]

# Optional: install all runtime-supported providers
pip install stimm[all]

# TypeScript supervisor client
npm install @stimm/protocol

Plugin dependencies are installed in the integrator app environment. Stimm does not vendor provider plugin code inside its wheel.

Wizard-first Provider Flow

For onboarding UIs, use the catalog API to display providers/parameters, then derive extras from the user selection:

from stimm import extras_install_command, get_provider_catalog

catalog = get_provider_catalog()  # exhaustive stt/tts/llm + parameters
cmd = extras_install_command(stt="deepgram", tts="openai", llm="azure-openai")
print(cmd)  # pip install stimm[deepgram,openai]

After extras installation, restart the Python process before instantiating LiveKit plugin classes.

Extension/wizard migration details are documented in docs/EXTENSION_WIZARD_INTEGRATION.md.

Quick Start

Voice Agent (Python)

from stimm import VoiceAgent
from livekit.plugins import deepgram, openai, silero

agent = VoiceAgent(
    stt=deepgram.STT(),
    tts=openai.TTS(),
    vad=silero.VAD.load(),
    fast_llm=openai.LLM(model="gpt-4o-mini"),
    buffering_level="MEDIUM",
    mode="hybrid",
    instructions="You are a helpful voice assistant.",
)

if __name__ == "__main__":
    from livekit.agents import WorkerOptions, cli
    cli.run_app(WorkerOptions(entrypoint_fnc=agent.entrypoint))

Supervisor (Python)

from stimm import Supervisor, TranscriptMessage


class MySupervisor(Supervisor):
    async def on_transcript(self, msg: TranscriptMessage):
        if not msg.partial:
            result = await my_big_llm.process(msg.text)
            await self.instruct(result.text, speak=True)

Supervisor (TypeScript)

import { StimmSupervisorClient } from "@stimm/protocol";

const client = new StimmSupervisorClient({
  livekitUrl: "ws://localhost:7880",
  token: supervisorToken,
});

client.on("transcript", async (msg) => {
  if (!msg.partial) {
    const result = await myAgent.process(msg.text);
    await client.instruct({ text: result, speak: true, priority: "normal" });
  }
});

await client.connect();

Core Concepts

Dual-Agent Architecture

Stimm is fundamentally built around two cooperating agents:

  • VoiceAgent: optimized for low-latency spoken interaction.
  • Supervisor: optimized for deeper reasoning, planning, and tool orchestration.

They exchange typed protocol messages over LiveKit data channels, allowing fast turn-by-turn response while retaining high-level control and context.

Component Role
VoiceAgent Handles live turn-by-turn speech interaction
Supervisor Watches transcript and steers behavior asynchronously
StimmProtocol Structured messages over LiveKit data channels

Modes:

  • autonomous: voice agent acts independently.
  • relay: voice agent only speaks supervisor instructions.
  • hybrid (default): autonomous with supervisor steering.

Pre-TTS buffering levels:

  • NONE, LOW, MEDIUM (default), HIGH.

Developer Workflow

# Install dev dependencies
pip install -e ".[dev]"

# Local infra
docker compose up -d

# Build local artifacts + sync providers + validate runtime contract
bash scripts/dev_build.sh

# Tests / lint
pytest
ruff check src/ tests/

# Catalog/contract checks (CI-equivalent)
python3 scripts/sync_livekit_plugins.py --check
python3 scripts/validate_runtime_contract.py --import-check

scripts/dev_build.sh is the single local command to rebuild protocol artifacts and provider metadata from the LiveKit source of truth.

Documentation

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stimm-0.1.12.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stimm-0.1.12-py3-none-any.whl (55.4 kB view details)

Uploaded Python 3

File details

Details for the file stimm-0.1.12.tar.gz.

File metadata

  • Download URL: stimm-0.1.12.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for stimm-0.1.12.tar.gz
Algorithm Hash digest
SHA256 b078775551ba64fdaf1f0f92d2ba0bbb8761533179d56945a72130c26c7929b6
MD5 52f8c6b3daaeeb97486296ff3e57706a
BLAKE2b-256 e646ab173a29a720062346ab8c68d07812322a9fdd52cc2f4f911b4e16b43813

See more details on using hashes here.

Provenance

The following attestation bundles were made for stimm-0.1.12.tar.gz:

Publisher: release.yml on stimm-ai/stimm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stimm-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: stimm-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 55.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for stimm-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 ef67c5144324d968f6fba7a8563ac7fe6032b08bcabef5446165f1e37f751702
MD5 588fe2ed28610dbd0a0e27ca33d77792
BLAKE2b-256 51d4a87cfcd2af3834dbcb2378f07ebbb86759a91b0b94f10d98f7ef94353120

See more details on using hashes here.

Provenance

The following attestation bundles were made for stimm-0.1.12-py3-none-any.whl:

Publisher: release.yml on stimm-ai/stimm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page