Persistent Memory
The Persistent Memory block stores and retrieves information across workflow sessions, enabling agents to remember context, learn from interactions, and maintain long-term knowledge.
Overview
Persistent Memory creates long-term information storage that survives beyond individual workflow executions. Unlike temporary variables that reset with each run, persistent memory maintains context across sessions, users, and time periods.
Information Storage: Save important context, decisions, and learnings to permanent storage
Context Retrieval: Access relevant historical information when processing new requests
Memory Organization: Structure information using tags, categories, and relationships
Memory Management: Update, merge, and clean up stored information over time
How It Works
graph LR
A[New Information] --> B{Store or Retrieve?}
B -->|Store| C[Memory Encoding]
B -->|Retrieve| D[Memory Search]
C --> E[Persistent Storage]
D --> F[Context Matching]
F --> G[Retrieved Memory]
E --> H[Confirmation]Configuration
Memory Store
The backend storage system for persistent data:
- Vector Database: Semantic similarity search (Pinecone, Qdrant, Chroma)
- Graph Database: Relationship-based storage (Neo4j, ArangoDB)
- Key-Value Store: Simple structured storage (Redis, DynamoDB)
Memory Scope
Defines what information gets stored and retrieved:
- User-Specific: Individual user contexts and preferences
- Global: Shared knowledge across all users
- Session-Specific: Conversation threads and temporary context
Retention Policy
Rules for memory lifecycle management:
- Time-Based: Delete memories older than specified duration
- Usage-Based: Remove rarely accessed information
- Capacity-Based: Maintain maximum storage limits
Relevance Threshold
Minimum similarity score for memory retrieval, preventing irrelevant context pollution.
Use Cases
- Customer Service: Remember previous interactions, preferences, and issue history
- Personal Assistants: Maintain user preferences, schedules, and personal context
- Knowledge Management: Build organizational knowledge bases that grow over time
Example Workflow
[User Message] â [Persistent Memory] â [Agent] â [Update Memory] â [Response]A customer service scenario:
First Interaction: Customer asks about return policy for electronics
- Store: Customer interest in electronics, policy questions
- Response: Detailed return policy information
Second Interaction (weeks later): Customer asks about warranty on tablets
- Retrieve: Previous electronics interest, policy questions
- Context: "I see you were asking about electronics returns before..."
- Enhanced Response: Warranty info + proactive return policy reminder
Memory Evolution: System learns customer is electronics-focused and policy-conscious
Best Practice: Design clear memory categories and use semantic embeddings for flexible retrieval. Regularly audit and clean stored memories to maintain relevance.
When to Use This vs Other Blocks
| Block | When to Use |
|---|---|
| Persistent Memory | Long-term context that needs to survive across sessions |
| Episodic Memory | Sequential conversation history and recent interactions |
| Variables | Temporary data within a single workflow execution |