> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# add_pattern_hint

> Add a speech recognition hint with pattern matching and replacement.

[ref-agentbase]: /docs/server-sdks/reference/python/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**

The hint string to match against ASR output.

Regular expression pattern to match.

Replacement text to substitute when the pattern matches.

Whether to ignore case when matching the pattern.

## **Returns**

[`AgentBase`][ref-agentbase] -- Returns self for method chaining.

## **Example**

```python {6}
from signalwire import AgentBase

agent = AgentBase(name="support", route="/support")
agent.set_prompt_text("You are a helpful assistant.")
# Correct common ASR misrecognition
agent.add_pattern_hint(
    hint="SignalWire",
    pattern=r"signal\s*wire|signal\s*wired",
    replace="SignalWire",
    ignore_case=True
)
agent.serve()
```