Limitations
- You can store up to 1.5 MB in the Context object. For dedicated SaaS and on-premises installations, you can configure the limit using the
MAX_MEMORY_OBJECT_SIZE
variable in thevalues.yaml
file. Increasing the object size could lead to performance issues.
Working with the Context Object
- GUI
- API
Interaction PanelYou can view the Context object by navigating to Info > Context in the Interaction Panel. In the Context tab, you can save, cancel, or reset the Context object by clicking the respective buttons at the bottom of the Interaction Panel. The changes to the values in the Context object apply only to the current session.You can copy the exact JSON path of a Context object value by right-clicking it and selecting Copy JSON Path.Flow EditorIn the Flow editor, you can set a Default Context in the Settings tab.
Default Context
The Default Context is the Flow’s Context object when the user triggers the Flow execution for the first time. By default, the Default Context is empty, and you can customize it in the Settings tab of the Flow editor. A session inherits the Default Context from the Flow in which this session starts. If the user switches to another Flow during the session, the Context object remains the same. However, you can apply the Default Context of the target Flow with the Go To Node. To do so, activate the Absorb Context parameter in the Go To Node settings that switches to the target Flow.Storing Information in the Context Object
Nodes, such as the Add To Context, AI Agent, Question, and others, include different parameters to store information in the Context object.Accessing the Context object
Use Nodes to dynamically access Context properties with CognigyScript, for example,{{context.property}}
, or Tokens. The CognigyScript expression used to access the Context object follows the dot notation property.child.child
.
Example
Consider the following Context object:Context Object Example
Context Object Example
{{context.order.items[0].price}}
returns the price of the first item in the order.{{context.order.items[1].name}}
returns the name of the second item in the order.{{context.order.items[2].quantity}}
returns the quantity of the third item in the order.