3 lines to remember anything
v3.1 ReleasedAI agents need to remember context across conversations, but existing solutions are either too complex (LangChain memory), too coupled (framework-specific), or too heavy (many dependencies).
Production-ready persistence with zero setup
Auto-expire memories: "7d", "1h", "30m"
Fernet AES encryption for sensitive data
Distributed memory for multi-agent systems
# Install: pip install agent-memory
from agent_memory import Memory
# Initialize with SQLite (recommended)
m = Memory(storage="sqlite", path="./memory.db", ttl="7d")
# Add memory with auto-expiry (1 hour)
m.add("User prefers dark mode", ttl="1h")
# Add encrypted memory
m.add("api_key_xxx", encrypt=True)
# Search memories
results = m.search("theme preferences")
# Get context for your agent
context = m.get_context(max_tokens=2000)
LangChain.memory is powerful but comes with 100+ transitive dependencies. If you just need memory — not the entire framework — Agent Memory is your lightweight alternative.
• Give your Claude/Custom GPT agent persistent memory
• Build multi-agent systems with shared memory
• Store user preferences across sessions
• Create AI assistants that remember context
• Implement conversation history for chatbots