Contexts
Contexts define brand voice, guidelines, and additional content that get injected into AI operations.
A context is a collection of resources that provide additional information to AI operations. Contexts enable you to maintain consistent brand voice, inject guidelines, or include relevant content (like retrieval-augmented generation (RAG) data) into every AI request.
What Contexts Store
Id
Unique identifier (GUID)
Alias
Unique string for programmatic lookup
Name
Display name shown in the backoffice
Resources
Collection of context resources
Version
Current version number (for version history)
Context Resources
Each context contains one or more resources. A resource represents a piece of content that gets injected into AI requests.
Id
Unique identifier (GUID)
ResourceTypeId
The type of resource (e.g., "text", "document")
Name
Display name for the resource
Description
Optional description
SortOrder
Controls injection order
Settings
Type-specific settings
InjectionMode
When the resource is injected
Injection Modes
Resources can be injected based on different conditions:
Always
Resource is always included (default)
OnDemand
Resource is included only when explicitly requested
Using Contexts in Code
Getting a Context
Creating a Context
How Context Injection Works
When an AI operation executes with contexts:
All associated contexts are retrieved.
Resources are sorted by
SortOrder.Resources with matching
InjectionModeare selected.Resource content is formatted and injected into the system message.
The AI model receives the enriched request.
When multiple contexts are used, they are processed in the order they are listed. Within each context, resources are processed by SortOrder, and all resource content is concatenated into the system context.
Managing Contexts
Via Backoffice
You can create, edit, and delete contexts through the backoffice. See Managing Contexts for step-by-step instructions.
Via Code
For programmatic context management, see the IAIContextService reference.
Version History
Contexts support version history. Every time you save a context, a new version is created. You can:
View the version history.
Compare different versions.
Roll back to a previous version.
See Version History for more information.
Related
Profiles - Use contexts with AI profiles
Version History - Track context changes over time
Managing Contexts - Backoffice guide
Knowledge Sets - Ship background knowledge from a package in code
Last updated
Was this helpful?