AS AgentScopeAPI 手册 / API Reference
状态·记忆·会话State, memory & sessions · 单元Unit 06

状态与记忆:让会话可恢复、可扩展State and memory: recoverable, scalable conversations

状态决定进程重启后能否接着聊,记忆决定跨会话能否记得。学完本单元,你能区分两者并避免多实例覆盖、并发写冲突和上下文膨胀。State decides whether a conversation survives a restart; memory decides whether it survives across sessions. After this unit you can separate them and avoid multi-instance overwrites, write conflicts and context bloat.

10 道题questions 5 张概念卡concept cards 2 个相关事故related incidents

学习目标Learning goals

  • 区分 AgentState 与会话记忆Separate AgentState from conversational memory
  • 把状态落到外部存储并处理并发写入Persist state externally and handle concurrent writes
  • 设计长期记忆的写入与检索边界Design write and retrieval boundaries for long-term memory

概念闪卡Concept cards

点击卡片翻面查看解释。Click a card to flip it and reveal the explanation.

关键 APIKey APIs

点击进入对应的 Python 或 Java 参考页。Open the exact Python or Java reference for each type.

问题巩固Check yourself

完成 10 道题;答错会自动进入错题本。Answer all ten questions. Wrong answers are added to your wrong-answer book automatically.

01Python 中保存可恢复会话状态的核心类型是?Which Python type stores recoverable conversation state?
02生产环境中 Agent 状态应该放在哪里?Where should agent state live in production?
03Java 中持久化 AgentState 的接口是?Which Java interface persists AgentState?
04Java 中对话记忆的抽象接口是?What is Java's memory abstraction?
05Java 提供的内存版记忆实现是?Which Java class is the in-memory memory implementation?
06跨会话的长期记忆接口是?Which interface represents cross-session long-term memory?
07多个实例并发写同一会话时,Java 可能抛出?What may Java throw when multiple instances write the same session concurrently?
08会话隔离键应该由什么组成?What should the session isolation key consist of?
09Python 中工具执行附带的缓存与上下文位于?Where does Python keep tool-related cache and context?
10水平扩容 Agent 服务的前提是什么?What is required to scale agent services horizontally?

接着看的生产事故Production incidents to read next

基于官方固定版本源码静态生成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.