AgentEntity
@Entity @Table( name = "builder_agent", uniqueConstraints = @UniqueConstraint( name = "ux_builder_agent_owner_agent", columnNames = {"owner_id", "agent_id"}), indexes = { @Index(name = "ix_builder_agent_owner", columnList = "owner_id"), @Index(name = "ix_builder_agent_agent_id", columnList = "agent_id") }) public class AgentEntity
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:60–433智能体 Entity,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.builder.web.persistence.jpa 包。核心成员包括 getRowId、setRowId、getOwnerId、setOwnerId、getAgentId、setAgentId。
Persistent representation of a user-custom agent definition. Keyed by the synthetic
row_id and uniquely identified by the (owner_id, agent_id) pair.
Relationship to the user table
owner_id is a soft foreign key to UserEntity#getUserId(). JPA does not
manage cascading deletes; the application-level
io.agentscope.builder.web.api.AdminUserController#delete flow takes responsibility
for revoking grants and removing the agents owned by a deleted user. The schema keeps
owner_id as an indexed plain column so deployments may add a database-level
FOREIGN KEY ... ON DELETE CASCADE via migration scripts when desired.
Storage layout
-
Scalar metadata (name, description, model, runAs, ...) lives in dedicated columns.
-
List-shaped settings (tools allow/deny, skills allow/deny, group-chat mention patterns) are persisted as JSON strings in a single column each. This keeps the schema portable across MySQL / PostgreSQL / H2 without introducing per-list join tables for what are effectively bounded configuration lists, and matches the wire format used by the JSON-file backend so migration in either direction is straightforward.
-
AgentShareEntityis mapped as a one-to-many relationship withorphanRemoval = true; updates to the shares list replace the whole collection atomically inside one transaction.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public AgentEntity() | 初始化 `AgentEntity` 实例。 Creates a new instance. |
方法摘要Method Summary
构造器详情Constructor Detail
AgentEntity
public AgentEntity()
初始化 AgentEntity 实例。
Creates a new instance.
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:208方法详情Method Detail
getRowId
public Long getRowId()
获取 getRowId。
Returns the row id.
Longio/agentscope/builder/web/persistence/jpa/AgentEntity.java:210–212setRowId
public void setRowId(Long rowId)
设置 setRowId。
Sets the row id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
rowId | Long | row 标识(类型 `Long`)。The row id. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:214–216getOwnerId
public String getOwnerId()
获取所有者标识。
Returns the owner id.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:218–220setOwnerId
public void setOwnerId(String ownerId)
设置所有者标识。
Sets the owner id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:222–224getAgentId
public String getAgentId()
获取智能体标识。
Returns the agent id.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:226–228setAgentId
public void setAgentId(String agentId)
设置智能体标识。
Sets the agent id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentId | String | 智能体标识(类型 `String`)。The agent id. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:230–232getWorkspacePath
public String getWorkspacePath()
获取工作区路径。
Returns the workspace path.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:234–236setWorkspacePath
public void setWorkspacePath(String workspacePath)
设置工作区路径。
Sets the workspace path.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspacePath | String | 工作区路径(类型 `String`)。The workspace path. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:238–240getName
public String getName()
获取名称。
Returns the name.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:242–244setName
public void setName(String name)
设置名称。
Sets the name.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:246–248getDescription
public String getDescription()
获取 getDescription。
Returns the description.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:250–252setDescription
public void setDescription(String description)
设置 setDescription。
Sets the description.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
description | String | 描述(类型 `String`)。The description. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:254–256getSysPrompt
public String getSysPrompt()
获取 getSysPrompt。
Returns the sys prompt.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:258–260setSysPrompt
public void setSysPrompt(String sysPrompt)
设置 setSysPrompt。
Sets the sys prompt.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sysPrompt | String | sys 提示词(类型 `String`)。The sys prompt. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:262–264getModel
public String getModel()
获取模型。
Returns the model.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:266–268setModel
public void setModel(String model)
设置模型。
Sets the model.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
model | String | 模型实例(类型 `String`)。The model. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:270–272getMaxIters
public Integer getMaxIters()
获取最大迭代次数。
Returns the max iters.
Integerio/agentscope/builder/web/persistence/jpa/AgentEntity.java:274–276setMaxIters
public void setMaxIters(Integer maxIters)
设置最大迭代次数。
Sets the max iters.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
maxIters | Integer | 最大迭代次数(类型 `Integer`)。The max iters. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:278–280getToolsJson
public String getToolsJson()
获取工具 JSON。
Returns the tools json.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:282–284setToolsJson
public void setToolsJson(String toolsJson)
设置工具 JSON。
Sets the tools json.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
toolsJson | String | 工具 JSON(类型 `String`)。The tools json. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:286–288getMcpServersJson
public String getMcpServersJson()
获取 getMcpServersJson。
Returns the mcp servers json.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:290–292setMcpServersJson
public void setMcpServersJson(String mcpServersJson)
设置 setMcpServersJson。
Sets the mcp servers json.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
mcpServersJson | String | MCP Servers JSON(类型 `String`)。The mcp servers json. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:294–296getIdentityName
public String getIdentityName()
获取身份名称。
Returns the identity name.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:298–300setIdentityName
public void setIdentityName(String identityName)
设置身份名称。
Sets the identity name.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
identityName | String | 身份名称(类型 `String`)。The identity name. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:302–304getIdentityEmoji
public String getIdentityEmoji()
获取 getIdentityEmoji。
Returns the identity emoji.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:306–308setIdentityEmoji
public void setIdentityEmoji(String identityEmoji)
设置 setIdentityEmoji。
Sets the identity emoji.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
identityEmoji | String | 身份 Emoji(类型 `String`)。The identity emoji. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:310–312getGroupChatMentionPatternsJson
public String getGroupChatMentionPatternsJson()
获取 getGroupChatMentionPatternsJson。
Returns the group chat mention patterns json.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:314–316setGroupChatMentionPatternsJson
public void setGroupChatMentionPatternsJson(String groupChatMentionPatternsJson)
设置 setGroupChatMentionPatternsJson。
Sets the group chat mention patterns json.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
groupChatMentionPatternsJson | String | 组聊天 Mention Patterns JSON(类型 `String`)。The group chat mention patterns json. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:318–320getGroupChatRequireMention
public Boolean getGroupChatRequireMention()
获取 getGroupChatRequireMention。
Returns the group chat require mention.
Booleanio/agentscope/builder/web/persistence/jpa/AgentEntity.java:322–324setGroupChatRequireMention
public void setGroupChatRequireMention(Boolean groupChatRequireMention)
设置 setGroupChatRequireMention。
Sets the group chat require mention.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
groupChatRequireMention | Boolean | 组聊天 Require Mention(类型 `Boolean`)。The group chat require mention. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:326–328getSkillsJson
public String getSkillsJson()
获取技能 JSON。
Returns the skills json.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:330–332setSkillsJson
public void setSkillsJson(String skillsJson)
设置技能 JSON。
Sets the skills json.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillsJson | String | 技能 JSON(类型 `String`)。The skills json. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:334–336getMultiagentJson
public String getMultiagentJson()
获取多智能体 JSON。
Returns the multiagent json.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:338–340setMultiagentJson
public void setMultiagentJson(String multiagentJson)
设置多智能体 JSON。
Sets the multiagent json.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
multiagentJson | String | 多智能体 JSON(类型 `String`)。The multiagent json. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:342–344getRunAs
public String getRunAs()
获取运行 As。
Returns the run as.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:346–348setRunAs
public void setRunAs(String runAs)
设置运行 As。
Sets the run as.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runAs | String | 运行 As(类型 `String`)。The run as. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:350–352getForkOf
public String getForkOf()
获取 getForkOf。
Returns the fork of.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:354–356setForkOf
public void setForkOf(String forkOf)
设置 setForkOf。
Sets the fork of.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
forkOf | String | fork 的(类型 `String`)。The fork of. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:358–360getSkillRepositoriesJson
public String getSkillRepositoriesJson()
获取 getSkillRepositoriesJson。
Returns the skill repositories json.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:362–364setSkillRepositoriesJson
public void setSkillRepositoriesJson(String skillRepositoriesJson)
设置 setSkillRepositoriesJson。
Sets the skill repositories json.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillRepositoriesJson | String | 技能 Repositories JSON(类型 `String`)。The skill repositories json. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:366–368getSandboxMode
public String getSandboxMode()
获取沙箱模式。
Returns the sandbox mode.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:370–372setSandboxMode
public void setSandboxMode(String sandboxMode)
设置沙箱模式。
Sets the sandbox mode.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxMode | String | 沙箱模式(类型 `String`)。The sandbox mode. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:374–376getSandboxScope
public String getSandboxScope()
获取沙箱范围。
Returns the sandbox scope.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:378–380setSandboxScope
public void setSandboxScope(String sandboxScope)
设置沙箱范围。
Sets the sandbox scope.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxScope | String | 沙箱范围(类型 `String`)。The sandbox scope. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:382–384getHeadVersion
public int getHeadVersion()
获取 getHeadVersion。
Returns the head version.
intio/agentscope/builder/web/persistence/jpa/AgentEntity.java:386–388setHeadVersion
public void setHeadVersion(int headVersion)
设置 setHeadVersion。
Sets the head version.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
headVersion | int | head 版本(类型 `int`)。The head version. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:390–392getArchivedAt
public Long getArchivedAt()
获取 getArchivedAt。
Returns the archived at.
Longio/agentscope/builder/web/persistence/jpa/AgentEntity.java:394–396setArchivedAt
public void setArchivedAt(Long archivedAt)
设置 setArchivedAt。
Sets the archived at.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
archivedAt | Long | archived At(类型 `Long`)。The archived at. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:398–400getPermissionPoliciesJson
public String getPermissionPoliciesJson()
获取 getPermissionPoliciesJson。
Returns the permission policies json.
Stringio/agentscope/builder/web/persistence/jpa/AgentEntity.java:402–404setPermissionPoliciesJson
public void setPermissionPoliciesJson(String permissionPoliciesJson)
设置 setPermissionPoliciesJson。
Sets the permission policies json.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
permissionPoliciesJson | String | 权限 Policies JSON(类型 `String`)。The permission policies json. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:406–408getCreatedAt
public long getCreatedAt()
获取已创建 At。
Returns the created at.
longio/agentscope/builder/web/persistence/jpa/AgentEntity.java:410–412setCreatedAt
public void setCreatedAt(long createdAt)
设置已创建 At。
Sets the created at.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
createdAt | long | 已创建 At(类型 `long`)。The created at. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:414–416getUpdatedAt
public long getUpdatedAt()
获取已更新 At。
Returns the updated at.
longio/agentscope/builder/web/persistence/jpa/AgentEntity.java:418–420setUpdatedAt
public void setUpdatedAt(long updatedAt)
设置已更新 At。
Sets the updated at.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
updatedAt | long | 已更新 At(类型 `long`)。The updated at. |
io/agentscope/builder/web/persistence/jpa/AgentEntity.java:422–424