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.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.
Maintain a conversation thread
Multi-turn memory is the one real difference from the single-shot agents. Instead of omittingcontextId, 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, callclient.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.