Files
myWiki/concepts/search-and-load.md

67 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "Search and Load — 精选工具加载"
created: 2026-06-19
updated: 2026-06-19
type: concept
tags: [tool-selection, search-and-load, dynamic-react, meta-tools]
sources:
- https://arxiv.org/abs/2509.20386
---
# Search and Load 架构
## 定义
Search and Load 是 Dynamic ReAct 五架构实验中的**最优方案**——两阶段search→load两次额外 LLM 调用LLM 精选后通常加载不到 5 个工具。相比全量注入,工具加载减少 50%。
## 工作流
```
用户查询
LLM 构造原子化搜索查询(可多个)
│ 例: ["retrieve Twitter mentions and DMs", "create Google Sheets spreadsheet"]
search_tools(queries, k1=20, k2=5)
├── 每 query 检索 k1=20 候选
├── 跨 query 去重
└── 每应用上限 k2=5
LLM 分析候选列表 → 精选 < 5 个工具
load_tools([精选ID列表]) → 工具绑定到 LLM
ReAct Agent 执行(仅加载精选工具)
```
## 为什么比前三架构好
| 架构 | 问题 |
|------|------|
| Direct Semantic Search | 噪声严重,跨域失效,需要大 k |
| Meta-Tool Query Construction | 仍需大 k无精选步骤 |
| Application-Aware | 额外 search_apps 调用收益有限 |
Search and Load 的差异化:
- **多查询合并**:一次调用覆盖多领域
- **去重+上限**k1=20→k2=5 压缩候选
- **精选加载**LLM 从候选中选择,而非全加载
## 与 MCP-Zero 的对比
| | Search and Load | [[active-tool-discovery|MCP-Zero 主动发现]] |
|---|---|---|
| 触发 | LLM 构造搜索查询 | LLM 生成结构化 tool request |
| 匹配 | 向量语义搜索 | 层次路由server→tool |
| 加载 | LLM 手动精选 | 自动 top-k 注入 |
## 参考
- [[dynamic-react|Dynamic ReAct]]
- [[meta-tools|Meta Tools]]
- [[gaurav-dynamic-react-2025|论文]]