GenerationContext
Snapshot of retrieval inputs, prompt provenance, and turn position that shaped a generated message.
Usage profiles
| Usage | Fields and validation |
|---|---|
| In requests | View fields |
| In responses | View fields |
| In webhook payloads | View fields |
In requests
API JSON uses JSON field names (camelCase).
| Field | Type | Presence | Meaning |
|---|---|---|---|
memories | Array of MemoryReference | Optional | Memory records captured in the generation context. |
relations | Array of RelationReference | Optional | Graph relationships captured in the generation context. |
memorySearch | MemorySearchParams | Optional | Memory-query parameters and counts recorded for this generation. |
turn | TurnInfo | Optional | Turn position and limit within the generation run. |
languagePreference | string | Optional | Language preference associated with the generation context. |
resolvedSystemPrompt | string | Optional | System prompt selected for this generation after prompt precedence is resolved. This field is retained in the schema but is not populated; use resolved_prompt_hash for recorded prompt identity. |
profileId | string | Optional | Agent profile that produced this message ("" if none active). |
model | string | Optional | Model actually used for this generation. |
promptSource | string (PROMPT_SOURCE_CLIENT_OVERRIDE, PROMPT_SOURCE_PROFILE_TEMPLATE, PROMPT_SOURCE_DEFAULT_CONFIG) or integer (int32) | Optional | Which precedence tier supplied the prompt. |
baseConfig | GenerationConfig | Optional | Generation configuration resolved before per-call overrides and timeout adjustments, with system_prompt omitted. The active profile supplies the base when selected; otherwise the conversation default does. May be absent on older turns or when neither supplies a configuration. |
overrideConfig | GenerationConfig | Optional | Per-call generation configuration supplied before the override merge. |
profileVersion | integer (int32) | Optional | Immutable version of the active agent profile used to render this turn’s prompt. Absent on older turns and turns without a profile template. Minimum: -2147483648. Maximum: 2147483647. |
fragmentsVersion | integer (int32) | Optional | Version of the prompt-fragment set used to render the profile prompt. Minimum: -2147483648. Maximum: 2147483647. |
promptVariables | Map from string to JSON value | Optional | Values bound to the prompt template for this generation. |
profileRenderFailed | boolean | Optional | Whether rendering the profile prompt failed for this generation. |
resolvedPromptHash | string | Optional | SHA-256 hash, as 64 hexadecimal characters, of the resolved system prompt before the current-time instruction is appended. Identifies prompt content only, excluding model and sampling parameters. Absent on older turns without prompt capture. |
resolvedUserContext | string | Optional | The [User Context] block as rendered into this turn's prompt: the user's name, locale, and location conditions (weather/AQI/UV/sun times). This is the literal text the model received, not a reconstruction. Empty when the user has no stored location, when enrichment degraded, or on turns predating capture. |
resolvedMcpServers | Array of MCPServerReference | Optional | The MCP server list that governed this turn — the tier actually resolved (conversation settings -> active profile -> per-turn override_mcp_servers), which is simultaneously the tool-discovery source and the CallTool allow/block basis. Empty on turns predating capture and on threads with no MCP servers. |
Values of promptSource
Source that supplied the effective prompt for a generation turn.
| Value | No. | Form | Meaning |
|---|---|---|---|
PROMPT_SOURCE_CLIENT_OVERRIDE | 1 | Canonical | The caller supplied the prompt through the send request's generation-configuration override. |
PROMPT_SOURCE_PROFILE_TEMPLATE | 2 | Canonical | The prompt was rendered from the active agent profile template. |
PROMPT_SOURCE_DEFAULT_CONFIG | 3 | Canonical | The prompt came from the conversation or project default generation configuration. |
In responses
API JSON uses JSON field names (camelCase).
| Field | Type | Presence | Meaning |
|---|---|---|---|
memories | Array of MemoryReference | Optional | Memory records captured in the generation context. |
relations | Array of RelationReference | Optional | Graph relationships captured in the generation context. |
memorySearch | MemorySearchParams | Optional | Memory-query parameters and counts recorded for this generation. |
turn | TurnInfo | Optional | Turn position and limit within the generation run. |
languagePreference | string | Optional | Language preference associated with the generation context. |
resolvedSystemPrompt | string | Optional | System prompt selected for this generation after prompt precedence is resolved. This field is retained in the schema but is not populated; use resolved_prompt_hash for recorded prompt identity. |
profileId | string | Optional | Agent profile that produced this message ("" if none active). |
model | string | Optional | Model actually used for this generation. |
promptSource | string (PROMPT_SOURCE_CLIENT_OVERRIDE, PROMPT_SOURCE_PROFILE_TEMPLATE, PROMPT_SOURCE_DEFAULT_CONFIG) or integer (int32) | Optional | Which precedence tier supplied the prompt. |
baseConfig | GenerationConfig | Optional | Generation configuration resolved before per-call overrides and timeout adjustments, with system_prompt omitted. The active profile supplies the base when selected; otherwise the conversation default does. May be absent on older turns or when neither supplies a configuration. |
overrideConfig | GenerationConfig | Optional | Per-call generation configuration supplied before the override merge. |
profileVersion | integer (int32) | Optional | Immutable version of the active agent profile used to render this turn’s prompt. Absent on older turns and turns without a profile template. Minimum: -2147483648. Maximum: 2147483647. |
fragmentsVersion | integer (int32) | Optional | Version of the prompt-fragment set used to render the profile prompt. Minimum: -2147483648. Maximum: 2147483647. |
promptVariables | Map from string to JSON value | Optional | Values bound to the prompt template for this generation. |
profileRenderFailed | boolean | Optional | Whether rendering the profile prompt failed for this generation. |
resolvedPromptHash | string | Optional | SHA-256 hash, as 64 hexadecimal characters, of the resolved system prompt before the current-time instruction is appended. Identifies prompt content only, excluding model and sampling parameters. Absent on older turns without prompt capture. |
resolvedUserContext | string | Optional | The [User Context] block as rendered into this turn's prompt: the user's name, locale, and location conditions (weather/AQI/UV/sun times). This is the literal text the model received, not a reconstruction. Empty when the user has no stored location, when enrichment degraded, or on turns predating capture. |
resolvedMcpServers | Array of MCPServerReference | Optional | The MCP server list that governed this turn — the tier actually resolved (conversation settings -> active profile -> per-turn override_mcp_servers), which is simultaneously the tool-discovery source and the CallTool allow/block basis. Empty on turns predating capture and on threads with no MCP servers. |
Values of promptSource
Source that supplied the effective prompt for a generation turn.
| Value | No. | Form | Meaning |
|---|---|---|---|
PROMPT_SOURCE_CLIENT_OVERRIDE | 1 | Canonical | The caller supplied the prompt through the send request's generation-configuration override. |
PROMPT_SOURCE_PROFILE_TEMPLATE | 2 | Canonical | The prompt was rendered from the active agent profile template. |
PROMPT_SOURCE_DEFAULT_CONFIG | 3 | Canonical | The prompt came from the conversation or project default generation configuration. |
In webhook payloads
Webhook JSON uses protobuf field names (snake_case).
| Field | Type | Presence | Meaning |
|---|---|---|---|
memories | Array of MemoryReference | Optional | Memory records captured in the generation context. |
relations | Array of RelationReference | Optional | Graph relationships captured in the generation context. |
memory_search | MemorySearchParams | Optional | Memory-query parameters and counts recorded for this generation. |
turn | TurnInfo | Optional | Turn position and limit within the generation run. |
language_preference | string | Optional | Language preference associated with the generation context. |
resolved_system_prompt | string | Optional | System prompt selected for this generation after prompt precedence is resolved. This field is retained in the schema but is not populated; use resolved_prompt_hash for recorded prompt identity. |
profile_id | string | Optional | Agent profile that produced this message ("" if none active). |
model | string | Optional | Model actually used for this generation. |
prompt_source | string (PROMPT_SOURCE_CLIENT_OVERRIDE, PROMPT_SOURCE_PROFILE_TEMPLATE, PROMPT_SOURCE_DEFAULT_CONFIG) or integer (int32) | Optional | Which precedence tier supplied the prompt. |
base_config | GenerationConfig | Optional | Generation configuration resolved before per-call overrides and timeout adjustments, with system_prompt omitted. The active profile supplies the base when selected; otherwise the conversation default does. May be absent on older turns or when neither supplies a configuration. |
override_config | GenerationConfig | Optional | Per-call generation configuration supplied before the override merge. |
profile_version | integer (int32) | Optional | Immutable version of the active agent profile used to render this turn’s prompt. Absent on older turns and turns without a profile template. Minimum: -2147483648. Maximum: 2147483647. |
fragments_version | integer (int32) | Optional | Version of the prompt-fragment set used to render the profile prompt. Minimum: -2147483648. Maximum: 2147483647. |
prompt_variables | Map from string to JSON value | Optional | Values bound to the prompt template for this generation. |
profile_render_failed | boolean | Optional | Whether rendering the profile prompt failed for this generation. |
resolved_prompt_hash | string | Optional | SHA-256 hash, as 64 hexadecimal characters, of the resolved system prompt before the current-time instruction is appended. Identifies prompt content only, excluding model and sampling parameters. Absent on older turns without prompt capture. |
resolved_user_context | string | Optional | The [User Context] block as rendered into this turn's prompt: the user's name, locale, and location conditions (weather/AQI/UV/sun times). This is the literal text the model received, not a reconstruction. Empty when the user has no stored location, when enrichment degraded, or on turns predating capture. |
resolved_mcp_servers | Array of MCPServerReference | Optional | The MCP server list that governed this turn — the tier actually resolved (conversation settings -> active profile -> per-turn override_mcp_servers), which is simultaneously the tool-discovery source and the CallTool allow/block basis. Empty on turns predating capture and on threads with no MCP servers. |
Values of prompt_source
Source that supplied the effective prompt for a generation turn.
| Value | No. | Form | Meaning |
|---|---|---|---|
PROMPT_SOURCE_CLIENT_OVERRIDE | 1 | Canonical | The caller supplied the prompt through the send request's generation-configuration override. |
PROMPT_SOURCE_PROFILE_TEMPLATE | 2 | Canonical | The prompt was rendered from the active agent profile template. |
PROMPT_SOURCE_DEFAULT_CONFIG | 3 | Canonical | The prompt came from the conversation or project default generation configuration. |
Where used
| Reference | Relationship |
|---|---|
| Append a message without generating | POST /api/v1/llm/append-message |
| Send a message to a conversation | POST /api/v1/llm/send-message |
| Send a message and wait for the result | POST /api/v1/llm/send-message-sync |
| Withdraw your rating on a message | POST /api/v1/llm/delete-message-rating |
| Get full conversation state | POST /api/v1/llm/conversation-state |
| Rate an assistant message | POST /api/v1/llm/rate-message |
| Submit client-side tool results and wait for the next segment | POST /api/v1/llm/submit-client-tool-results-sync |
| llm.message_published | Webhook JSON uses protobuf field names (snake_case). |
| Message | Nested in model |
| Message | Nested in model |
| Message | Nested in model |
Download the public reference contract.
Document: DOC-API-MODEL-generation-context.