ai_context, Omni uses patch-based merging to preserve parent context while allowing layer-specific modifications. This prevents child layers from overwriting parent context when making edits.
Refer to the Optimizing models for AI guide for more information on best practices.
Syntax
Value is on one line
Value can contain linebreaks
Properties
string
Free text that provides context to the Omni Agent. Can include behavioral prompting, instructions for tone, or other guidance to .The following references are supported for this field:
-
User attributes, referenced with
{{omni_attributes.<attribute_name>}}. This allows you to personalize the context for each user. -
Model
constants, referenced using@{constant_name}syntax. This allows you to maintain reusable instruction blocks such as tone, privacy guidance, and domain context instead of duplicating them. -
omni_llmnamespace, which allows you to tailor context to specific AI model tiers:{{ omni_llm.model }}— Substitutes the active model’s family name, which will be one of:smartest,standard, orfastest{{# omni_llm.<family> }}...{{/ omni_llm.<family> }}— Conditional sections for specific model tiers.<family>must be one ofsmartest,standard, orfastest{{^ omni_llm.<family> }}...{{/ omni_llm.<family> }}— Inverse sections, which apply when the specified tier is not used.<family>must be one ofsmartest,standard, orfastest
-
omni_agentnamespace, which allows you to scope context to specific AI agents:{{ omni_agent.name }}— Substitutes the active agent’s name, which will be one of:analyze,build, orsimple_summarize{{# omni_agent.<agent> }}...{{/ omni_agent.<agent> }}— Conditional sections for specific agents.<agent>must be one ofanalyze,build, orsimple_summarize{{^ omni_agent.<agent> }}...{{/ omni_agent.<agent> }}— Inverse sections, which apply when the specified agent is not used.<agent>must be one ofanalyze,build, orsimple_summarize
object
Server-managed field that stores how a branch or workbook layer modifies its parent’s
ai_context. Omni automatically generates patches when you edit ai_context in a non-base layer.You can delete a patch by omitting the ai_context_patch: field from your YAML in Model mode, but you cannot manually create or edit patch contents. Omni automatically chooses the appropriate patch type.The literal ai_context is always persisted alongside the patch as the source of truth and fallback.Layer behavior
The patch-based merging described in this section only applies to model-level
ai_context.ai_context in a branch or workbook layer in:
1
Combined mode
Omni compares your edited context to the resolved parent context and automatically generates an
ai_context_patch. Both the literal ai_context and the patch are stored.2
Model mode
You see only the patch content (your layer’s contribution) when a patch exists. The literal
ai_context is hidden but still persisted in the background.- If a layer has an
ai_context_patch, Omni attempts to apply it against the resolved parent context - If the patch applies successfully, the result becomes the resolved context for that layer
- If a diff patch cannot apply cleanly, such as due to parent changes, Omni falls back to the layer’s literal
ai_context - Append patches always apply successfully, making them ideal for layers that only add context
Examples
Behavioral prompting
Behavioral prompting
Personalized context using user attributes
Personalized context using user attributes
Model-specific instructions
The following context will apply when the model tier issmartest.
Applies when the model tier is smartest
smartest.
Agent-specific instructions
The following context provides detailed modeling conventions to thebuild_configuration agent while keeping the context concise for other agents.
Agent-specific modeling conventions
Using constant references
You can referenceconstants to maintain reusable AI instruction blocks instead of duplicating them:
Model file with constants
Branch layer appending to parent context
Branch layer appending to parent context
Workbook layer modifying parent context
Workbook layer modifying parent context

