🧠 Memory Management in Lyzr Agents

Memory management in Lyzr is critical to building intelligent, context-aware agents. It allows agents to remember recent messages, retain useful information across sessions, and deliver coherent, personalized responses.

Memory Configuration Overview

 Learn how to configure memory settings for your agents in Studio.

🗂️ Types of Memory

Lyzr supports two types of memory:

1. Short-Term Memory

Short-Term Memory stores recent messages from the current session. It enables the agent to remember context over multiple conversational turns (multi-turn dialog) without needing users to repeat themselves.
  • Session-scoped: Data exists only during a single conversation.
  • Limit-bound: You can control how many recent messages are retained using the slider.
  • Behavior:
    • Once the message limit is reached, older messages are summarized and moved to long-term memory (if enabled).
    • This ensures the agent still retains gist-level understanding of prior context.

Studio Configuration

You can configure the short-term memory window in Lyzr Studio:
📌 Messages beyond this limit are summarized and stored as Long-Term Memory.

API Configuration

{
  "type": "SHORT_TERM_MEMORY",
  "config": {
    "max_messages": 16
  },
  "priority": 0
}

2. Long-Term Memory

Long-Term Memory persists important information across sessions, allowing the agent to recall what it learned from previous conversations.
  • Persistent: Stored in a secure backend store.
  • Summarized inputs: When short-term memory overflows, older data is automatically summarized and pushed to long-term memory.
  • Great for:
    • Remembering user preferences
    • Tracking ongoing projects or histories
    • Delivering personalized experiences

Studio Configuration

  • Enable Long-Term Memory in the Memory tab.
  • No manual storage limits—summarized memory grows as needed and can be queried programmatically.

API Configuration

{
  "type": "LONG_TERM_MEMORY",
  "config": {},
  "priority": 1
}

✅ Summary: How They Work Together

FeatureShort-Term MemoryLong-Term Memory
ScopeCurrent session onlyAcross sessions
Retention controlConfigurable message windowSummarized data from ST memory
PersonalizationNoYes
Reset on session endYesNo
Use caseMulti-turn dialog coherencePersistent user knowledge
💡 Lyzr agents automatically summarize and transfer older messages from short-term to long-term memory once the configured message limit is reached.

📘 Next Steps

  • Configure memory per agent in Studio > Memory Tab.
  • Use the REST API if provisioning agents programmatically.
  • Monitor memory usage and debug context from the Agent Logs tab.
For advanced use cases, consider memory with custom priorities, vector store lookups, or external storage integration.