20260625:很多新内容
This commit is contained in:
@@ -1,32 +1,44 @@
|
||||
---
|
||||
title: "ToolRegistry"
|
||||
created: 2026-05-11
|
||||
updated: 2026-05-11
|
||||
title: "工具注册表 — Tool Registry"
|
||||
created: 2026-06-19
|
||||
updated: 2026-06-19
|
||||
type: concept
|
||||
tags: [agent-architecture, tool-design, api]
|
||||
sources: [[prompt-caching-architecture]]
|
||||
tags: [tool-registry, mcp, tool-management, dynamic-react]
|
||||
sources:
|
||||
- https://arxiv.org/abs/2509.20386
|
||||
---
|
||||
|
||||
# ToolRegistry
|
||||
# 工具注册表(Tool Registry)
|
||||
|
||||
## 定义
|
||||
|
||||
ToolRegistry 是 [[stub-pattern|Stub 模式]] 中的核心组件,提供统一的工具调用接口。Agent 通过 ToolRegistry 间接调用具体工具,而非直接与工具定义交互。
|
||||
Tool Registry 是 Dynamic ReAct 框架中**包含全部可用 MCP 工具的综合仓库**。每个条目包含针对语义搜索优化的描述,可能来自第三方。
|
||||
|
||||
## 工作流程
|
||||
## 关键特性
|
||||
|
||||
1. Agent 决策:调用 `ToolRegistry.invoke("fetch_factor_data", {ticker: "AAPL", time_range: "1d"})`
|
||||
2. ToolRegistry 解析工具标识符,查找对应实现
|
||||
3. 动态加载/执行具体逻辑,返回结果
|
||||
4. 对 Agent 而言,ToolRegistry 的定义在会话中**从未改变**
|
||||
- **可来自第三方**:架构假设 LLM Client 和 Tool Registry 可能不在开发者控制范围内
|
||||
- **支持大规模**:通过向量数据库索引,支持对数级别扩展
|
||||
- **描述优化空间**:工具描述质量直接影响检索准确率——这是开发者可控制的主要杠杆
|
||||
|
||||
## 工程价值
|
||||
## 描述优化策略
|
||||
|
||||
- 隔离工具定义变更对缓存的影响
|
||||
- 支持运行时动态注册/卸载工具(对缓存透明)
|
||||
- 统一错误处理和日志记录入口
|
||||
Dynamic ReAct 的实验表明,**上下文增强**([[context-enriched-embeddings|Sonnet 生成隐式功能和用例]])比换 embedding 模型更有效:
|
||||
|
||||
## 相关概念
|
||||
- 换模型(text-embedding-3-large → voyage-context-3):+8pp Top-5
|
||||
- 换模型 + 描述增强:**+20pp Top-5**(40%→60%)
|
||||
|
||||
- [[stub-pattern|Stub 模式]]
|
||||
- [[prompt-caching|Prompt Caching]]
|
||||
## 与其他组件的关系
|
||||
|
||||
```
|
||||
Tool Registry → Vector Database (索引)
|
||||
↓
|
||||
search_tools (meta-tool 检索)
|
||||
↓
|
||||
load_tools (LLM 精选加载)
|
||||
```
|
||||
|
||||
## 参考
|
||||
|
||||
- [[dynamic-react|Dynamic ReAct]]
|
||||
- [[context-enriched-embeddings|上下文增强嵌入]]
|
||||
- [[gaurav-dynamic-react-2025|论文]]
|
||||
|
||||
Reference in New Issue
Block a user