> ## 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}/projects/{projectId}/memories/databases/{databaseId}
```

通过 ID 获取数据库记忆。您可以用它读取列表结果中不包含的指引，或在创建、重新加载记忆后轮询它的 `status`。

> [!NOTE]
>
> **所需权限：** 项目上的 `project:dbset_read`

### 路径参数

**workspaceId** `string` *required*

项目所属的工作空间 ID

**projectId** `string` *required*

项目 ID

**databaseId** `string` *required*

数据库记忆 ID

```bash cURL theme={null}
curl -X GET 'https://app.memorylake.cn/openapi/memorylake/api/v3/workspaces/ws-8001856949ad4f6a5b6226f415ffa877/projects/proj-b93e8d95a8705bcc4ec42a65ba4cc7f8/memories/databases/doc-2e6a9c4f8b1d4a7e9c3b5d8f0a2c4e6b' \
  -H 'Authorization: Bearer sk_xxxxxx'
```

### 响应

**data** `object`

**数据库记忆对象**

**id** `string`

数据库记忆标识符，请把它当作不透明字符串处理。

**name** `string`

显示名称

**instruction** `string`

回答针对这个数据库的问题时遵循的指引：数据的含义、哪些表重要、内部惯例等。未设置时为空字符串。

**status** `string`

处理状态：`pending`、`running`、`okay` 或 `error`。变为 `okay` 后记忆即可使用。

**error** `object`

失败详情。仅当 `status` 为 `error` 且上报了失败原因时返回。

**错误详情**

**code** `string`

错误码

**msg** `string`

错误信息

**project\_id** `string`

记忆所属项目的 ID

**db\_datasource\_id** `string`

该记忆读取的数据源

**analysis\_model\_id** `string`

该记忆从中获取知识的分析模型。未绑定时不返回该字段。

**created\_at** `string`

创建时间戳

```json Success (200) theme={null}
{
  "success": true,
  "data": {
    "id": "doc-2e6a9c4f8b1d4a7e9c3b5d8f0a2c4e6b",
    "name": "Sales database",
    "instruction": "All amounts are in US dollars. Answer revenue questions from sales.orders.total_amount and treat created_at as UTC.",
    "status": "okay",
    "project_id": "proj-b93e8d95a8705bcc4ec42a65ba4cc7f8",
    "db_datasource_id": "dbds-4b8e2f6a1c9d4e7b8a3f5c2d6e9b1a7c",
    "analysis_model_id": "am-9d3f7b1e5a2c4d8f6b0e3a7c9d1f5b2e",
    "created_at": "2026-09-21T09:03:17.482Z"
  }
}
```


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