Take your Chat Protocol Agents 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. Learn how to build agents that remember, adapt, and guide users through more dynamic interactions.
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: