Package io.agentscope.core.memory.mem0
Class Mem0AddRequest
java.lang.Object
io.agentscope.core.memory.mem0.Mem0AddRequest
Request object for adding memories to Mem0 API.
This request is sent to the Mem0 API's POST /v1/memories/ endpoint to
record new memories. Mem0 will process the messages and extract memorable information
using LLM-powered inference (unless infer is set to false).
The metadata fields (agentId, userId, runId, appId) are used to organize and filter memories, enabling multi-tenant and multi-agent scenarios.
The API supports v2 version which is recommended for new applications. Set version
to "v2" to use the latest features.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Mem0AddRequest.Builderbuilder()Creates a new builder for Mem0AddRequest.getAppId()getInfer()Deprecated.Not in official API specgetOrgId()getRunId()voidsetAgentId(String agentId) voidvoidsetAsyncMode(Boolean asyncMode) voidsetCustomCategories(Map<String, Object> customCategories) voidsetCustomInstructions(String customInstructions) voidsetExcludes(String excludes) voidsetExpirationDate(String expirationDate) voidsetImmutable(Boolean immutable) voidsetIncludes(String includes) voidvoidsetMemoryType(String memoryType) Deprecated.Not in official API specvoidsetMessages(List<Mem0Message> messages) voidsetMetadata(Map<String, Object> metadata) voidvoidsetOutputFormat(String outputFormat) voidsetProjectId(String projectId) voidvoidsetTimestamp(Long timestamp) voidvoidsetVersion(String version)
-
Constructor Details
-
Mem0AddRequest
public Mem0AddRequest()Default constructor for Jackson.
-
-
Method Details
-
getMessages
-
setMessages
-
getAgentId
-
setAgentId
-
getUserId
-
setUserId
-
getAppId
-
setAppId
-
getRunId
-
setRunId
-
getMetadata
-
setMetadata
-
getIncludes
-
setIncludes
-
getExcludes
-
setExcludes
-
getInfer
-
setInfer
-
getOutputFormat
-
setOutputFormat
-
getCustomCategories
-
setCustomCategories
-
getCustomInstructions
-
setCustomInstructions
-
getImmutable
-
setImmutable
-
getAsyncMode
-
setAsyncMode
-
getTimestamp
-
setTimestamp
-
getExpirationDate
-
setExpirationDate
-
getOrgId
-
setOrgId
-
getProjectId
-
setProjectId
-
getVersion
-
setVersion
-
getMemoryType
Deprecated.Not in official API specGets the memory type.- Returns:
- The memory type
-
setMemoryType
Deprecated.Not in official API specSets the memory type.- Parameters:
memoryType- The memory type
-
builder
Creates a new builder for Mem0AddRequest.- Returns:
- A new builder instance
-