> ## Documentation Index
> Fetch the complete documentation index at: https://oma-codex-339-workspace-permissions.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 列出记忆版本

> 通过 OMA API 列出记忆版本。

<Info>每个请求都必须发送 `?beta=true`。</Info>


## OpenAPI

````yaml /openapi/oma.zh.json get /v1/memory_stores/{memory_store_id}/memory_versions
openapi: 3.1.0
info:
  title: OMA API 参考
  version: 1.0.0
  description: Open Managed Agents 应用 API 参考。
servers:
  - url: http://localhost:38080
    description: 本地 OMA 服务器
security:
  - omaApiKey: []
  - omaBearer: []
paths:
  /v1/memory_stores/{memory_store_id}/memory_versions:
    get:
      summary: 列出记忆版本
      operationId: BetaListMemoryVersions
      parameters:
        - name: beta
          in: query
          required: true
          description: 为此接口启用 Beta API 合同，必须为 `true`。
          schema:
            type: boolean
            enum:
              - true
        - name: anthropic-version
          in: header
          required: false
          schema:
            type: string
        - name: anthropic-beta
          in: header
          required: false
          schema:
            type: string
            items:
              type: string
            x-stainless-override-schema:
              x-stainless-param: betas
              x-stainless-extend-default: true
              type: array
              description: 用于指定一个或多个 Beta 版本的可选请求头。
              items:
                $ref: '#/components/schemas/AnthropicBeta'
            x-default: agent-memory-2026-07-22
        - name: memory_store_id
          in: path
          required: true
          schema:
            type: string
          description: 记忆存储标识符。
        - name: memory_id
          in: query
          required: false
          schema:
            type: string
          description: memory_id 的查询参数
        - name: session_id
          in: query
          required: false
          schema:
            type: string
          description: session_id 的查询参数
        - name: api_key_id
          in: query
          required: false
          schema:
            type: string
          description: api_key_id 的查询参数
        - name: operation
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/BetaManagedAgentsMemoryVersionOperation'
          description: operation 的查询参数
        - name: created_at[gte]
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/BetaTimestamp'
          description: 返回在此时间或之后创建的版本（含该时间）。
        - name: created_at[lte]
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/BetaTimestamp'
          description: 返回在此时间或之前创建的版本（含该时间点）。
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            format: int32
          description: 单页返回数量上限。
        - name: page
          in: query
          required: false
          schema:
            type: string
          description: 用于继续分页的游标。
        - name: view
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/BetaManagedAgentsMemoryView'
          description: view 的查询参数
      responses:
        '200':
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsListMemoryVersionsResult'
        '400':
          description: Invalid argument - 客户端指定了无效的参数
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsErrorResponse'
        '401':
          description: 未认证 - 请求没有有效的认证凭据
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsErrorResponse'
        '403':
          description: 权限被拒绝 - 调用方没有执行指定操作的权限
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsErrorResponse'
        '404':
          description: 未找到 - 请求的某个实体不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsErrorResponse'
        '408':
          description: 超出截止时间 - 截止时间在操作完成之前已过期
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsErrorResponse'
        '409':
          description: 自定义错误状态
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsErrorResponse'
        '412':
          description: 前置条件不满足 - 由于系统未处于所需状态，操作被拒绝
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsErrorResponse'
        '413':
          description: Out of range - 尝试的操作超出了有效范围
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsErrorResponse'
        '429':
          description: 资源耗尽 - 某些资源已被耗尽（限流）
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsErrorResponse'
        '431':
          description: 请求头字段过大 - 请求元数据过大
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsErrorResponse'
        '499':
          description: Cancelled - 操作已被客户端取消
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsErrorResponse'
        '500':
          description: Internal - 内部服务器错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsErrorResponse'
        '501':
          description: 未实现 - 该操作未实现或不受支持
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsErrorResponse'
        '503':
          description: 不可用 - 服务当前不可用
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsErrorResponse'
        '504':
          description: 超时 - 上游服务未及时响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsErrorResponse'
components:
  schemas:
    BetaManagedAgentsMemoryVersionOperation:
      type: string
      description: '`memory_version` 所记录的变更类型。对记忆的每一次非空操作变更都会恰好追加一行带有这些值之一的版本记录。'
      enum:
        - created
        - modified
        - deleted
    BetaTimestamp:
      description: RFC 3339 格式的时间戳
      type: string
      format: date-time
    BetaManagedAgentsMemoryView:
      type: string
      description: >-
        选择服务器返回 `memory` 或 `memory_version` 的哪种投影。`basic` 返回 `content` 置为 `null`
        的对象；`full` 会填充 `content`。省略时默认值因端点而异：检索操作默认为 `full`；列表、创建和更新操作默认为
        `basic`。使用 `view=full` 进行列表查询时，`limit` 上限为 20。
      enum:
        - basic
        - full
    BetaManagedAgentsListMemoryVersionsResult:
      description: 列出记忆版本的响应负载。
      type: object
      additionalProperties: false
      properties:
        data:
          description: >-
            一页 `memory_version` 对象，按 `created_at` 降序排列（最新在前），`created_at` 相同时按
            `id` 排序。
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsMemoryVersion'
        next_page:
          description: 下一页的不透明游标（`page_...` 值），没有更多结果时为 `null`。在下一次请求中作为 `page` 传入。
          type: string
          nullable: true
    BetaManagedAgentsErrorResponse:
      type: object
      required:
        - type
        - error
      properties:
        type:
          type: string
          enum:
            - error
          description: 错误响应始终为 "error"
        error:
          $ref: '#/components/schemas/BetaManagedAgentsError'
    BetaManagedAgentsMemoryVersion:
      description: >-
        `memory_version`
        对象：记忆只追加历史中的一条不可变、带归因的记录。对记忆的每一次非无操作变更都会产生一个新版本。版本属于存储（而非单个记忆），并在记忆删除后继续保留。检索被脱敏的版本会返回
        200，且 `content`、`path`、`content_size_bytes` 和 `content_sha256` 均置为
        `null`；请根据 `redacted_at` 分支判断，而不是 HTTP 状态码。
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - memory_store_id
        - memory_id
        - operation
        - created_at
      properties:
        type:
          type: string
          enum:
            - memory_version
        id:
          description: 此版本的唯一标识符（`memver_...` 值）。
          type: string
        memory_store_id:
          description: 该版本所属的记忆存储的 ID（`memstore_...` 格式的值）。
          type: string
        memory_id:
          description: >-
            该版本所快照的记忆的 ID（`mem_...` 值）。在该记忆被删除后仍然有效；将其作为 `memory_id`
            传给列出记忆版本，即可检索完整的谱系，包括 `deleted` 行。
          type: string
        path:
          description: 此次写入时该记忆的路径。当且仅当设置了 `redacted_at` 时为 `null`。
          type: string
          nullable: true
        operation:
          description: 该版本记录的变更类型：`created`、`modified` 或 `deleted`。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsMemoryVersionOperation'
        content:
          description: >-
            该记忆在此版本时的 UTF-8 文本内容。`view=basic`、`operation` 为 `deleted` 或已设置
            `redacted_at` 时为 `null`。
          type: string
          nullable: true
        content_size_bytes:
          description: >-
            此版本时 `content` 的字节大小。设置了 `redacted_at` 或 `operation` 为 `deleted` 时为
            `null`。其他情况下无论 `view` 如何均会填充。
          type: integer
          format: int32
          nullable: true
        content_sha256:
          description: >-
            该版本 `content` 的小写十六进制 SHA-256 摘要（64 个字符）。当设置了 `redacted_at` 或
            `operation` 为 `deleted` 时为 `null`。其他情况下无论 `view` 为何都会填充。
          type: string
          nullable: true
        created_by:
          description: >-
            执行本次写入的主体：`session_actor`、`api_actor` 或
            `user_actor`。在写入时记录，并在脱敏处理后保留。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsActor'
        created_at:
          description: 此版本的写入时间，采用 RFC 3339 格式。
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
        redacted_at:
          description: >-
            该版本被脱敏的时间，采用 RFC 3339 格式；未被脱敏时为
            `null`。设置后，`content`、`path`、`content_size_bytes` 和 `content_sha256`
            均为 `null`。参见脱敏记忆版本。
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          nullable: true
        redacted_by:
          description: >-
            对此版本执行编辑的主体，未编辑时为 `null`。实践中始终为 `api_actor` 或
            `user_actor`（智能体不具备编辑能力）。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsActor'
    BetaManagedAgentsError:
      discriminator:
        propertyName: type
        mapping:
          invalid_request_error:
            $ref: '#/components/schemas/BetaInvalidRequestError'
          authentication_error:
            $ref: '#/components/schemas/BetaAuthenticationError'
          billing_error:
            $ref: '#/components/schemas/BetaBillingError'
          permission_error:
            $ref: '#/components/schemas/BetaPermissionError'
          not_found_error:
            $ref: '#/components/schemas/BetaNotFoundError'
          rate_limit_error:
            $ref: '#/components/schemas/BetaRateLimitError'
          timeout_error:
            $ref: '#/components/schemas/BetaGatewayTimeoutError'
          api_error:
            $ref: '#/components/schemas/BetaAPIError'
          overloaded_error:
            $ref: '#/components/schemas/BetaOverloadedError'
          memory_precondition_failed_error:
            $ref: >-
              #/components/schemas/BetaManagedAgentsMemoryPreconditionFailedError
          memory_path_conflict_error:
            $ref: '#/components/schemas/BetaManagedAgentsMemoryPathConflictError'
          conflict_error:
            $ref: '#/components/schemas/BetaManagedAgentsConflictError'
      oneOf:
        - $ref: '#/components/schemas/BetaInvalidRequestError'
        - $ref: '#/components/schemas/BetaAuthenticationError'
        - $ref: '#/components/schemas/BetaBillingError'
        - $ref: '#/components/schemas/BetaPermissionError'
        - $ref: '#/components/schemas/BetaNotFoundError'
        - $ref: '#/components/schemas/BetaRateLimitError'
        - $ref: '#/components/schemas/BetaGatewayTimeoutError'
        - $ref: '#/components/schemas/BetaAPIError'
        - $ref: '#/components/schemas/BetaOverloadedError'
        - $ref: '#/components/schemas/BetaManagedAgentsMemoryPreconditionFailedError'
        - $ref: '#/components/schemas/BetaManagedAgentsMemoryPathConflictError'
        - $ref: '#/components/schemas/BetaManagedAgentsConflictError'
    BetaManagedAgentsActor:
      description: >-
        标识执行写入或脱敏（脱敏）操作的人。在写入时记录到 `memory_version` 行上。创建会话的 API
        密钥不会记录在智能体写入中；归因回答的是谁执行了这次写入，而不是谁最终承担责任。会话来源请通过会话 API 另行查询。
      type: object
      discriminator:
        propertyName: type
        mapping:
          session_actor:
            $ref: '#/components/schemas/BetaManagedAgentsSessionActor'
          api_actor:
            $ref: '#/components/schemas/BetaManagedAgentsApiActor'
          user_actor:
            $ref: '#/components/schemas/BetaManagedAgentsUserActor'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsSessionActor'
        - $ref: '#/components/schemas/BetaManagedAgentsApiActor'
        - $ref: '#/components/schemas/BetaManagedAgentsUserActor'
    BetaInvalidRequestError:
      properties:
        message:
          default: Invalid request
          title: 消息
          type: string
        type:
          const: invalid_request_error
          default: invalid_request_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: InvalidRequestError
      type: object
    BetaAuthenticationError:
      properties:
        message:
          default: Authentication error
          title: 消息
          type: string
        type:
          const: authentication_error
          default: authentication_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: AuthenticationError
      type: object
    BetaBillingError:
      properties:
        message:
          default: Billing error
          title: 消息
          type: string
        type:
          const: billing_error
          default: billing_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: BillingError
      type: object
    BetaPermissionError:
      properties:
        message:
          default: Permission denied
          title: 消息
          type: string
        type:
          const: permission_error
          default: permission_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: PermissionError
      type: object
    BetaNotFoundError:
      properties:
        message:
          default: Not found
          title: 消息
          type: string
        type:
          const: not_found_error
          default: not_found_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: NotFoundError
      type: object
    BetaRateLimitError:
      properties:
        message:
          default: Rate limited
          title: 消息
          type: string
        type:
          const: rate_limit_error
          default: rate_limit_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: RateLimitError
      type: object
    BetaGatewayTimeoutError:
      properties:
        message:
          default: Request timeout
          title: 消息
          type: string
        type:
          const: timeout_error
          default: timeout_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: GatewayTimeoutError
      type: object
    BetaAPIError:
      properties:
        message:
          default: Internal server error
          title: 消息
          type: string
        type:
          const: api_error
          default: api_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: APIError
      type: object
    BetaOverloadedError:
      properties:
        message:
          default: Overloaded
          title: 消息
          type: string
        type:
          const: overloaded_error
          default: overloaded_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: OverloadedError
      type: object
    BetaManagedAgentsMemoryPreconditionFailedError:
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - memory_precondition_failed_error
        message:
          type: string
    BetaManagedAgentsMemoryPathConflictError:
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - memory_path_conflict_error
        message:
          type: string
        conflicting_path:
          type: string
        conflicting_memory_id:
          type: string
    BetaManagedAgentsConflictError:
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - conflict_error
        message:
          type: string
    BetaManagedAgentsSessionActor:
      description: 智能体在会话期间通过挂载于 `/mnt/memory/` 的文件系统所进行的写入的归属信息。
      type: object
      additionalProperties: false
      required:
        - type
        - session_id
      properties:
        type:
          type: string
          enum:
            - session_actor
        session_id:
          description: 执行该写入的会话的 ID（`sesn_...` 值）。可通过获取会话查询该会话以了解更多来源信息。
          type: string
          minLength: 1
    BetaManagedAgentsApiActor:
      description: 直接通过公开 API（在任何会话之外）进行的写入的归属信息。
      type: object
      additionalProperties: false
      required:
        - type
        - api_key_id
      properties:
        type:
          type: string
          enum:
            - api_actor
        api_key_id:
          description: 执行写入的 API 密钥的 ID。标识的是 key，而非机密。
          type: string
          minLength: 1
    BetaManagedAgentsUserActor:
      description: 由人类用户通过 OMA 控制台进行的写入的归属信息。
      type: object
      additionalProperties: false
      required:
        - type
        - user_id
      properties:
        type:
          type: string
          enum:
            - user_actor
        user_id:
          description: 执行写入的用户的 ID（`user_...` 值）。
          type: string
          minLength: 1
  securitySchemes:
    omaApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: OMA 工作区 API 密钥。
      x-default: sk-ant-local-default
    omaBearer:
      type: http
      scheme: bearer
      description: 以 Bearer 令牌形式发送的 OMA 工作区 API 密钥。

````