Overview
Long-term memory stores:- Persistent facts - Information that should be remembered indefinitely
- User preferences - Personal settings and choices
- Historical context - Past interactions and decisions
- Domain knowledge - Learned information and insights
- Relationships - Connections between concepts and entities
Memory Implementations
AG-Kit provides multiple long-term memory implementations:Mem0LongTermMemory
Official Mem0 SDK integration with advanced AI-powered memory management. Features:- Automatic memory extraction from conversations
- Semantic search with vector embeddings
- Graph-based memory relationships
- Intelligent memory consolidation
- Deduplication and merging
- Memory decay and reinforcement
- Multi-user and multi-agent support
- Production AI applications
- Personalized user experiences
- Knowledge management systems
- Multi-session conversations
TDAILongTermMemory
TDAI cloud-based long-term memory with enterprise features. Features:- Cloud-based persistent storage
- Semantic search capabilities
- Strategy-based memory organization
- Scalable infrastructure
- Enterprise-grade reliability
- Enterprise deployments
- Large-scale applications
- Distributed systems
Quick Start
Using Mem0LongTermMemory
Manual Memory Recording
Core Operations
Recording Memories
Store new memories in long-term storage.Retrieving Memories
Query memories with various filters and search options.Semantic Search
Find memories using natural language queries with semantic understanding.Updating Memories
Modify existing memories with new information.Deleting Memories
Remove memories by ID or query conditions.Advanced Features
Automatic Memory Extraction ( Mem0 Only )
Mem0 automatically extracts meaningful information from conversations.Related Memories
Find memories related to a specific memory using graph-based relationships.Memory Consolidation ( Mem0 Only )
Automatically deduplicate, merge, and optimize stored memories.Integration with Agents
Long-term memory integrates with agents for persistent, cross-session knowledge. Learn more: Complete Agent Integration GuideBest Practices
1. Use Appropriate Strategies
Organize memories with meaningful strategies:2. Add Rich Metadata
Include contextual information in metadata:3. Use Semantic Search
Take advantage of semantic search for better retrieval:Performance Considerations
Mem0LongTermMemory
- Automatic Optimization: Mem0 handles deduplication and consolidation
- Semantic Search: Fast vector-based similarity search
- Scalability: Handles millions of memories efficiently
- Network Latency: Requires API calls to Mem0 service
- Caching: Consider caching frequently accessed memories
Query Optimization
Comparison: Short-term vs Long-term Memory
| Aspect | Short-term Memory | Long-term Memory |
|---|---|---|
| Purpose | Conversation history | Persistent knowledge |
| Scope | Single session | Cross-session |
| Storage | Recent messages | Extracted facts |
| Retrieval | Chronological | Semantic search |
| Lifespan | Session duration | Indefinite |
| Size | Limited by tokens | Unlimited |
| Use Case | Context window | Personalization |