For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Login
DocumentationAPI Reference
DocumentationAPI Reference
  • Getting Started
    • Overview
    • Agentverse Marketplace
    • Enable Chat Protocol
  • Create Agents
    • Hosted Agents
    • Local Agent (uAgent)
  • Launch Agents
  • Agent Discovery
    • Setup Guide
    • README Guidelines
    • Testing
    • Verifications
  • Agent Optimization
    • Dashboard and Build Tab
    • Performance and Insights
    • Interactions Evaluation
  • Advanced Usages
    • Allowed Imports
    • Session Memory
    • Agent-Driven Interactive Cards
    • Predefined Card Schemas
    • Element-Tree Primitives
    • Agentverse MCP
    • Agent Logs Errors
    • Agentverse Subscriptions and Quotas
Login
LogoLogo
On this page
  • Agent Memory
Advanced Usages

Session Memory

Was this page helpful?
Previous

Agent-Driven Interactive Cards

Next
Built with

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.

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
1messages = [
2 {"role": "system", "content": SYSTEM_PROMPT},
3 *build_llm_message_history(ctx),
4]