MemorySearchTool
public class MemorySearchTool
源码Source
io/agentscope/harness/agent/tool/MemorySearchTool.java:35–90记忆搜索工具,封装可被智能体调用的能力。位于 io.agentscope.harness.agent.tool 包。核心成员包括 memorySearch、MemorySearchTool。
Tool for searching through persisted memories (MEMORY.md and memory/*.md files).
Uses keyword-based search through all memory files visible via the configured
io.agentscope.harness.agent.filesystem.AbstractFilesystem (works across Local,
Sandbox, and Store stores).
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public MemorySearchTool(WorkspaceManager workspaceManager) | 初始化 `MemorySearchTool` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String memorySearch(RuntimeContext runtimeContext, String query) | 执行记忆搜索相关操作。 Performs the memory search operation. |
构造器详情Constructor Detail
MemorySearchTool
public MemorySearchTool(WorkspaceManager workspaceManager)
初始化 MemorySearchTool 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspaceManager | WorkspaceManager | 工作区管理器(类型 `WorkspaceManager`)。The workspace manager. |
源码Source
io/agentscope/harness/agent/tool/MemorySearchTool.java:41–43方法详情Method Detail
memorySearch
public String memorySearch(RuntimeContext runtimeContext, String query)
执行记忆搜索相关操作。
Performs the memory search operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The runtime context. |
query | String | 查询文本(类型 `String`)。The query. |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/harness/agent/tool/MemorySearchTool.java:45–62