MemoryMountService
@Service public class MemoryMountService
io/agentscope/builder/web/managed/MemoryMountService.java:38–204记忆 Mount 服务,承载智能体的部署、调度与服务化运行。位于 io.agentscope.builder.web.managed 包。核心成员包括 resolveMounts、createFilesystems、promptAppendix、createResolvedFilesystems、materialize、writeback。
Resolves session-bound memory stores into MemoryStoreFilesystem routes mounted under
memory-stores/{storeName}/ in the harness filesystem (see MemoryStoreFilesystem#routePrefix and EnvironmentSpecFactory#applyMemoryStoreRoutes).
Memory documents are read/written directly against the MemoryStoreService JPA store
— there is no host-disk materialization step, so mounts stay in sync across concurrent turns
and cached io.agentscope.harness.agent.HarnessAgent instances without an explicit
writeback pass.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
MountInfo | 记录record | 承载 Mount 信息数据的记录类型。 Description of one mounted memory store. |
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
MEMORY_ROOTstaticfinal | String | 记忆根字段。 Root path segment under which memory-store routes are mounted. |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public MemoryMountService(MemoryStoreService memoryStoreService) | 初始化 `MemoryMountService` 实例。 Creates a new instance. |
方法摘要Method Summary
字段详情Field Detail
MEMORY_ROOT
public static final String MEMORY_ROOT
记忆根字段。声明为 public static final String MEMORY_ROOT。
Root path segment under which memory-store routes are mounted.
io/agentscope/builder/web/managed/MemoryMountService.java:44构造器详情Constructor Detail
MemoryMountService
public MemoryMountService(MemoryStoreService memoryStoreService)
初始化 MemoryMountService 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
memoryStoreService | MemoryStoreService | 记忆存储服务(类型 `MemoryStoreService`)。The memory store service. |
io/agentscope/builder/web/managed/MemoryMountService.java:48–50方法详情Method Detail
resolveMounts
public List<MountInfo> resolveMounts(String ownerId, List<String> memoryStoreIds)
解析 resolveMounts。
Loads store metadata for each requested memory store id and returns mount descriptions suitable for system-prompt injection.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
memoryStoreIds | List<String> | 记忆存储 Ids(类型 `List`)。The memory store ids. |
List<MountInfo>io/agentscope/builder/web/managed/MemoryMountService.java:57–72createFilesystems
public List<MemoryStoreFilesystem> createFilesystems(String ownerId, List<String> memoryStoreIds)
创建 createFilesystems。
Builds one MemoryStoreFilesystem per resolvable memory store id, ready to be mounted via EnvironmentSpecFactory#applyMemoryStoreRoutes.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
memoryStoreIds | List<String> | 记忆存储 Ids(类型 `List`)。The memory store ids. |
List<MemoryStoreFilesystem>io/agentscope/builder/web/managed/MemoryMountService.java:80–83createFilesystems
public List<MemoryStoreFilesystem> createFilesystems(String ownerId, List<String> memoryStoreIds, Map<String, String> accessByStoreId)
创建 createFilesystems。
Builds one MemoryStoreFilesystem per resolvable memory store id, applying a per-store access mode (read_only | read_write, default read_write) from accessByStoreId (typically sourced from the session's environment config, e.g.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
memoryStoreIds | List<String> | 记忆存储 Ids(类型 `List`)。The memory store ids. |
accessByStoreId | Map<String, String> | 访问通过存储标识(类型 `Map`)。The access by store id. |
List<MemoryStoreFilesystem>io/agentscope/builder/web/managed/MemoryMountService.java:91–113promptAppendix
public String promptAppendix(List<MountInfo> mounts)
设置该参数。
Builds a system-prompt appendix describing mounted memory-store directories.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
mounts | List<MountInfo> | mounts(类型 `List`)。The mounts. |
Stringio/agentscope/builder/web/managed/MemoryMountService.java:116–140createResolvedFilesystems
public List<MemoryStoreFilesystem> createResolvedFilesystems(io.agentscope.builder.control.ControlPlaneClient client, String sessionId, String ownerId, List<Map<String, Object>> mounts, Map<String, String> access)
创建 createResolvedFilesystems。
Creates the resolved filesystems.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
client | io.agentscope.builder.control.ControlPlaneClient | 客户端(类型 `io.agentscope.builder.control.ControlPlaneClient`)。The client. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
mounts | List<Map<String, Object>> | mounts(类型 `List >`)。The mounts. |
access | Map<String, String> | 访问(类型 `Map`)。The access. |
List<MemoryStoreFilesystem>io/agentscope/builder/web/managed/MemoryMountService.java:142–167materialize
public List<MountInfo> materialize(String ownerId, Path workspace, List<String> memoryStoreIds)
执行 materialize 方法。
Performs the materialize operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
workspace | Path | 工作区(类型 `Path`)。The workspace. |
memoryStoreIds | List<String> | 记忆存储 Ids(类型 `List`)。The memory store ids. |
List<MountInfo>io/agentscope/builder/web/managed/MemoryMountService.java:174–178writeback
public void writeback(String ownerId, Path workspace, List<String> memoryStoreIds)
执行 writeback 方法。
Performs the writeback operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
workspace | Path | 工作区(类型 `Path`)。The workspace. |
memoryStoreIds | List<String> | 记忆存储 Ids(类型 `List`)。The memory store ids. |
io/agentscope/builder/web/managed/MemoryMountService.java:185–188嵌套类详情Nested Class Detail
MountInfo
public record MountInfo( String storeId, String storeName, String relativePath, String accessMode)承载 Mount 信息数据的记录类型。位于 io.agentscope.builder.web.managed 包。核心成员包括 storeId、storeName、relativePath、accessMode、MountInfo。
Description of one mounted memory store.