> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # addPatternHint > Add a speech recognition hint with pattern matching and replacement. [ref-agentbase]: /docs/server-sdks/reference/typescript/agents/agent-base Add a hint with pattern matching and replacement. This allows you to intercept specific ASR output and rewrite it before it reaches the AI -- useful for correcting consistent misrecognitions or normalizing variations. ## **Parameters** **`opts`** `object` — required Pattern hint configuration object with the following fields: --- **`opts.hint`** `string` — required Descriptive label for the hint (surfaced to the ASR alongside the pattern). --- **`opts.pattern`** `string` — required Regular expression pattern to match. --- **`opts.replace`** `string` — required Replacement text to substitute when the pattern matches. --- **`opts.ignoreCase`** `boolean` Whether to ignore case when matching the pattern. --- ## **Returns** [`AgentBase`][ref-agentbase] -- Returns `this` for method chaining. ## **Example** ```typescript {6} import { AgentBase } from '@signalwire/sdk'; const agent = new AgentBase({ name: 'support', route: '/support' }); agent.setPromptText('You are a helpful assistant.'); // Correct common ASR misrecognition agent.addPatternHint({ hint: 'SignalWire brand name', pattern: 'signal\\s*wire|signal\\s*wired', replace: 'SignalWire', ignoreCase: true, }); await agent.serve(); ``` > Add a speech recognition hint with pattern matching and replacement.