> This page is for Voice APIs.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://dev.hume.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://dev.hume.ai/_mcp/server.

# Context Injection

Context injection supplies the model with additional information so it can tailor its responses without the user
needing to explicitly instruct EVI.

EVI supports context injection via a [Session Settings](/docs/speech-to-speech-evi/configuration/session-settings)
message. The [context](/reference/speech-to-speech-evi/chat#send.SessionSettings.context) field in a Session
Settings message allows you to silently add information to the conversation, guiding EVI without triggering a response.

This context is appended to the end of each [user_message](/reference/speech-to-speech-evi/chat#receive.UserMessage),
ensuring that it is consistently referenced throughout the session.

Injected context can be used to remind EVI of its role, keep important details active in the conversation, or add
relevant updates as needed. This method is ideal for adapting EVI’s tone or focus based on real-time changes, helping
it respond more accurately without requiring repetitive input from the user.

### Injecting context

To inject context, send a **Session Settings** message with a `context` object that includes two fields:

* **text**: The content you want to inject, providing specific guidance for EVI. For example, if the user expresses
  frustration, you might set the context to
  encourage an empathetic response.
* **type**: Defines how long the context remains active. Options include:
  * **temporary**: Context that is only applied in the preceding assistant response.
  * **persistent**: Context that is applied to all subsequent messages in the Chat.

#### Example: Supporting travel planning context

To tailor EVI’s responses for a travel planning scenario, you can inject context at different persistence levels based
on user actions and session needs:

#### Temporary

This context helps EVI respond appropriately to the most recent user action but does not persist beyond the next
interaction.

#### Session settings

```json {4,5}
{
  "type": "session_settings",
  "context": {
    "text": "The user adjusted their time range from Jan 10 - Jan 20 to Jan 14 - Jan 24.",
    "type": "temporary"
  }
}
```

#### Persistent

This context provides EVI with a consistent focus on vacation planning, helping it to make relevant suggestions or ask guiding questions throughout the session.

#### Session settings

```json {4,5}
{
  "type": "session_settings",
  "context": {
    "text": "The user is trying to find a destination for their next vacation.",
    "type": "persistent"
  }
}
```

### Clearing injected context

Context you have injected can be cleared by sending a Session Settings message with a context field of `null`:

#### Session settings

```json {3}
{
  "type": "session_settings",
  "context": null
}
```

> **Warning**
>
> **Injected context is only active within the current session.** If a chat is resumed, any previously injected context
> will not be carried over and must be re-injected if necessary.

---