For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Start buildingGet support
DocumentationAPI ReferenceChangelogDiscord
  • Introduction
    • Welcome to Hume AI
    • Getting your API keys
    • Support
    • Pricing
  • Voice
    • Overview
    • Voice design
    • Voice cloning
    • Voice management
  • Text-to-Speech (TTS)
    • Overview
    • Voice
    • Acting instructions
    • Voice conversion
    • Continuation
    • Timestamps
    • FAQ
  • Speech-to-Speech (EVI)
    • Overview
      • Interruptibility
      • Pause responses
      • Dynamic variables
      • Context injection
      • Tool use
      • Resume chats
      • Chat history
      • Audio reconstruction
    • FAQ
  • Expression Measurement
    • Overview
    • About the science
    • FAQ
  • Integrations
    • MCP
    • Vercel AI SDK
    • LiveKit
    • Pipecat
    • Vapi
    • Twilio
    • Agora
  • Resources
    • Terms of use
    • Use case guidelines
    • Billing
    • Errors
    • Privacy
    • Status
Start buildingGet support
LogoLogo
LogoLogo
On this page
  • Injecting context
  • Example: Supporting travel planning context
  • Clearing injected context
Speech-to-Speech (EVI)Features

Context Injection

Guide to injecting context during an EVI Chat session.
Was this page helpful?
Edit this page
Previous

Tool Use

Guide to utilize function calling with EVI.
Next
Built with

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 message. The 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, 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
Persistent

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

Session settings
1{
2 "type": "session_settings",
3 "context": {
4 "text": "The user adjusted their time range from Jan 10 - Jan 20 to Jan 14 - Jan 24.",
5 "type": "temporary"
6 }
7}

Clearing injected context

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

Session settings
1{
2 "type": "session_settings",
3 "context": null
4}

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.