Skip to main content
Beta. This is an experimental pattern under active development. It chains several capabilities — wake-word command recognition, wildcard intent capture, and threaded agent memory — so behavior and response quality can vary, and the approach may change. Treat it as a starting point for exploration rather than a production-ready recipe, and reach out to discuss your use case or share feedback.
Follow along with the runnable example. This guide walks through the wake-command agent example in corti-examples — bootstrap your build from it or use it as reference.
Where the on-demand and second-pass agents run a single isolated pass, a wake-command agent holds a multi-turn dialogue. The user speaks a wake phrase to talk to it hands-free, and each turn is grounded in the ones before it through threaded memory.
This combines three earlier building blocks: a Commands wake trigger, a Keyterm to bias the wake word, and the agent lifecycle from On-Demand Agent.The prompts used here are mere examples - be sure to test and refine the prompt to support your specific needs.

Gate input with a wake command

Configure a dictation command whose phrases start with the wake word and capture the rest of the utterance in a wildcard {intent} variable. Add the wake word as a keyterm so it’s recognized reliably. See the wake-command agent example in corti-examples for the full dictationConfig and command event handler. When the command fires, extract the spoken intent from the wildcard variable, falling back to stripping the wake prefix from the raw transcript text if the variable is empty.
Offer an auto-send toggle: when on, a recognized intent is sent immediately; when off, it’s staged in the text composer so the user can review or edit before sending. Either way, typed and spoken turns go through the same send path.

Maintain a conversation thread

Multi-turn memory is the one real difference from the single-shot agents. Instead of omitting contextId, thread it: pass the current contextId with each messageSend call and update it from the response. That is what lets follow-up questions stay grounded in earlier turns. Start a new thread by sending without a contextId; the response returns one to use on the next turn.
See Context & Memory for how threads work in the Agentic Framework. If a stored contextId is no longer valid on the server (a 404), start a fresh thread by resending without it rather than failing the turn.

Reset the conversation

To start over, call client.agents.deleteContext(agentId, contextId) to remove the thread on the server, then clear your local contextId and message list.

Next steps

On-Demand Agent

The agent lifecycle and message API, for a single isolated pass.

Conversational Agent

Always-on voice agent — no wake phrase, every utterance forwarded with speculative prefetch.

Context & Memory

How conversation threads and memory work in the Agentic Framework.

Example code

The complete, runnable wake-command agent example in corti-examples.
Please contact us for help or questions.