Skip to content

RAG + Long memory for AI_Agents ๐Ÿง  Mem4AI: A LLM Friendly memory management library.

License

Notifications You must be signed in to change notification settings

Sergey131282/mem4ai

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง  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!

About

RAG + Long memory for AI_Agents ๐Ÿง  Mem4AI: A LLM Friendly memory management library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%