Concepts
Memory
How Daydreams agents store, recall, and learn from information.
What is Memory?
Memory is how your agent remembers things between conversations. Just like you remember what you talked about yesterday, agents need memory to be helpful over time.
Real Examples
Here are different types of memory your agent uses:
Short-Term Memory (This Conversation)
Long-Term Memory (Persistent Data)
Experience Memory (Learning from Past)
The Problem: Agents Without Memory Are Useless
Without memory, every conversation starts from scratch:
The Solution: Memory Makes Agents Smart
With memory, agents get better over time:
How Memory Works in Your Agent
1. Agent Automatically Saves Important Information
2. Different Types of Memory for Different Needs
3. Agent Recalls Relevant Memories
Setting Up Memory in Your Agent
Here's how to add memory to your agent:
Basic Memory (In-Memory)
Persistent Memory (Database)
Working with Context Memory
Context memory is what your agent remembers about specific conversations:
Actions Can Update Memory
Experience Memory: Learning from the Past
Your agent can learn from previous conversations:
Memory in Action: Complete Example
Here's how all the memory types work together:
Best Practices
1. Choose the Right Memory Storage
2. Design Clear Memory Structures
3. Don't Store Too Much
4. Handle Memory Gracefully
Memory Types Summary
Memory Type | Purpose | Lifetime | Example |
---|---|---|---|
Working Memory | Current conversation | Single conversation | "User just asked about weather" |
Context Memory | User/session data | Persists forever | "Alice prefers detailed weather" |
Action Memory | Action-specific state | Persists forever | "Weather API called 47 times today" |
Experience Memory | Learning from past | Persists forever | "Users like step-by-step cooking help" |
Key Takeaways
- Memory makes agents smart - Without it, every conversation starts from scratch
- Multiple memory types - Short-term (conversation), long-term (user data), experience (learning)
- Automatic persistence - Agent saves important information without extra code
- Experience learning - Agent gets better over time by remembering what works
- Choose storage wisely - In-memory for development, database for production
- Keep it organized - Clear memory structures make agents more reliable
Memory transforms your agent from a stateless chatbot into an intelligent assistant that learns, remembers, and gets better with every interaction.