Builds a streaming speech-to-text pipeline that diarizes audio, accumulates structured transcripts as SttConversation, and feeds them to agents. Includes a web UI for reviewing and correcting speaker labels.
Ships in atomr-agents-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
atomr-agents-stt-harness drives speech-to-text as a harness-style
loop. It opens a streaming STT session, pumps audio, diarizes, and
folds the stream into an SttConversation that maps to/from the
agentic TurnInput / Message types. atomr-agents-stt-harness-web is
the optional axum + React review UI on top of it.
to_turn_input) or to
compose in a workflow (SttHarnessRef is Callable).stt-harness-web.SpeechToText::transcribe directly. Don't use it for live
bidirectional voice (STT↔agent↔TTS) — that's tts-voice::Conversation.SttHarnessuse std::sync::Arc;
use atomr_agents_stt_core::{MockSpeechToText, PcmBuffer};
use atomr_agents_stt_harness::{
AudioSource, DiarizationPolicy, SttHarness, SttHarnessSpec,
StreamingLoop, StreamEndTermination,
};
let backend = Arc::new(MockSpeechToText::new().with_text("hello world"));
let audio = AudioSource::Pcm(PcmBuffer::new(vec![0.0; 16_000], 16_000, 1));
let harness = SttHarness::new(
SttHarnessSpec::new("call-review")
.with_diarization(DiarizationPolicy::Backend),
backend, // any Arc<dyn SpeechToText>
audio,
StreamingLoop::default(), // SttLoopStrategy
StreamEndTermination, // SttTermination
);
let mut events = harness.events(); // subscribe BEFORE run()
let conversation = harness.run().await?; // -> SttConversation
SttHarnessSpec::into_harness(...) instead returns a type-erased
SttHarnessRef (use for registries / Python / workflow composition).
Audio source (AudioSource):
Pcm(PcmBuffer) — always available, the test/CI path.File(path) / Bytes { data, format } — need the decode feature.Mic(MicOptions) — needs the mic feature.Diarization (DiarizationPolicy):
Off — turns carry no speaker.Backend — trust the backend's speaker tags. Use when
backend.capabilities().diarization is SpeakerCount / NamedSpeakers
(Deepgram, AssemblyAI).Layered(Arc<dyn Diarizer>) — run a local diarizer over the
utterance PCM. Use when the backend's diarization is None (Whisper,
OpenAI). MockDiarizer is the deterministic test double.DiarizationWarning event; the run continues.Loop / termination: StreamingLoop::new(voice_mode) (VoiceMode::Live
surfaces partials as events; TurnBased buffers them). Termination:
StreamEndTermination (default), UtteranceCapTermination,
AudioSecsTermination, BudgetTermination, CompositeTermination.
SttConversation// Feed an agent: last turn -> `user`, the rest -> `history`.
let map = SpeakerMap::default(); // speaker 0..n => User
if let Some(turn_input) = conversation.to_turn_input(&map) {
let result = agent_ref.turn(turn_input.user, ctx).await?;
conversation.append_agent_reply(result.text); // keep a full record
}
// Editable speaker labels — the numeric id is stable, the label is not.
conversation.rename_speaker(0, "Alice");
assert_eq!(conversation.effective_label(0), "Alice"); // override > tag label > "speaker_0"
SttTurn carries speaker: SpeakerRef (Diarized { tag } /
Role { role } / Unknown), text, timing, words, state.
use atomr_agents_stt_harness::{ConversationStore, InMemoryConversationStore};
let store = InMemoryConversationStore::new(); // volatile default
store.put(&conversation).await?;
store.rename_speaker(&conversation.id, 0, "Alice".into()).await?; // persists
With the state feature, CheckpointerConversationStore::new(checkpointer)
routes through crates/state's configured Checkpointer, so edits
survive a restart through the in-memory / SQLite / Postgres backend.
harness.events() returns an SttEventStream; recv().await yields
SttHarnessEvent (Started, Partial, UtteranceCommitted,
SpeakerChanged, UtteranceEnd, DiarizationWarning, Finished,
Error). The harness also emits Event::HarnessIteration to its
EventBus so runs show up in the RunTree.
atomr-agents-stt-harness-web (optional crate): WebServer::new(config, store) builds an axum router (router() is public for
tower::oneshot tests). Routes: GET /api/conversations,
GET|DELETE /api/conversations/:id,
PUT /api/conversations/:id/speakers/:speaker_id,
GET /ws. Forward harness.events() into server.event_sender() via
ws::forward_events so the UI streams live.
cargo xtask stt-web-build (or
npm --prefix crates/stt-harness-web/ui run build).cargo run -p atomr-agents-cli --features stt-web -- serve.--features embed-ui.atomr_agents.stt_harness exposes SttHarnessSpec, SttHarness,
SttConversation, SttTurn, SttEventStream:
from atomr_agents import stt
from atomr_agents.stt_harness import SttHarness, SttHarnessSpec
backend = stt.mock_speech_to_text("hello world")
audio = stt.audio_pcm([0.0] * 16_000, 16_000, 1)
spec = SttHarnessSpec("demo", diarization="layered_mock") # off|backend|layered_mock
conversation = await SttHarness(spec, backend, audio).run()
print(conversation.to_turn_input())
harness.events() before run() — the broadcast channel
only buffers from the subscription point.run() consumes the audio source; a second run() errors. Build a
fresh harness per run.File / Bytes sources without the decode feature fail at
run() with a clear config error — gate the feature.Backend diarization on a DiarizationSupport::None backend leaves
every turn unattributed (and warns). Use Layered there.finish drain after a short quiet
period — real WS backends close their transport; the in-process mock
does not, so the quiet-period fallback is what stops it.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/atomr-agents-ai-skills:atomr-agents-stt-harnessfrom atomr-agents-ai-skills
npx claudepluginhub rustakka/atomr-agents --plugin atomr-agents-ai-skills14 skills in this plugin
/atomr-agents-evalUse when writing eval suites, picking a `Scorer` (Contains / LlmJudge / Rubric / Pairwise), gating publication on `RegressionGate`, queuing items for human annotation, or wiring online eval. Triggers on `EvalSuite { ... }`, `EvalSuite::run`, `LlmJudgeScorer::new`, `PairwiseScorer::compare`, `RegressionGate::check`, or `Registry::publish_gated`./atomr-agents-hitlUse when adding human-in-the-loop pause/resume — dynamic `interrupt()` from a step, static breakpoints (`interrupt_before` / `interrupt_after`), or driving resume with `Command::{Continue, Resume, Update, Goto}`. Triggers on writing `Interruptible { ... }`, calling `ctrl.interrupt(...)`, or porting a LangGraph `interrupt()` / `Command(resume=...)` flow./atomr-agents-langgraph-migrationUse when porting LangGraph or LangChain code to atomr-agents — translating `StateGraph` / `Runnable` / `RunnableSequence` / `MemorySaver` / `interrupt` / `Command` / `ToolNode` / retriever zoo / output parsers / `create_agent` middleware. Triggers on porting an existing LangChain / LangGraph project, or asking "how do I do X from LangGraph in atomr-agents"./atomr-agents-meetings-harnessUse when turning a diarized STT transcript into structured meeting artifacts in atomr-agents — building a `MeetingsHarness`, accumulating a `MeetingAnalysis` (attendees, notes, actions-with-owners, tiered summaries), picking batch vs live mode, persisting via the configured `Checkpointer` under the same `conversation_id` as the source transcript, or serving the meetings review UI (`meetings-harness-web`). Triggers on `MeetingsHarness`, `MeetingAnalysis`, "extract action items", "meeting summary", "attendees from transcript", "live meeting analysis", `atomr_agents.meetings_harness`./atomr-agents-middlewareUse when wrapping the agent's per-turn pipeline with cross-cutting policies — logging, retry, rate-limit, redaction, tool-error recovery, dynamic prompt override, before/after hooks. Triggers on `impl AgentMiddleware for`, `MiddlewareStack::new().push(...)`, or porting a LangChain `create_agent` middleware (`@wrap_model_call` / `@wrap_tool_call` / `@dynamic_prompt`)./atomr-agents-multi-agentUse when wiring an `Org` / `Department` / `Team` topology, picking a routing strategy (`RoundRobin` / `LoadAware` / `CapabilityMatch`), or building a supervisor / swarm / network / hierarchical multi-agent pattern. Triggers on `Team { unit: OrgUnit { ... } }`, `swarm_loop(...)`, `HandoffTool::new(...)`, `Policy::narrow`, or porting a LangGraph supervisor.