agentscope-extensions-mem0 integrates Mem0 as the long-term memory store, combining vector search with LLM-based memory extraction. It supports the Mem0 SaaS platform, self-hosted deployments, and local stand-alone setups.
When to use
- You want cross-session factual memory in your Agent (user preferences, prior decisions).
- You need multi-tenant isolation via three metadata layers:
agentId / userId / runId. - You want to filter memory at retrieval time using custom metadata, e.g.
category=travel.
Add the dependency
Quickstart
Deployment modes
Mem0ApiType chooses the URL conventions and auth scheme:
Multi-tenant isolation
agentName / userId / runName are the three identifier layers Mem0 uses to organize memory:
build() throws IllegalArgumentException. Retrieval only returns memories whose metadata matches.
Custom metadata filtering
metadata(...) is applied to both writes and reads — it is persisted with each memory and injected as a filter when retrieving.
userId alone is enough.
Builder reference
At least one ofagentName / userId / runNamemust be set, otherwisebuild()throwsIllegalArgumentException.