Dual-agent voice orchestration built on livekit-agents
Project description
stimm
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
- Docusaurus docs site source: website
- Extension wizard integration: website/docs/integrations/wizard.md
- Supervisor observability integration: website/docs/integrations/supervisor-observability.md
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b078775551ba64fdaf1f0f92d2ba0bbb8761533179d56945a72130c26c7929b6
|
|
| MD5 |
52f8c6b3daaeeb97486296ff3e57706a
|
|
| BLAKE2b-256 |
e646ab173a29a720062346ab8c68d07812322a9fdd52cc2f4f911b4e16b43813
|
Provenance
The following attestation bundles were made for stimm-0.1.12.tar.gz:
Publisher:
release.yml on stimm-ai/stimm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stimm-0.1.12.tar.gz -
Subject digest:
b078775551ba64fdaf1f0f92d2ba0bbb8761533179d56945a72130c26c7929b6 - Sigstore transparency entry: 1018117821
- Sigstore integration time:
-
Permalink:
stimm-ai/stimm@a547258f37eb99d7ee35e3d85cef2c3642ccb896 -
Branch / Tag:
refs/tags/stimm-v0.1.12 - Owner: https://github.com/stimm-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a547258f37eb99d7ee35e3d85cef2c3642ccb896 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef67c5144324d968f6fba7a8563ac7fe6032b08bcabef5446165f1e37f751702
|
|
| MD5 |
588fe2ed28610dbd0a0e27ca33d77792
|
|
| BLAKE2b-256 |
51d4a87cfcd2af3834dbcb2378f07ebbb86759a91b0b94f10d98f7ef94353120
|
Provenance
The following attestation bundles were made for stimm-0.1.12-py3-none-any.whl:
Publisher:
release.yml on stimm-ai/stimm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stimm-0.1.12-py3-none-any.whl -
Subject digest:
ef67c5144324d968f6fba7a8563ac7fe6032b08bcabef5446165f1e37f751702 - Sigstore transparency entry: 1018117845
- Sigstore integration time:
-
Permalink:
stimm-ai/stimm@a547258f37eb99d7ee35e3d85cef2c3642ccb896 -
Branch / Tag:
refs/tags/stimm-v0.1.12 - Owner: https://github.com/stimm-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a547258f37eb99d7ee35e3d85cef2c3642ccb896 -
Trigger Event:
push
-
Statement type: