messages and compressed context summaries, enabling agents to access both short-term and long-term memory efficiently.
Quick Start
1
Install Zep Client
Set
ZEP_API_URL and ZEP_API_KEY as environment variables. Get your API key from your Zep dashboard.2
Basic Memory Retrieval
3
Dual-Read Strategy
How It Works
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
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

