Skip to content

🧠 Memory Demo Agent

The Memory Demo Agent showcases multi-layered memory system capabilities in SuperOptiX. This demo focuses specifically on how to configure and use memory systems for context retention and knowledge persistence.

🎯 What This Demo Shows

This demo demonstrates:

  • 🧠 Memory Integration: How to configure memory systems in SuperOptiX agents
  • πŸ—οΈ Multi-Layered Memory: Short-term, long-term, and episodic memory
  • πŸ’­ Context Retention: How agents remember and use past information
  • βš™οΈ Playbook Configuration: How to set up memory in agent playbooks

πŸš€ Setup Memory Demo

1. Install Ollama Model

Bash
# Install the Ollama model used in this demo
super model install llama3.2:8b

2. Start Ollama Server

Bash
# Start Ollama server (runs on port 11434 by default)
ollama serve

3. Pull and Run the Demo

Bash
# Pull the Memory demo agent
super agent pull memory_demo

# Compile the agent
super agent compile memory_demo

# Run the agent
super agent run memory_demo --goal "What memory systems are available and how do they work?"

πŸ”§ Memory Configuration in Playbook

The Memory demo showcases how to configure memory systems in the agent playbook:

Language Model Configuration

YAML
language_model:
  location: local
  provider: ollama
  model: llama3.2:8b
  api_base: http://localhost:11434
  temperature: 0.7
  max_tokens: 2048

Memory Configuration

YAML
memory:
  enabled: true
  short_term:
    enabled: true
    max_tokens: 1000
    storage_type: in_memory
  long_term:
    enabled: true
    storage_type: local
    max_entries: 100
    persistence_path: ./data/memory/long_term
  episodic:
    enabled: true
    max_episodes: 50
    storage_type: local
    persistence_path: ./data/memory/episodic

Key Memory Configuration Points:

  • βœ… enabled: true: Enables memory functionality
  • ⚑ short_term: Immediate context retention (1000 tokens)
  • πŸ’Ύ long_term: Persistent knowledge storage (100 entries)
  • πŸ“š episodic: Conversation episode memory (50 episodes)
  • πŸ—„οΈ storage_type: Local file storage for persistence
  • πŸ“ persistence_path: Local storage directories

🧠 Memory: Your AI's Brain

Memory systems give your AI agent the ability to learn, remember, and build relationships over time. It's like giving your AI a brain that grows smarter with each interaction:

πŸ—οΈ Three-Layer Memory Architecture

  • ⚑ Short-term Memory: Holds the current conversation context (like your working memory)
  • πŸ’Ύ Long-term Memory: Stores important facts and knowledge permanently (like your long-term memory)
  • πŸ“š Episodic Memory: Remembers past conversations and experiences (like your episodic memory)

🎯 Key Benefits

  • πŸ”„ Context Continuity: Maintains conversation flow across multiple interactions
  • πŸ“ˆ Learning Over Time: Builds knowledge and improves responses with experience
  • πŸ‘€ Personalization: Remembers user preferences and adapts accordingly
  • πŸ”— Relationship Building: Creates meaningful, ongoing relationships with users

πŸ”§ Customizing Memory Configuration

Adjust Memory Settings

Edit agents/memory_demo/playbook/memory_demo_playbook.yaml:

YAML
memory:
  short_term:
    max_tokens: 2000  # More context
  long_term:
    max_entries: 200  # More persistent storage
  episodic:
    max_episodes: 100  # More episodes

Change Storage Type

YAML
memory:
  long_term:
    storage_type: database  # Use database instead of local files
    connection_string: "sqlite:///memory.db"

Disable Memory Types

YAML
memory:
  short_term:
    enabled: false  # Disable short-term memory
  long_term:
    enabled: true
  episodic:
    enabled: true

🚨 Troubleshooting Memory

Common Issues

  1. Ollama Server Not Running

    Bash
    # Check if Ollama server is running
    curl http://localhost:11434/api/tags
    
    # Start Ollama server
    ollama serve
    

  2. Memory Not Working

    Bash
    # Check memory configuration
    super agent inspect memory_demo
    
    # Verify memory is enabled
    

  3. Memory Storage Issues

    Bash
    # Check memory storage directories
    ls -la ./data/memory/
    
    # Clear memory data if needed
    rm -rf ./data/memory/
    

Getting Help

Bash
# Check agent status
super agent inspect memory_demo

# View agent logs
super agent logs memory_demo

# Get memory help
super agent --help