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

# 获取记忆项

> 按 key 从智能体会话中检索单个记忆项，包括其值、元数据与创建时间戳。

当你已知某个已存储记忆项的确切 key，并希望在不进行语义搜索的情况下获取其当前值与元数据时，使用此接口。

## 接口

```http theme={null}
GET /v1/agents/sessions/{session_id}/memory/{key}
```

## 认证

传递 `Authorization: Bearer <api-key>` 或 `Authorization: ApiKey <key>` 之一。

## 路径参数

<ParamField path="session_id" type="string" required>
  智能体会话标识符。
</ParamField>

<ParamField path="key" type="string" required>
  记忆项 key。
</ParamField>

## 响应

<ResponseField name="key" type="string">
  条目 key。
</ResponseField>

<ResponseField name="value" type="string">
  存储的文本值。
</ResponseField>

<ResponseField name="metadata" type="object">
  附加在条目上的任意元数据。
</ResponseField>

<ResponseField name="created_at" type="string">
  条目创建的 ISO 8601 时间戳。
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://agent.example.com/v1/agents/sessions/sess_01J5X8/memory/user_preference_temperature \
    -H "Authorization: Bearer <api-key>"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "key": "user_preference_temperature",
    "value": "User prefers Celsius.",
    "metadata": {"topic": "units"},
    "created_at": "2024-06-01T10:00:00Z"
  }
  ```
</ResponseExample>
