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

# Agent 工具

> Agent 工具 — search_knowledge_base 与 parse_resource_file

知识库通过两个 Agent 工具与 DeepAgents 框架集成。当用户在 `invoke()` 请求中传入 `knowledge_base_ids` 时，这些工具自动注册到 Agent 的工具集中。

***

## search\_knowledge\_base

Agent 主动搜索知识库中的相关信息，支持多知识库并行检索、可调节的检索权重。

<ParamField body="query" type="string" required>
  搜索查询（自然语言）
</ParamField>

<ParamField body="knowledge_base_id" type="string">
  指定知识库 ID。不指定则搜索所有已配置的知识库
</ParamField>

<ParamField body="top_k" type="number" default="5">
  返回数量
</ParamField>

<ParamField body="vector_weight" type="number" default="0.6">
  向量搜索权重（0-1）
</ParamField>

<ParamField body="keyword_weight" type="number" default="0.4">
  关键词搜索权重（0-1）
</ParamField>

<ParamField body="use_rerank" type="boolean" default="true">
  是否使用 RRF 重排序。关闭后直接返回向量搜索结果（更快）
</ParamField>

### Agent 调用示例

```python theme={null}
# 搜索所有已配置的知识库
search_knowledge_base("产品使用说明")

# 指定知识库
search_knowledge_base("XYZ-2000 产品规格", knowledge_base_id="kb_123")

# 提高关键词权重（适合精确术语搜索）
search_knowledge_base("getUserInfo 接口参数", keyword_weight=0.7, vector_weight=0.3)

# 快速模式，跳过 RRF 重排序
search_knowledge_base("快速查询", use_rerank=False)
```

***

## parse\_resource\_file

解析用户在 Resource 区上传的文件，支持所有文档格式和图片（通过 Vision API）。

<ParamField body="file_id" type="string" required>
  Resource 文件 ID
</ParamField>

<ParamField body="parse_images" type="boolean" default="true">
  是否使用 Vision API 识别图片内容
</ParamField>

<ParamField body="max_length" type="number" default="5000">
  最大返回文本长度
</ParamField>

### Agent 调用示例

```python theme={null}
# 解析上传的 PDF 文档
parse_resource_file(file_id="res_abc123")

# 解析图片（使用 Vision API）
parse_resource_file(file_id="res_img456", parse_images=True)

# 限制返回长度
parse_resource_file(file_id="res_abc123", max_length=2000)
```
