General Introduction
Memobase is a user profile-based memory system designed to support long-lasting user memory for generative AI applications. Whether you're building a virtual companion, educational tool, or personalized assistant, Memobase helps your AI remember, understand, and evolve with user interactions. With Memobase, developers can define and control the user information captured by the AI, ensuring that the AI is able to update its memory over time to avoid outdated information.Memobase provides scalable user profiles that evolve naturally through conversations and is easy to integrate into existing LLM (Large Language Model) stacks with support for Python, Node, and Go, among many other SDKs.
Function List
- User Memory Management: Define and control the user information captured by the AI to ensure memory accuracy and timeliness.
- Time-aware memory: Save information for a specific date to avoid outdated information affecting AI decisions.
- Extensible user profiles: Naturally evolving user profiles through conversations and supporting large-scale user data processing.
- Easy to integrate: Fast integration with minimal code changes through APIs and multiple SDKs (Python, Node, Go).
- batch file: Industry-leading processing speed and cost-effectiveness through non-embedded systems and session buffers.
- Production environment ready: Tested in production environments by our partners to ensure stability and reliability.
Using Help
Installation process
- Installing the Python SDK::
pip install memobase
- Starting the Memobase backend::
- Make sure to have the project URL (default
http://localhost:8019
) and the project token (the defaultsecret
).
- Make sure to have the project URL (default
Usage Process
- Initializing the client::
from memobase import MemoBaseClient, ChatBlob
mb = MemoBaseClient(project_url=PROJECT_URL, api_key=PROJECT_TOKEN)
assert mb.ping()
- Manage Users::
- Add user:
python
uid = mb.add_user({"any_key": "any_value"})
- Update user information:
python
mb.update_user(uid, {"any_key": "any_value2"})
- Get user information:
python
u = mb.get_user(uid)
print(u)
- Delete the user:
python
mb.delete(uid)
- Add user:
- insert data::
- Insert dialog data:
python
messages = [
{"role": "user", "content": "Hello, I'm Gus"}, {"role": "user", "content": "Hello, I'm Gus"}, }
{"role": "assistant", "content": "Hi, nice to meet you, Gus!"}
] bid = u.insert(ChatBlob(messages=messages))
print(u.get(bid))
- By default, Memobase deletes data blocks after processing. Data can be persisted by adjusting the configuration file.
- Insert dialog data:
Main function operation flow
- Defining User Memory::
- Define the user information that the AI needs to capture through API calls.
- Time-aware memory::
- Keeping date-specific information in user profiles ensures that AI is not affected by outdated data.
- Extensible user profiles::
- User profiles evolve naturally through conversations, and developers can control the size of the memories.
- batch file::
- Fast and cost-effective batch data processing through non-embedded systems and session buffering.
With the above steps, developers can easily get started with Memobase to provide powerful user long-term memory support for generative AI applications.