AS AgentScopeAPI 手册 / API Reference

MemoryMountService

@Service public class MemoryMountService
源码Source 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_ROOT
staticfinal
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

方法Method说明Description
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.
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`.
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.
public String promptAppendix(List<MountInfo> mounts)
设置该参数。
Builds a system-prompt appendix describing mounted memory-store directories.
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.
public List<MountInfo> materialize(String ownerId, Path workspace, List<String> memoryStoreIds)
deprecated
执行 `materialize` 方法。
Performs the materialize operation.
public void writeback(String ownerId, Path workspace, List<String> memoryStoreIds)
deprecated
执行 `writeback` 方法。
Performs the writeback operation.

字段详情Field Detail

MEMORY_ROOT

public static final String MEMORY_ROOT
staticfinal

记忆根字段。声明为 public static final String MEMORY_ROOT。

Root path segment under which memory-store routes are mounted.

源码Source io/agentscope/builder/web/managed/MemoryMountService.java:44

构造器详情Constructor Detail

MemoryMountService

public MemoryMountService(MemoryStoreService memoryStoreService)

初始化 MemoryMountService 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
memoryStoreServiceMemoryStoreService记忆存储服务(类型 `MemoryStoreService`)。The memory store service.
源码Source 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.

参数Parameters
名称Name类型Type说明Description
ownerIdString所有者标识(类型 `String`)。The owner id.
memoryStoreIdsList<String>记忆存储 Ids(类型 `List`)。The memory store ids.
返回Returns List<MountInfo>
返回列出。Returns list.
源码Source io/agentscope/builder/web/managed/MemoryMountService.java:57–72

createFilesystems

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.

参数Parameters
名称Name类型Type说明Description
ownerIdString所有者标识(类型 `String`)。The owner id.
memoryStoreIdsList<String>记忆存储 Ids(类型 `List`)。The memory store ids.
返回Returns List<MemoryStoreFilesystem>
返回列出。Returns list.
源码Source io/agentscope/builder/web/managed/MemoryMountService.java:80–83

createFilesystems

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.

参数Parameters
名称Name类型Type说明Description
ownerIdString所有者标识(类型 `String`)。The owner id.
memoryStoreIdsList<String>记忆存储 Ids(类型 `List`)。The memory store ids.
accessByStoreIdMap<String, String>访问通过存储标识(类型 `Map`)。The access by store id.
返回Returns List<MemoryStoreFilesystem>
返回列出。Returns list.
源码Source io/agentscope/builder/web/managed/MemoryMountService.java:91–113

promptAppendix

public String promptAppendix(List<MountInfo> mounts)

设置该参数。

Builds a system-prompt appendix describing mounted memory-store directories.

参数Parameters
名称Name类型Type说明Description
mountsList<MountInfo>mounts(类型 `List`)。The mounts.
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/managed/MemoryMountService.java:116–140

createResolvedFilesystems

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.

参数Parameters
名称Name类型Type说明Description
clientio.agentscope.builder.control.ControlPlaneClient客户端(类型 `io.agentscope.builder.control.ControlPlaneClient`)。The client.
sessionIdString会话标识(类型 `String`)。The session id.
ownerIdString所有者标识(类型 `String`)。The owner id.
mountsList<Map<String, Object>>mounts(类型 `List >`)。The mounts.
accessMap<String, String>访问(类型 `Map`)。The access.
返回Returns List<MemoryStoreFilesystem>
返回列出。Returns list.
源码Source io/agentscope/builder/web/managed/MemoryMountService.java:142–167

materialize

public List<MountInfo> materialize(String ownerId, Path workspace, List<String> memoryStoreIds)
deprecated

执行 materialize 方法。

Performs the materialize operation.

已弃用。Deprecated. 已弃用,请改用受支持的替代 API。host-disk materialization is no longer used; memory stores are mounted live via `#createFilesystems`. Retained only so callers mid-migration keep compiling; delegates to `#resolveMounts`.
参数Parameters
名称Name类型Type说明Description
ownerIdString所有者标识(类型 `String`)。The owner id.
workspacePath工作区(类型 `Path`)。The workspace.
memoryStoreIdsList<String>记忆存储 Ids(类型 `List`)。The memory store ids.
返回Returns List<MountInfo>
返回列出。Returns list.
源码Source io/agentscope/builder/web/managed/MemoryMountService.java:174–178

writeback

public void writeback(String ownerId, Path workspace, List<String> memoryStoreIds)
deprecated

执行 writeback 方法。

Performs the writeback operation.

已弃用。Deprecated. 已弃用,请改用受支持的替代 API。writeback is a no-op: `MemoryStoreFilesystem` writes directly through to `MemoryStoreService` on every tool call, so there is nothing left to reconcile after a turn.
参数Parameters
名称Name类型Type说明Description
ownerIdString所有者标识(类型 `String`)。The owner id.
workspacePath工作区(类型 `Path`)。The workspace.
memoryStoreIdsList<String>记忆存储 Ids(类型 `List`)。The memory store ids.
源码Source 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.

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.