Additional Request Context¶
In the Dataiku LLM Mesh, completion requests can pass extra information alongside the main query via the context key.
This feature allows developers to pass additional data—such as user identifiers, security tokens, or application states—through the chain of Agents and Tools.
Important
Do not confuse this Additional request context with the LLM context window.
LLM context window: The actual text (prompt + history) visible to the model, limited by token count.
Additional request context: Arbitrary JSON metadata passed to the code executing the tools or retrieval systems. This data is invisible to the LLM itself unless a specific Tool is programmed to read it.
Standard Keys¶
The context is an arbitrary JSON object. However, Dataiku reserves specific keys to standardize security and state management across the LLM Mesh.
- conversationId
This field is an opaque string used to identify a conversation session. While generally handled automatically (e.g., by Visual Agents), Code Agents should explicitly retrieve and use this key to enable session continuity if needed.
- callerSecurityTokens
This field is dedicated to the mechanics of Document-Level Security, which applies particularly in cases of Retrieval Augmented Generation. It can be used with both a Knowledge Bank Search tool or a Retrieval-Augmented LLM.
{ "callerSecurityTokens": ["group_marketing", "dss_group:admin", "dss_user:jdoe"] }
- callerFilters
Used to programmatically force filters on tools and specifically the Knowledge Bank Search tool. This prevents end users from overriding constraints via the prompt.
{ "callerFilters": [ { "filter": { "operator": "AND", "clauses": [ { "column": "Category", "operator": "EQUALS", "value": "Economy"}, { "column": "Year", "operator": "GREATER_THAN", "value": 2012}, { "column": "Month", "operator": "IN_ANY_OF", "value": ["January", "February", "March"]} ] }, "toolRef": "optional tool ref" } ] }
Usage¶
When using an Agent or a Retrieval-Augmented LLM, the context is passed to the underlying tools or retrieval systems to enforce logic that the user cannot manipulate via the prompt.
Example
In the example API request below, the context serves two purposes simultaneously: it enforces document security (via the standard security tokens key) and provides custom metadata that a tool might use to format the response.
{
"query": "What is the status of my ticket?",
"context": {
"callerSecurityTokens": ["dss_user:admin", "group:support_team"],
"application_source": "mobile_app",
"user_id": "u-59201"
}
}
How this metadata reaches the underlying tools depends on the type of Agent you are building:
Visual Agents: The agent automatically passes the entire context it receives to all tools it calls.
Code Agents: Can make use of context variables in their code. It is the responsibility of the code agent implementation to pass the context to any called tools.