Mem0AddRequest
@JsonInclude(JsonInclude.Include.NON_NULL) public class Mem0AddRequest
io/agentscope/core/memory/mem0/Mem0AddRequest.java:36–468Mem 0 添加请求,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.core.memory.mem0 包。核心成员包括 getMessages、setMessages、getAgentId、setAgentId、getUserId、setUserId。
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
| 类Class | 类型Kind | 说明Description |
|---|---|---|
Builder | 类class | Mem0AddRequest的构建器。 Builder for Mem0AddRequest. |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public Mem0AddRequest() | 初始化 `Mem0AddRequest` 实例。 Default constructor for Jackson. |
方法摘要Method Summary
构造器详情Constructor Detail
Mem0AddRequest
public Mem0AddRequest()
初始化 Mem0AddRequest 实例。
Default constructor for Jackson.
io/agentscope/core/memory/mem0/Mem0AddRequest.java:120–125方法详情Method Detail
getMessages
public List<Mem0Message> getMessages()
获取消息。
Returns the messages.
List<Mem0Message>io/agentscope/core/memory/mem0/Mem0AddRequest.java:129–131setMessages
public void setMessages(List<Mem0Message> messages)
设置消息。
Sets the messages.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
messages | List<Mem0Message> | 消息列表(类型 `List`)。The messages. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:133–135getAgentId
public String getAgentId()
获取智能体标识。
Returns the agent id.
Stringio/agentscope/core/memory/mem0/Mem0AddRequest.java:137–139setAgentId
public void setAgentId(String agentId)
设置智能体标识。
Sets the agent id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentId | String | 智能体标识(类型 `String`)。The agent id. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:141–143getUserId
public String getUserId()
获取用户标识。
Returns the user id.
Stringio/agentscope/core/memory/mem0/Mem0AddRequest.java:145–147setUserId
public void setUserId(String userId)
设置用户标识。
Sets the user id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:149–151getAppId
public String getAppId()
获取应用标识。
Returns the app id.
Stringio/agentscope/core/memory/mem0/Mem0AddRequest.java:153–155setAppId
public void setAppId(String appId)
设置应用标识。
Sets the app id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
appId | String | 应用标识(类型 `String`)。The app id. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:157–159getRunId
public String getRunId()
获取运行标识。
Returns the run id.
Stringio/agentscope/core/memory/mem0/Mem0AddRequest.java:161–163setRunId
public void setRunId(String runId)
设置运行标识。
Sets the run id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runId | String | 运行标识(类型 `String`)。The run id. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:165–167getMetadata
public Map<String, Object> getMetadata()
获取元数据。
Returns the metadata.
Map<String, Object>io/agentscope/core/memory/mem0/Mem0AddRequest.java:169–171setMetadata
public void setMetadata(Map<String, Object> metadata)
设置元数据。
Sets the metadata.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
metadata | Map<String, Object> | 元数据(类型 `Map`)。The metadata. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:173–175getIncludes
public String getIncludes()
获取 getIncludes。
Returns the includes.
Stringio/agentscope/core/memory/mem0/Mem0AddRequest.java:177–179setIncludes
public void setIncludes(String includes)
设置 setIncludes。
Sets the includes.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
includes | String | includes(类型 `String`)。The includes. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:181–183getExcludes
public String getExcludes()
获取 getExcludes。
Returns the excludes.
Stringio/agentscope/core/memory/mem0/Mem0AddRequest.java:185–187setExcludes
public void setExcludes(String excludes)
设置 setExcludes。
Sets the excludes.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
excludes | String | excludes(类型 `String`)。The excludes. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:189–191getInfer
public Boolean getInfer()
获取 getInfer。
Returns the infer.
Booleanio/agentscope/core/memory/mem0/Mem0AddRequest.java:193–195setInfer
public void setInfer(Boolean infer)
设置 setInfer。
Sets the infer.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
infer | Boolean | infer(类型 `Boolean`)。The infer. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:197–199getOutputFormat
public String getOutputFormat()
获取输出格式。
Returns the output format.
Stringio/agentscope/core/memory/mem0/Mem0AddRequest.java:201–203setOutputFormat
public void setOutputFormat(String outputFormat)
设置输出格式。
Sets the output format.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
outputFormat | String | 输出格式(类型 `String`)。The output format. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:205–207getCustomCategories
public Map<String, Object> getCustomCategories()
获取自定义类别。
Returns the custom categories.
Map<String, Object>io/agentscope/core/memory/mem0/Mem0AddRequest.java:209–211setCustomCategories
public void setCustomCategories(Map<String, Object> customCategories)
设置自定义类别。
Sets the custom categories.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
customCategories | Map<String, Object> | 自定义类别(类型 `Map`)。The custom categories. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:213–215getCustomInstructions
public String getCustomInstructions()
获取自定义指令。
Returns the custom instructions.
Stringio/agentscope/core/memory/mem0/Mem0AddRequest.java:217–219setCustomInstructions
public void setCustomInstructions(String customInstructions)
设置自定义指令。
Sets the custom instructions.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
customInstructions | String | 自定义指令(类型 `String`)。The custom instructions. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:221–223getImmutable
public Boolean getImmutable()
获取不可变。
Returns the immutable.
Booleanio/agentscope/core/memory/mem0/Mem0AddRequest.java:225–227setImmutable
public void setImmutable(Boolean immutable)
设置不可变。
Sets the immutable.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
immutable | Boolean | 不可变(类型 `Boolean`)。The immutable. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:229–231getAsyncMode
public Boolean getAsyncMode()
获取异步模式。
Returns the async mode.
Booleanio/agentscope/core/memory/mem0/Mem0AddRequest.java:233–235setAsyncMode
public void setAsyncMode(Boolean asyncMode)
设置异步模式。
Sets the async mode.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
asyncMode | Boolean | 异步模式(类型 `Boolean`)。The async mode. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:237–239getTimestamp
public Long getTimestamp()
获取时间戳。
Returns the timestamp.
Longio/agentscope/core/memory/mem0/Mem0AddRequest.java:241–243setTimestamp
public void setTimestamp(Long timestamp)
设置时间戳。
Sets the timestamp.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
timestamp | Long | 时间戳(类型 `Long`)。The timestamp. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:245–247getExpirationDate
public String getExpirationDate()
获取 getExpirationDate。
Returns the expiration date.
Stringio/agentscope/core/memory/mem0/Mem0AddRequest.java:249–251setExpirationDate
public void setExpirationDate(String expirationDate)
设置 setExpirationDate。
Sets the expiration date.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
expirationDate | String | expiration 日期(类型 `String`)。The expiration date. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:253–255getOrgId
public String getOrgId()
获取 getOrgId。
Returns the org id.
Stringio/agentscope/core/memory/mem0/Mem0AddRequest.java:257–259setOrgId
public void setOrgId(String orgId)
设置 setOrgId。
Sets the org id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
orgId | String | org 标识(类型 `String`)。The org id. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:261–263getProjectId
public String getProjectId()
获取 getProjectId。
Returns the project id.
Stringio/agentscope/core/memory/mem0/Mem0AddRequest.java:265–267setProjectId
public void setProjectId(String projectId)
设置 setProjectId。
Sets the project id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
projectId | String | project 标识(类型 `String`)。The project id. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:269–271getVersion
public String getVersion()
获取版本。
Returns the version.
Stringio/agentscope/core/memory/mem0/Mem0AddRequest.java:273–275setVersion
public void setVersion(String version)
设置版本。
Sets the version.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
version | String | 版本(类型 `String`)。The version. |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:277–279getMemoryType
public String getMemoryType()
获取记忆类型。
Gets the memory type.
Stringio/agentscope/core/memory/mem0/Mem0AddRequest.java:287–290setMemoryType
public void setMemoryType(String memoryType)
设置记忆类型。
Sets the memory type.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
memoryType | String | 记忆类型。The memory type |
io/agentscope/core/memory/mem0/Mem0AddRequest.java:298–301builder
public static Builder builder()
创建新的构建器用于 Mem0AddRequest。
Creates a new builder for Mem0AddRequest.
Builderio/agentscope/core/memory/mem0/Mem0AddRequest.java:308–310嵌套类详情Nested Class Detail
Builder
public static class BuilderMem0AddRequest的构建器。位于 io.agentscope.core.memory.mem0 包。核心成员包括 messages、agentId、userId、appId、runId、metadata。
Builder for Mem0AddRequest.