Membase is the first decentralized AI memory layer for AI agents.It provides secure, scalable storage for conversation history, knowledge bases, and blockchain-synced task coordination.
Membase ensures that agents have long-term, verifiable memory — a critical foundation for sovereign, self-evolving AI agents in Web3.
Key Features
Decentralized Memory: Persistent storage for conversations, interactions, and prompts.
Knowledge Base Management: Embedding and retrieval of structured documents using local or remote vector stores.
Blockchain Task Coordination: Smart contract-based task registry and reward distribution.
Storage Hub Integration: Sync conversations and documents to a decentralized memory hub.
Installation
pip install git+https://github.com/unibaseio/membase.git
# or clone into local
git clone https://github.com/unibaseio/membase.git
cd membase
pip install -e .
Quick Start Examples
Multi-Memory (Conversation Management)
from membase.memory.multi_memory import MultiMemory
from membase.memory.message import Message
mm = MultiMemory(membase_account="default", auto_upload_to_hub=True, preload_from_hub=True)
msg = Message(
name="agent9527",
content="Hello! How can I help you?",
role="assistant",
metadata="help info"
)
conversation_id = 'your_conversation'
mm.add(msg, conversation_id)
Buffered Memory (Simple Memory)
from membase.memory.buffered_memory import BufferedMemory
from membase.memory.message import Message
memory = BufferedMemory(membase_account="default", auto_upload_to_hub=True)
msg = Message(
name="agent9527",
content="Hello! How can I help you?",
role="assistant",
metadata="help info"
)
memory.add(msg)
Knowledge Base Management
from membase.knowledge.chroma import ChromaKnowledgeBase
from membase.knowledge.document import Document
kb = ChromaKnowledgeBase(
persist_directory="/tmp/test",
membase_account="default",
auto_upload_to_hub=True
)
doc = Document(
content="The quick brown fox jumps over the lazy dog.",
metadata={"source": "test", "date": "2025-03-05"}
)
kb.add_documents(doc)