> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognigy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Context

The *Context Object* is a JSON object that persists throughout the entire chat or call session. If a user disconnects from Cognigy.AI, the Context object can be retrieved upon reconnection with the same session ID. By default, the Context object is empty. You need to set a [Default Context](#default-context) or [configure](#storing-information-in-the-context-object) what data is stored in this object.

[Nodes](/ai/agents/develop/nodes/overview) can access the Context object and store information in it, for example, user messages, [Slots](/ai/platform-features/nlu/slots/overview), [Intents](/ai/platform-features/nlu/intents/overview), or any other data available throughout the session.

## Limitations

* You can store up to 1.5 MB in the Context object. For on-premises installations, you can configure the limit using the `MAX_MEMORY_OBJECT_SIZE` variable in the `values.yaml` file. Increasing the object size could lead to performance issues.

## Working with the Context Object

<Tabs>
  <Tab title="GUI">
    **Interaction Panel**

    You can view the Context object by navigating to **Info > Context** in the [Interaction Panel](/ai/agents/test/interaction-panel/overview). 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 Editor**

    In the Flow editor, you can set a [Default Context](#default-context) in the **Settings** tab.
  </Tab>

  <Tab title="API">
    You can inject data into and reset the Context object of a session with the [Cognigy.AI API](https://api-trial.cognigy.ai/openapi#tag--Session-v2.0).
  </Tab>
</Tabs>

### 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](/ai/agents/develop/node-reference/logic/go-to). 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/agents/develop/node-reference/logic/add-to-context), [AI Agent](/ai/agents/develop/node-reference/ai/ai-agent), [Question](/ai/agents/develop/node-reference/other-nodes/search-extract-output), 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](/ai/platform-features/cognigyscript), for example, `{{context.property}}`, or [Tokens](/ai/platform-features/tokens). The CognigyScript expression used to access the Context object follows the dot notation `property.child.child`.

#### Example

Consider the following Context object:

<Accordion title="Context Object Example">
  ```json theme={null}
  {
      "order": {
          "id": "ORD-2023-1234",
          "items": [
              {
                  "name": "Margherita Pizza",
                  "category": "food",
                  "size": "large",
                  "quantity": 1,
                  "price": 15.99
              },
              {
                  "name": "Caesar Salad",
                  "category": "food", 
                  "size": "regular",
                  "quantity": 1,
                  "price": 8.99
              },
              {
                  "name": "Coca Cola",
                  "category": "drink",
                  "size": "medium",
                  "quantity": 2,
                  "price": 2.99
              }
          ],
          "subtotal": 30.96,
          "tax": 2.48,
          "deliveryFee": 5.00,
          "total": 38.44,
          "deliveryAddress": "123 Main St, Apt 4B",
          "orderTime": "2023-10-25T19:30:00Z",
          "status": "preparing"
      }
  }
  ```

  * `{{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.
</Accordion>

## More Information

* [Profile](/ai/agents/develop/ai-agent-memory/profile)
