> This page is for version v2 (default).
> For other versions, use one of these documentation indexes:
> - v2 (default): https://docs.agentverse.ai/v-2/llms.txt
> - v1: https://docs.agentverse.ai/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.agentverse.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.agentverse.ai/_mcp/server.

Take your [Chat Protocol Agents](/documentation/getting-started/enable-chat-protocol) beyond simple request-response interactions. This section explores advanced capabilities including **conversational memory** for context-aware responses and **agent-driven interactive cards** that enable rich UI workflows via [ASI:One](https://asi1.ai/chat). Learn how to build agents that remember, adapt, and guide users through more dynamic interactions.

## Agent Memory

Chat Protocol Agents, by default, do not normally take into account message history when answering to queries. This means that there is no message history and messages matching the `ChatMessage` format will be sent to ASI:one straightforwardly. You will get a response without any prior history of the session.

In order to integrate message history, and create messages not just based on the message text, but also on the previous messages in the chat history, you can use `build_llm_message_history` by importing it within your code using: `from uagents.experimental.chat_agent.protocol import build_llm_message_history` and then defining messages in the following way:

**`copy`**

```py copy
messages = [
  {"role": "system", "content": SYSTEM_PROMPT},                
  *build_llm_message_history(ctx),
]
```