Skip to content

记忆系统

概述

Superagent Base 提供三层记忆和四种后端:

层级范围用途
短期记忆Session当前对话上下文
长期记忆User跨 Session 的知识积累
Agent 状态AgentAgent 内部持久状态

配置

yaml
spec:
  memory:
    backend: mem0      # builtin | mem0 | zep | letta
    config:
      session_window: 20
      endpoint: http://mem0-server:8080
      api_key: your-key

后端对比

后端短期长期状态特点
builtinRedis ListRedis HashRedis Hash零依赖,开箱即用
mem0Mem0 APIMem0 搜索Mem0 元数据自动事实抽取,三级范围
zepSession 消息事实搜索Session 元数据企业级长期记忆
lettaAgent 管理Archival MemoryCore Memory自主记忆管理 (MemGPT)

Builtin(默认)

无需额外配置,使用系统自带的 Redis:

yaml
spec:
  memory:
    backend: builtin

Mem0

yaml
spec:
  memory:
    backend: mem0
    config:
      endpoint: http://localhost:8080
      api_key: your-mem0-key

Zep

yaml
spec:
  memory:
    backend: zep
    config:
      endpoint: http://localhost:8000
      api_key: your-zep-key

Letta

yaml
spec:
  memory:
    backend: letta
    config:
      endpoint: http://localhost:8283
      api_key: your-letta-key

Released under the Apache 2.0 License.