Skip to main content

🧠 Lyzr Studio Cookbook: Memory Management (Context Coherence)

Memory management is essential for building intelligent agents that can maintain context over multiple conversational turns (multi-turn dialog). This section details how to configure Short-Term Memory for your “Compliance Advisor Bot.”

1. Configuring Short-Term Memory

Short-Term Memory stores recent messages from the current session, ensuring the agent remembers context without users having to repeat themselves.

Step 1.1: Enable Memory and Select Provider

  1. Locate: In the Create Agent view, find the Memory toggle under Core Features. Toggle it ON.
  2. Configure: Click the settings icon next to the Memory feature to open the “Configure Memory” modal.
  3. Memory Provider: Select the desired provider from the dropdown. You have options such as:
    • Lyzr Memory (Default): Lyzr’s built-in memory storage, suitable for most use cases.
    • AWS AgentCore (BYOA): Allows you to Bring Your Own Account (BYOA) AWS credentials for storage.

Step 1.2: Set Conversation Length (Short-Term Memory Limit)

This setting determines how many recent messages the agent will remember for immediate context.
  1. Max. messages stored as Short-term Memory: Adjust the slider to set the maximum number of messages the agent retains in the current conversation session.
    • Recommendation for Compliance Agent: A value around 25 ensures robust context retention for multi-turn inquiries about policy details. The range is typically 2 to 50 messages.
  2. Save Configuration: Click Save to apply the settings.

Step 1.3: External Memory Configuration (AWS)

If you select an external provider, you must configure the credentials and resource.
  1. Provider Selected: If you choose AWS AgentCore BYOA.
  2. Credentials: You must provide the necessary AWS Credentials by clicking “Configure Memory Credentials.”
  3. Resource: Select an existing or Create New Memory Resource to specify where the memory data will be stored.
  4. Max Messages: Set the message limit as usual.

Summary: Short-Term Memory Behavior

  • Coherence: The agent uses the recent messages (up to the set limit) to maintain a fluid, contextual dialogue.
  • Storage: The data is session-scoped (only exists during the current conversation).
  • Limit: Setting the limit (e.g., from 2 - 50) ensures performance optimization while providing sufficient context.