messages and compressed context summaries, enabling agents to access both short-term and long-term memory efficiently.
Quick Start
How It Works
| Memory Type | Purpose | Freshness | Use Case |
|---|---|---|---|
| Messages | Short-horizon recall | Real-time | Recent conversations, immediate context |
| Context | Long-term memory | May lag in cloud | Historical facts, user preferences |
Agent Integration Patterns
- Time Window Strategy
- Token-Limited Strategy
- Smart Deduplication
Failure Modes & Solutions
Summary Lag Issue
Summary Lag Issue
Symptom: Agent forgets recent conversation turnsCause: Cloud Zep deployments may have lag between message ingestion and summary generationSolution:
High Token Usage
High Token Usage
Symptom: Hitting LLM context limits due to verbose memoryCause: Including both full message history and redundant contextSolution:
Redundant Verbosity
Redundant Verbosity
Symptom: Duplicate information from messages and context overlapCause: Context summary includes details already present in recent messagesSolution:
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
api_url | str | Required | Zep server URL |
api_key | str | Required | Authentication key |
session_id | str | Required | Unique session identifier |
user_id | str | Optional | User identifier for context |
message_limit | int | 10 | Maximum recent messages to retrieve |
context_window_hours | int | 24 | Time window for message retrieval |
Best Practices
Memory Strategy Selection
Memory Strategy Selection
Choose the right strategy based on your use case:
- Chat Applications: Use time window strategy (24-48 hours)
- Task-Oriented Agents: Use token-limited strategy with higher message priority
- Long-Running Sessions: Use smart deduplication to avoid redundancy
- Real-Time Systems: Always fetch messages first, context as fallback
Error Handling
Error Handling
Implement robust fallbacks:
Performance Optimization
Performance Optimization
Optimize for your deployment:
- Batch Operations: Retrieve memory for multiple sessions at once
- Caching: Cache context summaries that don’t change frequently
- Async Operations: Use async Zep client for better throughput
- Monitoring: Track summary lag and adjust strategies accordingly
Testing Memory Integration
Testing Memory Integration
Validate your memory strategy:
Related
Memory Systems
Core memory concepts and patterns
Agent Configuration
Agent setup and configuration

