Overseas access: www.kdjingpai.com
Bookmark Us

memU is an open source memory framework designed specifically for AI companions. While current big language models generally have short memories and are unable to establish long-term connections with users, memU acts like an intelligent "memory folder" for AI, allowing AI to remember users' identities, preferences, and past conversations, and "grow" with users as they continue to interact with each other. "The framework is centered on an autonomous memory. At the core of the framework is an autonomous Memory Agent that automatically decides what information to record, modify or archive, and consolidates fragmented conversations into structured memory files. In this way, memU solves the problems of high cost, low accuracy and difficult management of traditional memory solutions, aiming to make it easier for developers to build personalized AI apps that really know you and remember you.

 

Function List

  • Optimized for AI partners: The design of the framework is completely centered around application scenarios such as AI companion and AI role-playing that require long-term interaction, providing highly adaptable memory capabilities.
  • High accuracy and low cost: In Locomo benchmark tests, memU achieves a memory accuracy of 921 TP3T while being able to reduce the cost of recalling memory functions by as much as 901 TP3T through an optimized online platform.
  • Intelligent Memory File System: It is not a simple information storage, but an intelligent management of memory through four core mechanisms:
    • Organize: Memory files are automatically managed by the memory agent without manual intervention.
    • Link: Automatically associates related memories to form a knowledge graph, transforming search into easy recall.
    • Evolve: AI is also self-reflective when offline, generating new insights by analyzing existing memories and making the knowledge base smarter.
    • Never Forget: Automatically prioritizes memories based on how often they are used, with important information readily available and unimportant information fading out, mimicking human memory habits.
  • Advanced Search Strategies: Support for semantic, hybrid and contextual search ensures that AI can find the information it needs quickly and accurately.
  • Flexible deployment options::
    • Cloud version: Provides out-of-the-box API services that developers can integrate quickly without having to worry about server and maintenance issues.
    • Enterprise Edition: Commercial licensing, private deployments and exclusive technical support for organizations requiring the highest level of security and customization.
    • Community Edition (coming soon): Allows developers to deploy themselves locally with full control over data and customization needs.

Using Help

The core idea of memU is to make the process of memorizing AI as intuitive and automated as managing computer files. Developers no longer need to manually deal with fragmented chat logs or complex vector data, but leave these to memU's memory agent. Currently, the fastest way to get started with memU is the cloud-based service it provides.

The following is a detailed procedure for accessing and using the cloud version of memU:

Step 1: Create an account and get an API key

  1. First, you need to access the official application platform of memU:https://app.memu.soThe
  2. Complete the registration process on the website to create a new account.
  3. Once logged in, find the page with the "API Key" or similar option in the platform's dashboard or settings menu (usually the link is https://app.memu.so/api-key/).
  4. Click Generate a new API Key (API Key) and copy this key. This key is the only credential for your application to communicate with the memU cloud service, so keep it safe.

Step 2: Install memU client in your Python project

In your development environment, open a terminal or command line tool and use thepipcommand to install the official Python library for memU.

pip install memu-py

This library encapsulates all the complexities of interacting with the memU API, allowing you to implement powerful memories with a few simple lines of code.

Step 3: Call memU in code to implement dialog memory

Once the installation is complete, you can initialize the code in the MemuClient and started using it. Here's a basic example that demonstrates how a conversation can be given to memU to memorize.

import os
from memu import MemuClient
# 建议将API密钥存储在环境变量中,而不是硬编码在代码里
# 在终端中设置环境变量: export MEMU_API_KEY='你的API密钥'
api_key = os.getenv("MEMU_API_KEY")
# 1. 初始化客户端
# base_url 指向 memU 的云端API地址
memu_client = MemuClient(
base_url="https://api-preview.memu.so",
api_key=api_key
)
# 2. 准备你要记忆的对话内容
# 它可以是一段简单的文本,包含了用户和AI的交流
conversation_text = """
用户: "嘿,今天天气真不错!"
AI助手: "是啊,阳光明媚,很适合出去散步。你有什么计划吗?"
用户: "我打算下午去公园跑步,顺便买杯咖啡。"
AI助手: "听起来很棒!记得带上防晒霜。你最喜欢哪种咖啡?"
用户: "我最喜欢拿铁。"
"""
# 3. 调用 memorize_conversation 函数
# 这个函数会将对话内容发送给 memU 的记忆代理进行处理
memu_client.memorize_conversation(
conversation=conversation_text,
user_id="user_001",         # 唯一的用户ID,用于区分不同用户
user_name="张三",           # 用户的名字或昵称
agent_id="assistant_001",   # AI伴侣的唯一ID
agent_name="贴心小助"      # AI伴侣的名字
)
print("对话已成功记忆!")

code interpretation::

  • MemuClient(...): Create a client instance which is your bridge to the memU service.
  • memorize_conversation(...): This is the core function. It receives a piece of dialog text with some key metadata:
    • user_id cap (a poem) agent_idThese two IDs are crucial. memU uses them to create separate "memory folders" for each user and each AI partner. This ensures that user A's memories will not be confused with user B's.
    • user_name cap (a poem) agent_name: Provide richer context for the AI to understand the roles of the conversation.

After executing this code, memU's memory agent will automatically analyze this conversation. It may create a record of user "Zhang San's" preferences (e.g., likes to run in the park on sunny days, likes to drink lattes) and store it in the user's exclusive memory file. The next time "Zhangsan" interacts with "Xiaosuke", the AI can query the memU to recall this information, so as to have a warmer and more humane conversation.

application scenario

  1. AI Companion and AI Role Playing
    This is the most core application scenario of memU. Whether it is an AI companion for emotional accompaniment or a role-playing AI in a specific worldview, it needs to remember the user's personal information, past interactions, and emotional state. memU can help the AI to remember the user's birthday, hobbies, and important experiences, so that every conversation can be based on the past instead of a "cold start", thus establishing a real emotional bond. This allows every conversation to be based on the past, rather than a "cold start", thus establishing a real emotional bond.
  2. AI education
    In the field of education, memU can help AI tutors remember each student's learning progress, strengths and weaknesses. For example, if a student repeatedly makes mistakes on a certain math concept, the AI tutor can remember this and provide targeted tutoring and practice in future lessons, enabling truly personalized education.
  3. AI Counseling
    Counseling relies heavily on long-term trust and understanding. memU can act as a reliable "medical record" system, helping AI therapists to securely record every communication with a visitor, remembering their mood swings, references to key people and events. This enables AI to provide consistent, stable and empathetic support over a long period of time.
  4. Intelligent Personal Assistant
    AIs in the personal assistant category need to deal with a large number of daily affairs and user preferences. With memU, the AI assistant can remember the user's commuting route, frequently used meeting software, favorite takeout flavor, family's birthday, etc. When the user says, "Help me schedule a meeting tomorrow," the AI can automatically recall the user's habits and make smarter and more thoughtful suggestions. When the user says "help me arrange a meeting tomorrow", the AI can automatically recall the user's habits and make smarter and more thoughtful suggestions.

QA

  1. Question: How is memU different from a traditional vector database?
    Answer: Traditional vector databases mainly provide low-level "information storage and retrieval" functions, usually converting text segments into vectors and then performing similarity searches. memU is a higher-level, more intelligent "memory management framework". It has a built-in autonomous Memory Agent that not only stores information, but also automatically organizes, links, reflects and forgets memories, forming a dynamically evolving knowledge graph that is closer to human memory.
  2. Question: Is my data safe with memU's cloud services?
    Answer: For business applications and scenarios dealing with sensitive data, memU offers an Enterprise Edition that supports private deployment. This means that you can deploy the entire memU system on your own servers and thus have full control over data privacy and security. The Community Edition (self-hosted) will also offer local deployment options in the future.
  3. Question: What are the big language models supported by memU?
    Answer: memU itself is a memory framework that sits between the Large Language Model (LLM) and the application, and is model-agnostic by design. You can integrate it into any AI Agent built on LLM. When you use its cloud-based services, the memU platform takes care of the details of model invocation and memory management, and developers don't need to manipulate the underlying model directly.
  4. QUESTION: When will the Community Edition (self-hosted) be ready for release?
    Answer: According to its GitHub page, the current status of the community version is "Coming Soon". For those who are interested in this feature, we recommend following their GitHub repository or joining the official Discord community to get the latest release updates.
0Bookmarked
0kudos

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Top

en_USEnglish