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

# AI Agent Memory

In Cognigy, the *AI Agent Memory* refers to the data from the user, user input, or conversation the AI Agent can retrieve. The AI Agent memory is stored in Cognigy objects which you can access using [CognigyScript](https://docs-classic.cognigy.com/ai/platform-features/cognigyscript) and [Tokens](https://docs-classic.cognigy.com/ai/platform-features/tokens.md). You can retrieve the stored information to generate context-aware AI Agent answers and control your Flows better, for example, with [Intent Conditions](https://docs-classic.cognigy.com/ai/platform-features/nlu/intents/conditions.md).

Cognigy objects are JSON objects that store different types of information:

* [Input object](https://docs-classic.cognigy.com/ai/agents/develop/ai-agent-memory/input.md) — the user input information, such as the [Intents](https://docs-classic.cognigy.com/ai/platform-features/nlu/intents/overview) in the user's message, the [Channel](https://docs-classic.cognigy.com/ai/agents/develop/nodes/channels.md) through which the user interacts with the AI Agent, and other relevant metadata.
* [Context object](https://docs-classic.cognigy.com/ai/agents/develop/ai-agent-memory/context.md) — session-specific information, such as selected products or the user's current location.
* [Profile object](https://docs-classic.cognigy.com/ai/agents/develop/ai-agent-memory/profile.md) — [Contact Profile](https://docs-classic.cognigy.com/ai/agents/analyze/contact-profiles.md) data, such as user names and email addresses.

## How to Access the AI Agent's Memory

The following table shows how to access values from the Input, Context, and Profile objects with CognigyScript:

| | Input | Context | Profile |
| - | - | - | - |
| Variable | `input` | `context` | `profile` |
| Shortcut | `ci` | `cc` | `cp` |
| Example | `{{input.text}}` | `{{context.selectedHotel}}` | `{{profile.firstname}}` |
| Shortcut Example | `{{ci.text}}` | `{{cc.selectedHotel}}` | `{{cp.firstname}}` |

### Lifespan of Cognigy Objects

The lifespan of Cognigy objects varies depending on their type:

* **Input** — each new user input and Flow execution generates a new Input object.
* **Context** — kept throughout the entire chat or call session.
* **Profile** — stored persistently to preserve information, such as user name, throughout conversations.

The following image shows a comparison of the lifespans of Cognigy objects:

![Comparison of Input, Context, and Profile object lifespans](https://mintcdn.com/cognigy-docs-legacy/RomCLoWcsmr9N2pz/_assets/ai/develop/life-span.png?fit=max\&auto=format\&n=RomCLoWcsmr9N2pz\&q=85\&s=1eb7b9e17f1b93376bcaf7de2cc2b82c)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.