> ## 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}/memories
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}/memories:
    get:
      summary: 列出记忆
      operationId: BetaListMemories
      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: path_prefix
          in: query
          required: false
          schema:
            type: string
          description: >-
            可选的路径前缀过滤器。必须以 `/` 结尾（按段对齐），例如 `/notes/`。该值会出现在请求 URL
            中。请勿包含密钥或个人身份信息。
        - name: depth
          in: query
          required: false
          schema:
            type: integer
            format: int32
          description: >-
            `0`（或省略）返回 `path_prefix` 下的所有后代条目（递归）。`1` 仅返回直接子级；更深层的条目会归并为
            `memory_prefix` 条目。`depth=1` 的行为类似 `ls`；省略 `depth` 的行为类似 `find`。
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            format: int32
          description: >-
            每页返回的最大条目数。必须介于 1 和 100 之间。省略时默认为 20。当 `view=full` 时上限为 20。`memory`
            和 `memory_prefix` 条目都计入该限制。
        - name: page
          in: query
          required: false
          schema:
            type: string
          description: 不透明的分页游标（`page_...` 格式的值）。传入上一次响应中的 `next_page` 值以获取下一页；获取第一页时省略。
        - name: view
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/BetaManagedAgentsMemoryView'
          description: >-
            返回每个 `memory` 的哪种投影。默认为 `basic`（省略内容）。`full` 会为每个条目填充 `content`，并将
            `limit` 上限设为 20；可将其作为导出和同步的批量读取路径。
      responses:
        '200':
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsListMemoriesResult'
        '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:
    BetaManagedAgentsMemoryView:
      type: string
      description: >-
        选择服务器返回 `memory` 或 `memory_version` 的哪种投影。`basic` 返回 `content` 置为 `null`
        的对象；`full` 会填充 `content`。省略时默认值因端点而异：检索操作默认为 `full`；列表、创建和更新操作默认为
        `basic`。使用 `view=full` 进行列表查询时，`limit` 上限为 20。
      enum:
        - basic
        - full
    BetaManagedAgentsListMemoriesResult:
      description: 列出记忆的响应负载。
      type: object
      additionalProperties: false
      properties:
        data:
          description: >-
            一页结果。每个条目要么是 `memory` 对象，要么是在设置了 `depth` 时的 `memory_prefix`
            汇总标记。条目按稳定的、由服务端定义的顺序返回。
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsMemoryListItem'
        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'
    BetaManagedAgentsMemoryListItem:
      description: 列出记忆响应中的单个条目：`memory` 对象，或在设置了 `depth` 时为 `memory_prefix` 汇总标记。
      type: object
      discriminator:
        propertyName: type
        mapping:
          memory:
            $ref: '#/components/schemas/BetaManagedAgentsMemory'
          memory_prefix:
            $ref: '#/components/schemas/BetaManagedAgentsMemoryPrefix'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsMemory'
        - $ref: '#/components/schemas/BetaManagedAgentsMemoryPrefix'
    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'
    BetaManagedAgentsMemory:
      description: >-
        `memory` 对象：记忆存储中位于层级路径上的单个文本文档。`view=full` 时填充 `content`
        字段，`view=basic` 时为 `null`；`content_size_bytes` 和 `content_sha256`
        字段始终填充，以便同步客户端无需拉取内容即可比对差异。记忆以其 `mem_...` ID 寻址；路径是创建时的键，可通过更新修改。
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - memory_store_id
        - path
        - content_size_bytes
        - content_sha256
        - memory_version_id
        - created_at
        - updated_at
      properties:
        type:
          type: string
          enum:
            - memory
        id:
          description: 此记忆的唯一标识符（`mem_...` 格式的值）。重命名后保持不变；读取、更新或删除该记忆时应使用此 ID 而非路径。
          type: string
        memory_store_id:
          description: 该记忆所属的记忆存储的 ID（`memstore_...` 格式的值）。
          type: string
        path:
          description: >-
            该记忆在存储内的层级路径，例如 `/projects/foo/notes.md`。始终以 `/`
            开头。路径区分大小写，且在同一存储内唯一。最大 1,024 字节。
          type: string
        content:
          description: >-
            记忆的 UTF-8 文本内容。`view=full` 时填充；`view=basic` 时为 `null`。最大 100
            kB（102,400 字节）。
          type: string
          nullable: true
        content_size_bytes:
          description: '`content` 的字节大小（UTF-8 明文长度）。无论 `view` 为何值，始终填充。'
          type: integer
          format: int32
        content_sha256:
          description: >-
            UTF-8 `content` 字节的小写十六进制 SHA-256 摘要（64
            个字符）。服务端不做任何规范化处理，因此客户端可在本地计算相同的哈希，用于过期检查，并作为更新时 `content_sha256`
            前置条件的值。无论 `view` 如何，此字段始终填充。
          type: string
        memory_version_id:
          description: >-
            表示此记忆当前内容的 `memory_version` 的 ID（`memver_...`
            值）。这是权威的头部指针；`memory_version` 对象不携带 `is_latest`
            标志，因此请改为与此字段比较。可通过列出记忆版本枚举完整历史。
          type: string
        created_at:
          description: 此记忆的创建时间，采用 RFC 3339 格式。
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
        updated_at:
          description: >-
            该记忆最近一次修改的时间，采用 RFC 3339 格式。可将其用作低成本的时效性信号；如需了解是谁做出的修改，请通过列出记忆版本查询
            head 版本的 `created_by`。
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
    BetaManagedAgentsMemoryPrefix:
      description: >-
        当设置了 `depth`
        时，列出记忆返回的汇总目录标记。表示在该前缀下、比请求深度更深的位置存在一个或多个记忆。这是列出时的汇总，不是存储的资源；它没有
        ID，也没有生命周期。每个前缀都计入分页 `limit`，并按路径顺序与 `memory` 条目交错排列。
      type: object
      additionalProperties: false
      required:
        - type
        - path
      properties:
        type:
          type: string
          enum:
            - memory_prefix
        path:
          description: >-
            汇总后的路径前缀，包含末尾的 `/`（例如 `/projects/foo/`）。在后续的列举调用中将该值作为 `path_prefix`
            传入，即可深入该目录。
          type: string
    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
    BetaTimestamp:
      description: RFC 3339 格式的时间戳
      type: string
      format: date-time
  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 密钥。

````