๐ง Mem4AI: A LLM Friendly memory management library.
๐ง Mem4AI: A LLM Friendly memory management library.
README
๐ง Mem4AI: A LLM Friendly memory management library.
Mem4AI enhances AI assistants and agents with an intelligent memory layer, enabling personalized and context-aware AI interactions. Perfect for building smarter chatbots, AI assistants, and autonomous systems that remember and learn.
โจ Core Features
- ๐ Multi-Level Memory: User, Session, and AI Agent memory retention
- ๐ฏ Adaptive Personalization: Continuous improvement based on interactions
- ๐ Fast Local Storage: Efficient on-disk storage with quick access
- ๐ Advanced Semantic Search: Find relevant memories quickly
- ๐ท๏ธ Flexible Metadata: Tag and filter memories easily
- ๐ง Customizable Strategies: Adapt embedding and storage to your needs
- ๐พ Persistent Storage: Memories that last across sessions
๐ Quick Start
Install Mem4AI:
pip install Mem4AI
Here's a simple example of how to use Mem4AI:
from mem4ai import Memtor
# Initialize Memtor
memtor = Memtor()
# Add a memory
memory_id = memtor.add_memory(
"The user prefers dark mode in all applications",
metadata={"preference": "ui", "mode": "dark"},
user_id="alice"
)
# Search for memories
results = memtor.search_memories("user interface preferences", user_id="alice")
print(results[0].content) # Output: The user prefers dark mode in all applications
# Update a memory
memtor.update_memory(
memory_id,
"The user prefers dark mode, except for document editing",
metadata={"preference": "ui", "mode": "dark", "exception": "document_editing"}
)
# Delete a memory
memtor.delete_memory(memory_id)
๐ ๏ธ Use Cases
- ๐ค Chatbots with long-term memory
- ๐ Personalized recommendation systems
- ๐ง Knowledge management systems
- ๐ฏ Context-aware AI assistants
๐ Documentation
Coming soon!
๐ค Contributing
We welcome contributions! Check out our contribution guidelines for more information.
๐ License
Mem4AI is released under the Apache 2.0 license. See LICENSE for more information.
Built with โค๏ธ by Unclecode. (https://x.com/unclecode)
Give Mem4AI a star โญ if you find it helpful!
