> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memorylake.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 列出知识条目

> 列出分析模型中某一类知识，或按相似度检索

```
GET /openapi/memorylake/api/v3/workspaces/{workspaceId}/analysis-models/{modelId}/entries
```

返回分析模型中某一类知识条目的分页列表。如需读取模型的全部知识，请逐个列出其模板接受的每种类型；[列出分析模型模板](https://docs.memorylake.cn/features/memorylake/api-reference/database/analysis-models/list-analysis-model-templates.md)会告诉您有哪些类型。

传入 `keyword` 时，条目改为按相似度排序。检索总会返回最接近的条目，即使其中没有一条真正匹配，因此请用每个条目的 `score` 区分相近和相去甚远的结果。

> [!NOTE]
>
> **所需权限：** `analysis_model:read`

### 路径参数

**workspaceId** `string` *required*

工作空间 ID

**modelId** `string` *required*

分析模型 ID

### 查询参数

**entity\_type** `string` *required*

要列出的知识类型，例如 `general`、`biz_rule`、`few_shot` 或 `drilldown_entity`。模型一次只列出一种类型。

**keyword** `string`

按与该文本的接近程度排序条目，最接近的在前。这是相似度检索，不是过滤：即使文本什么都匹配不上，也会返回最接近的条目，而不是空页，所以不要把非空结果当作命中。已停用的条目不参与检索。

**from** `string`

只返回来自该来源的条目：`MANUAL` 表示手工编写的条目，`BUILD` 表示模型构建时产生的条目

**ids** `array`

只返回这些 ID 的条目。传多个 ID 时请重复该参数。

**page\_size** `integer` (default: 20)

每页返回的条目数量，取值 1 到 100

**continuation\_token** `string`

上一次响应返回的令牌，用于获取下一页。请求第一页时不传。

```bash List theme={null}
curl -X GET 'https://app.memorylake.cn/openapi/memorylake/api/v3/workspaces/ws-8001856949ad4f6a5b6226f415ffa877/analysis-models/am-9d3f7b1e5a2c4d8f6b0e3a7c9d1f5b2e/entries?entity_type=few_shot&page_size=20' \
  -H 'Authorization: Bearer sk_xxxxxx'
```

```bash Search theme={null}
curl -X GET 'https://app.memorylake.cn/openapi/memorylake/api/v3/workspaces/ws-8001856949ad4f6a5b6226f415ffa877/analysis-models/am-9d3f7b1e5a2c4d8f6b0e3a7c9d1f5b2e/entries?entity_type=few_shot&keyword=revenue%20last%20month' \
  -H 'Authorization: Bearer sk_xxxxxx'
```

### 响应

**data** `object`

**知识条目分页列表**

**items** `array`

知识条目对象数组

**知识条目对象**

**id** `string`

知识条目标识符，请把它当作不透明字符串处理。

**entity\_type** `string`

知识类型，例如 `general` 或 `few_shot`。它决定 `payload` 的结构。

**embedding** `string`

条目用于匹配的文本：问题要与它相似，条目才会被使用。对通用知识条目，它只用于命名条目；对业务规则，它可能是根据规则本身推导出来的。

**disabled** `boolean`

条目当前是否被排除在回答之外

**score** `number`

条目与检索时 `keyword` 的接近程度，取值 0 到 1。不在检索中时它不携带任何信息，通常为 0 或不返回，请不要把它当作条目的质量分。

**payload** `object`

条目的内容。结构随 `entity_type` 而定：内容放在 `artifact` 下的具名槽位中，每个槽位都是一个槽位对象。这里没有列出的键按保存时的原样返回。

**general · 通用知识**

**artifact.general** `object`

背景知识本身，通常是纯文本或 Markdown

**biz\_rule · 业务知识**

**artifact.biz\_rule** `object`

规则本身

**source\_spec** `array`

这条规则所属的数据实体，每项带有其匹配文本。只读：它由条目之间的关联推导而来，本 API 不提供设置关联的方式。

**few\_shot · 优化案例**

**artifact.question** `object`

这个案例回答的问题

**artifact.few\_shot** `object`

回答该问题的 SQL

**drilldown\_entity · 业务模型**

**artifact.busi\_caliber** `object`

业务口径：这个指标对业务意味着什么

**artifact.tech\_caliber** `object`

技术口径：这个指标如何计算

**artifact.threshold** `object`

什么样的值对这个指标来说算异常

**artifact.analysis\_hint** `object`

这个指标变动时首先要看什么

**槽位对象**

**type** `string`

`content` 的读取方式：`LIST`、`DICT`、`MARKDOWN`、`TEXT`、`SQL` 或 `FILE`

**desc** `string`

槽位的显示名称，供渲染方使用

**content** `string`

值本身

**extra** `object`

您随条目一起保存的内容，原样返回。没有保存时不返回该字段。

**source\_count** `integer`

指向这个条目的条目数量。列表中可能不返回该字段；[获取知识条目](https://docs.memorylake.cn/features/memorylake/api-reference/database/analysis-models/get-knowledge-entry.md)会返回它。

**target\_count** `integer`

这个条目指向的条目数量。列表中可能不返回该字段；[获取知识条目](https://docs.memorylake.cn/features/memorylake/api-reference/database/analysis-models/get-knowledge-entry.md)会返回它。

**created\_at** `string`

条目的添加时间

**updated\_at** `string`

条目的最后修改时间。停用或恢复也算一次修改。

**continuation\_token** `string`

用于获取下一页结果的令牌。最后一页不返回该字段。

**total** `integer`

所有页中符合条件的条目总数。可能不返回该字段；请用 `continuation_token` 翻页，不要据此计算页数。

```json Success (200) theme={null}
{
  "success": true,
  "data": {
    "items": [
      {
        "id": "5d2e7b9cb31d11f1a7c35e9b2d4f6a81",
        "embedding": "What was total revenue last month?",
        "disabled": false,
        "score": 0.0,
        "payload": {
          "artifact": {
            "question": {
              "type": "TEXT",
              "content": "What was total revenue last month?"
            },
            "few_shot": {
              "type": "SQL",
              "content": "SELECT SUM(total_amount) FROM sales.orders WHERE created_at >= date_trunc('month', now()) - interval '1 month' AND created_at < date_trunc('month', now())"
            }
          }
        },
        "entity_type": "few_shot",
        "created_at": "2026-09-21T09:26:38.417Z",
        "updated_at": "2026-09-21T09:26:38.417Z"
      },
      {
        "id": "7a1c3e5fb31d11f1a7c35e9b2d4f6a81",
        "embedding": "How many orders did each customer place this year?",
        "disabled": false,
        "score": 0.0,
        "payload": {
          "artifact": {
            "question": {
              "type": "TEXT",
              "content": "How many orders did each customer place this year?"
            },
            "few_shot": {
              "type": "SQL",
              "content": "SELECT customer_id, COUNT(*) AS order_count FROM sales.orders WHERE created_at >= date_trunc('year', now()) GROUP BY customer_id"
            }
          }
        },
        "entity_type": "few_shot",
        "created_at": "2026-09-21T09:28:02.751Z",
        "updated_at": "2026-09-21T09:28:02.751Z"
      }
    ]
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.