Skip to main content
推荐使用 DistributedStore 一键配置——它同时覆盖 AgentStateStore、BaseStore、SandboxSnapshotSpec、SandboxExecutionGuard。如果只需要单独配置 AgentStateStore,继续阅读本页。
io.agentscope.core.state.AgentStateStore 是 AgentScope 用来持久化 Agent 状态的接口——比如 Memory、Workspace、Plan 等组件都会被序列化为 State 后由 AgentStateStore 落盘,从而支持重启恢复、跨节点共享。 状态通过 (userId, sessionId) 二元组寻址:
  • sessionId——非空、非空白,标识一次会话 / session。
  • userId——可空。null 表示匿名 / 单租户调用方(CLI、测试等)。

可用实现

单独配置

详细用法和代码示例请参阅各后端的文档: