> For the complete documentation index, see [llms.txt](https://docs.rememberizer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rememberizer.ai/zh-cn/kai-fa-zhe-zi-yuan/api-docs/memorize-content-to-rememberizer.md).

# 将内容记忆到 Rememberizer

{% openapi src="/files/MHZeBzqvJFrULa5h2LlV" path="/documents/memorize/" method="post" %}
[rememberizer\_openapi.yml](https://1371168417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gvX7KIUy0DhcQETj8Ux%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=cce1ab0d-330f-4bed-b7da-5635aaf25472)
{% endopenapi %}

## 示例请求

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/documents/memorize/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "重要信息",
    "content": "这是我希望 Rememberizer 记住的重要内容。"
  }'
```

{% hint style="info" %}
将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌。
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const memorizeContent = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/documents/memorize/', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: '重要信息',
      content: '这是我希望 Rememberizer 记住的重要内容。'
    })
  });
  
  if (response.status === 201) {
    console.log("内容成功存储");
  } else {
    console.error("存储内容失败");
    const errorData = await response.json();
    console.error(errorData);
  }
};

memorizeContent();
```

{% hint style="info" %}
将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌。
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def memorize_content():
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN",
        "Content-Type": "application/json"
    }
    
    payload = {
        "name": "重要信息",
        "content": "这是我希望 Rememberizer 记住的重要内容。"
    }
    
    response = requests.post(
        "https://api.rememberizer.ai/api/v1/documents/memorize/",
        headers=headers,
        data=json.dumps(payload)
    )
    
    if response.status_code == 201:
        print("内容成功存储")
    else:
        print(f"存储内容失败: {response.text}")

memorize_content()
```

{% hint style="info" %}
将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌。
{% endhint %}
{% endtab %}
{% endtabs %}

## 请求参数

| 参数      | 类型  | 描述                                |
| ------- | --- | --------------------------------- |
| name    | 字符串 | **必填。** 存储内容的名称。                  |
| content | 字符串 | **必填。** 要存储在 Rememberizer 中的文本内容。 |

## 响应

成功的请求返回一个 201 Created 状态码，且没有响应体。

## 错误响应

| 状态码 | 描述                 |
| --- | ------------------ |
| 400 | 错误请求 - 缺少必填字段或无效参数 |
| 401 | 未授权 - 无效或缺失的身份验证   |
| 500 | 服务器内部错误            |

## 用例

此端点特别适用于：

1. 存储您希望稍后访问的重要笔记或信息
2. 添加通过集成数据源无法获得的内容
3. 手动添加需要可搜索的信息
4. 为访问您的知识库的 LLM 添加上下文信息

存储的内容可以通过搜索端点进行搜索，并可以包含在纪念品中。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.rememberizer.ai/zh-cn/kai-fa-zhe-zi-yuan/api-docs/memorize-content-to-rememberizer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
