> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/convai-playground/character-customization/knowledge-bank.md).

# 知识库

## 简介

该 **知识库** 这是您存储和管理您的 AI 角色在对话中可访问的信息的地方。通过上传文档或直接添加文本，您可以为角色提供特定领域知识，使其能够给出更准确、更相关、且更具上下文感知的回复。

上传到知识库的所有文件都与您的 Convai 账号关联，并且可以连接到您的任何角色。这使其成为训练角色以公司特定、产品特定或主题特定信息进行回应的重要工具。

<figure><img src="/files/429e28c24aedf70c54df929e21a2450a3ffeffe0" alt=""><figcaption></figcaption></figure>

***

## 知识库部分

### 1. 我的文档

* 显示上传到您账户的所有文件。
* 显示的信息：
  * **名称** – 文件名。
  * **大小** – 文件大小。
  * **Status** – 指示文件是否可用。
*

```
<figure><img src="../../.gitbook/assets/convai-action-dispatcher-batch-policy-dropdown.png" alt=""><figcaption></figcaption></figure>
```

* 可用操作：
  * **连接** – 将文件附加到角色。
  * **断开连接** – 将文件从角色中移除。
  * **编辑** – 修改文件内容。
  * **下载** – 将文件保存到本地。
  * **删除** – 永久删除文件。

<figure><img src="/files/8c80e985f820e283db085b730b35a2df181492e8" alt=""><figcaption></figcaption></figure>

***

### 2. 上传知识

* 上传 `.txt` 您电脑中的文件。
* 目前， **仅 `.txt` 文件格式** 受支持。
* 上传后，文件会存储在您账户的知识库中，可供任何角色使用。

<figure><img src="/files/ced24b48bb411a736cfee10dc787861369bf1a00" alt=""><figcaption></figcaption></figure>

***

### 3. 添加知识

* 通过在编辑器中直接输入 **纯文本** 来创建新文件。
* 为文件命名，并将其保存为 `.txt` 格式。

<figure><img src="/files/9b8dce72a12d408cf75be65720438c796d664637" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
在学习阶段请经常重启页面，以检查文件状态是否为“可用”。
{% endhint %}

***

## 在你的角色中使用知识库

### 示例

我们上传了一个名为 **Employee Onboarding Guide.txt** 的文件，内容如下：

```
本文件为新员工提供分步骤指导。
在入职后的前 3 天内完成全部人力资源文档。
参加强制性的入职培训会。
通过 IT 支持设置公司邮箱和访问凭据。
阅读行为准则和数据隐私政策。
```

<figure><img src="/files/fb11d415355e1d7b4cf3c4d63123345c4257a8f7" alt=""><figcaption></figcaption></figure>

### 不连接文件进行测试

* 打开 **聊天框**.
* 提问： *“我是新员工。入职第一周我应该做什么？”*
* 结果：角色使用其通用个性和 AI 模型知识进行回应，而不是使用上传的文件。

<figure><img src="/files/ef984c1c344df23dd04aba46cdf51838e09d5799" alt=""><figcaption></figcaption></figure>

### 通过连接文件进行测试

* 前往 **知识库** → **我的文档**.
* 单击 **连接** 在该文件上。
* 在聊天框中，点击 **重置聊天** （左上角）以开始新会话。
* 再次提出同样的问题。

**结果：** 这一次，角色的回应基于 **Employee Onboarding Guide** 文件。

<figure><img src="/files/644a727d2536bd96f1f0868d95026df379a4f9cb" alt=""><figcaption></figcaption></figure>

***

{% hint style="info" %}
始终 **重置聊天会话** ，以便使用最新数据。
{% endhint %}

{% hint style="info" %}
该 **上传文件的总存储大小** 取决于您的 Convai 订阅计划。请参阅 [**定价**](https://convai.com/pricing) 页面了解限制。
{% endhint %}

***

## 结论

知识库是为您的角色提供精确且可靠信息的强大方式。通过连接特定领域的文档，您可以确保您的 AI 不仅具备个性，还具备以准确性和权威性回答问题的专业知识。


---

# 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:

```
GET https://docs.convai.com/api-docs/zh/convai-playground/character-customization/knowledge-bank.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
