# 文档文档文档文档

Canonical URL: https://developers.iagenify.com/zh/sdk/agent/tools/document/
Language: zh

`document({ action: "add" | "list" | "remove", path?, storage?, document? })`

索引文档, 这样语义搜索就能找到它。 没有它, 搜索只能找到人类上传的东西 。

Status: read on list, write otherwise · feeds query_storage search · workspace files

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `action` | string | 必填 | `add` · `list` · `remove`. |
| `path` | string |  | 索引的工作空间文件 - a PDF, a , a , a , a DOCX,文本。 |
| `storage` | string |  | 按标签,否则账户违约 |
| `document` | string |  | ID, 发自 `list`. |

## 用途 {#why}

> **关闭环环, 代理无法自己关闭**
>
> query_storage {行动:“搜索”}根据含义找到文件——但只有那些被索引的文件。没有这个工具,代理商可以产生一份报告,而永远无法用它所说的话找到它。

## 双对 {#pair}

```javascript
document({ action: "add", path: "Reports/q3.pdf" })
query_storage({ action: "search", query: "what did we say about churn" })
```

## 费用 {#cost}

上传文件索引并消耗存储空间。 搜索本身是每个呼叫的信用额度 。

## 列表是自由的 {#list}

此类别从动作中计算: 列表是读、 添加和删除的, 由写来 。

- [query_storage](/zh/sdk/agent/tools/query-storage): 搜索此种子 。
- [搜索搜索](/zh/sdk/ref/connected-storage/run/search): 行动本身。
- [智能体工具](/zh/sdk/agent/tools): The 35, by family.

```python
# The calls the model makes:
document = {"action": "add", "path": "Reports/q3.pdf"}
query_storage = {"action": "search", "query": "what did we say about churn"}
```
