SAA (Selective Auditory Attention)
Decides per utterance whether speech was addressed to your voice agent, gating STT, LLM and TTS before transcription — no wake word required.
- Source repo
- attenlabs/saa-sdk
- Stars
- ★ 133
- Last updated
- 1mo ago
- FARS reviewed
- Dec 02, 2026
- License
- Apache-2.0
- Primary language
- Python
- FA score
- 50/100 · Major gaps
At a glance
- How it runs
- Works with
- Platform-specificOpenAI API (Partial support)
- Cost
- Free software; you pay for model usage
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- Browser voice assistant in an open office: coworkers talking and a podcast playing on the laptop stay out, and only speech aimed at the screen reaches STT.
- Not a fit if
- Teams whose audio cannot leave the device for a vendor cloud
- Products that need proven non-English recall today
- Website
- attentionlabs.ai ↗ set on GitHub
- Maintenance
- Commits in the last 30 dayslast commit 2026-11-03
- Source review
- 50/100 · Major gaps 2 safety controls not found
What does this agent do, and when should you use it?
SAA (Selective Auditory Attention) is a hosted addressee-detection classifier from attention labs that sits between your VAD and your STT and answers one question per utterance: was this speech directed at the device? This repository ships only the client side under Apache-2.0 — the @attenlabs/saa-js browser/Node client, the attenlabs-saa Python streaming client, and two bridges, saa-livekit-client and saa-pipecat-client, which join a LiveKit or Daily room and publish attention events on a "saa" data topic. Clients capture PCM16 16 kHz audio (plus optional low-rate video) and stream it over a real-time WebSocket to attention labs' cloud, where the model, weights and inference actually run; nothing is inferred locally. The primary output is turnReady / turn_ready, carrying one device-directed utterance's audio ready to forward to your STT or LLM; lower-level prediction, vad, state, interrupt, config and stats events are also emitted, and integrations typically gate on prediction.aligned_class == 2. For sealed rooms such as ElevenLabs Conversational AI and Twilio Media Streams the SDK runs in feed mode, where you supply frames via feed_audio instead of it capturing. The technical report (arXiv:2604.08412) reports 0.86 F1 audio-only and 0.95 F1 with audio+video fusion on a held-out evaluation, and the service fails closed when it is uncertain.
The client captures microphone audio, encodes it as PCM16 16 kHz (optionally with a low-rate video stream in the browser) and pushes it continuously over a WebSocket to the hosted inference endpoint, which returns per-utterance decisions. Events exposed to the caller are prediction (aligned_class plus confidence for the current audio), vad, state, interrupt, config and stats, along with the main turnReady / turn_ready event — one confirmed device-directed utterance, with turn.audio_base64 as PCM16 16 kHz audio and turn.audio_pcm16 as a numpy int16 array, ready to hand to your own STT or LLM. Control surface includes mute()/unmute(), setThreshold()/set_threshold() to move the operating point along the precision-recall curve, and markResponding()/mark_responding() to assert when the agent itself is speaking so the gate is suppressed during its own TTS. For LiveKit, start_attention_session brings SAA into the room as a participant and AttentionEngine subscribes to the "saa" data topic, letting you drive session.input.set_audio_enabled(...) from an engine.on_prediction callback; the Pipecat-on-Daily bridge mirrors this through Daily's app-message "saa" topic with engine.bind_task(task). ElevenLabs and Twilio use feed mode — AttentionClient(enable_audio=False, enable_video=False) plus feed_audio(pcm16) — and Twilio's μ-law 8 kHz frames must be transcoded to PCM16 16 kHz first.
- Browser voice assistant in an open office: coworkers talking and a podcast playing on the laptop stay out, and only speech aimed at the screen reaches STT.
- Multi-robot deployments: two Reachy robots in the same room hear identical audio, but only the addressed one acts while the other stays still.
- Telephony agents on Twilio Media Streams: hold music, side conversations and TTS echo are filtered before the bridge, so only device-directed call audio continues to STT.
- Teams already on LiveKit Agents or Pipecat: add an addressee gate via the shipped bridge packages and the "saa" data topic without rewriting the pipeline.
- Wake-word-free UX: substitute natural address for a fixed trigger phrase in hands-busy, multi-turn sessions where saying a keyword every time is the bottleneck.
- Proactive agents that speak first: call mark_responding(True) when TTS starts so the agent's own playback never comes back as user input.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
npm install @attenlabs/saa-js # JavaScript / browserpip install attenlabs-saa # Python (streaming SDK)pip install saa-livekit-client # Python (LiveKit)pip install saa-pipecat-client # Python (Pipecat on Daily)
- Environment variables
SAA_API_KEYLIVEKIT_URLLK_KEYLK_SECRET
How do you install or deploy this agent?
Install the package for your runtime, then get an API key at attentionlabs.ai/dashboard — the key is required for the hosted inference call.
npm install @attenlabs/saa-js # JavaScript / browser
pip install attenlabs-saa # Python (streaming SDK)
pip install saa-livekit-client # Python (LiveKit)
pip install saa-pipecat-client # Python (Pipecat on Daily)The SDK samples read the key from SAA_API_KEY. The LiveKit bridge additionally needs your LiveKit API key/secret and room name; the Pipecat bridge needs a Daily API key, room URL and room name; Twilio needs your own Media Streams bridge process.
How do you use this agent?
With the streaming SDK you capture the media and SAA emits typed events. JavaScript:
import { AttentionClient } from "@attenlabs/saa-js";
const client = new AttentionClient({ token: process.env.SAA_API_KEY });
// fires once per device-directed turn; turn.audioBase64 is PCM16 @ 16 kHz
client.on("turnReady", (turn) => yourSTT.send(turn.audioBase64));
await client.start({ videoElement: document.querySelector("video") });The Python equivalent, with audio-only deployment achieved by omitting videoElement (browser) or passing enable_video=False (Python):
import os
from saa import AttentionClient
client = AttentionClient(token=os.environ["SAA_API_KEY"])
@client.on_turn_ready
def _(turn):
# turn.audio_base64, PCM16 @ 16 kHz mono; turn.audio_pcm16, np.int16 array
your_stt.send(turn.audio_base64)
client.start()For LiveKit Agents, SAA joins your room and AttentionEngine turns its events into a gate:
from saa_livekit_client import AttentionEngine, attention_agent_token, start_attention_session
saa = await start_attention_session(
api_key=SAA_API_KEY, livekit_url=LIVEKIT_URL,
agent_token=attention_agent_token(api_key=LK_KEY, api_secret=LK_SECRET, room_name=ctx.room.name),
room_name=ctx.room.name, participant_identity=user.identity,
)
engine = AttentionEngine(ctx.room, agent_identity=saa.agent_identity)
@engine.on_prediction
def _(p):
session.input.set_audio_enabled(p.aligned_class == 2) # the gate
await engine.start()When the room is sealed and SAA cannot join it (ElevenLabs, Twilio), run feed mode and supply the frames yourself:
from saa import AttentionClient
# feed mode: the SDK captures nothing itself; you supply the audio
saa = AttentionClient(token=SAA_API_KEY, enable_audio=False, enable_video=False)
@saa.on_prediction
def _(p):
mic_to_agent.enabled = (p.aligned_class == 2) # 2 = addressed to the device
saa.start()
# in ElevenLabs' AudioInterface input callback:
saa.feed_audio(mic_pcm16)Before the agent speaks, call mark_responding(True) (engine.responding_start()/responding_stop() on the bridges) and clear it when TTS ends; use set_threshold() to loosen or tighten how readily audio is forwarded.
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
FARS trust-control audit
- confirmation before acting — Turn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
- dependency security — Pin versions and run a dependency audit (npm audit, pip-audit) before installing; prefer running it in a container.
What are this agent's strengths and limitations?
- Adds an explicit "was this addressed to the device?" decision between VAD and STT, cutting ghost responses and STT spend in multi-talker rooms.
- Apache-2.0 client SDKs that are deliberately model-agnostic: they gate the STT/LLM/TTS stack you already run instead of replacing it.
- Four documented integration paths with runnable samples — LiveKit, Pipecat on Daily, ElevenLabs and Twilio — so most voice stacks have a known shim.
- markResponding()/mark_responding() handles the agent's own TTS echo without a mute-the-mic hack.
- The technical report (arXiv:2604.08412) reports 0.86 F1 audio-only and 0.95 F1 with audio+video fusion on a held-out evaluation, with documented fail-closed behaviour.
- setThreshold()/set_threshold() gives a single explicit knob for trading false positives against missed commands.
- Inference runs only in attention labs' cloud; model and weights are not open source, so it cannot be self-hosted, and on-device delivery is a separate enterprise programme.
- Every decision costs one hosted round-trip, which adds latency before STT — addressed speech is not made faster.
- Cross-lingual recall is a stated limitation; confidence is highest for English, and heavy-overlap speech needs its own validation.
- Pricing is not documented in the repository, yet an API key from the vendor dashboard and network access are mandatory.
- Twilio integration still requires you to write a Media Streams bridge that decodes μ-law 8 kHz and resamples to PCM16 16 kHz with paced outbound audio.
- Accuracy figures come from the vendor's own held-out evaluation; there is no independent or multilingual benchmark in the repo.
How does this agent compare with similar options?
The README positions SAA explicitly against adjacent voice layers. VAD only answers "is anyone speaking right now" and fires on a coworker, the TV or the person next to your user. Speaker diarization and speaker ID answer "who is speaking" — but an enrolled user can address the person beside them, and an unenrolled stranger can speak straight to the device. Turn detection answers "have they finished" and says nothing about the addressee. A wake word requires a fixed trigger phrase that degrades in multi-turn, hands-busy use. Noise suppression only asks whether the audio is clean. SAA composes with all of them and can make the wake word optional where wake-word UX is the bottleneck.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| SAA (Selective Auditory Attention) This agent | 50 · Major gaps | Library / SDKFree + model costs | ★ 133 | 1mo ago | Python | — |
| Bolna Voice AI Agent Platform | 45 · Major gaps | Self-hosted serviceFree + model costs | ★ 838 | 1d ago | Python | OpenAI API |
| Voice AI Learning Path | 68 · Some gaps | Library / SDKFree | ★ 347 | 1mo ago | Astro | — |
| LiveKit Agents: Framework for Realtime Voice AI | 66 · Some gaps | CLIFree + model costs | ★ 15k | today | Python | OpenAI API · Claude API |
How does FollowAgents rate this agent?
Why each dimension lost points
README clearly states that audio and optional video are streamed to the attention labs cloud, with model and weights server-side, and it recommends short-lived browser tokens. However, there is no evidence of pre-capture user confirmation, least-privilege implementation, data retention/encryption/deletion policy, dependency manifests or lockfiles, and rollback is limited to a token kill switch. Scores: least_privilege=1, user_confirmation=0, data_flow_transparency=2, sensitive_data_handling=1, dependency_security=0, external_effects=1, rollback=1, source_attribution=2; attribution exists via README copyright, NOTICE/CITATION links and Apache-2.0, but publisher identity is unverified.
Install packages and tests for missing environment variables show RuntimeError, so a basic failure path exists. But README uses aligned_class==2 as addressed in LiveKit while Pipecat uses aligned_class==1 as suppressed, an inconsistency in class semantics, and there is no lockfile or dependency-version evidence. Scores: self_consistency=1, dependency_availability=1, failure_messages=1.
README covers web, kiosk, robotics, telephony, multi-talker and proactive-agent scenarios, and clearly states boundaries: not VAD, not speaker identification, not on-device, and it adds hosted round-trip latency. It supports JS/Python and multiple frameworks. But trigger precision depends on a hosted model, with only threshold and fail-closed documentation and no implementation evidence; operation requires network and an API key. Scores: audience_and_scenarios=2, capability_boundaries=3, trigger_precision=1, environment_fit=2.
README is well structured and includes install commands, FAQ, examples, known limitations and a full Apache-2.0 LICENSE. CHANGELOG is only linked with no content, maintenance responsibility is limited to a security email and copyright notice, and the publisher is unverified. Scores: information_architecture=2, install_notes=2, naming_stability=2, examples_and_faq=3, known_limitations=3, license=3, versioning_changelog=1, maintenance_responsibility=1.
Outputs are typed events and PCM16 turn audio that can feed STT directly; the value proposition of filtering non-addressed speech before STT is clear. But hosted round-trip latency and cost versus savings are not quantified, and no pricing is provided. Scores: output_usability=2, marginal_value=2, cost_benefit=1.
The 0.86/0.95 F1 claims cite only an arXiv identifier, with no report, data or reproducible experiment in the packet. README, SECURITY and tests corroborate some installation and error behavior, but core model claims cannot be cross-verified. The docs separate paper figures from real-world variance, but evidence remains thin. Scores: claim_traceability=1, cross_source_corroboration=1, fact_inference_separation=1.
- Not found in source: confirmation before actingTurn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
- Not found in source: dependency securityPin versions and run a dependency audit (npm audit, pip-audit) before installing; prefer running it in a container.
- The SDK streams microphone audio and optional video to a hosted cloud service; README does not describe pre-capture user consent, retention periods, encryption or deletion policy, so deployers must add privacy compliance.
- Browser use relies on bearer tokens; SECURITY.md recommends server-issued short-lived tokens, but the packet does not show a complete token-broker implementation, so long-lived keys must be kept out of front-end bundles.
- README uses aligned_class inconsistently between LiveKit and Pipecat (2 as addressed vs 1 as suppressed); verify actual event semantics before integration.
- The packet lacks dependency manifests, lockfiles and vulnerability-audit evidence, so dependency security cannot be statically confirmed.
- Core accuracy claims cite only an arXiv identifier with no reproducible experiment or data; publisher identity is unverified.
FAQ
How is this different from VAD?
Will the agent trigger on its own TTS?
Can I self-host it or run it offline?
What does it cost?
Is it reliable outside English?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.