feat: enable memory search tool

This commit is contained in:
Acbox
2026-02-02 17:37:54 +08:00
parent 3f0a0f8499
commit ab8aa5f4ef
4 changed files with 43 additions and 10 deletions
+7
View File
@@ -8,6 +8,7 @@ import { getWebTools } from './tools/web'
import { subagentSystem } from './prompts/subagent'
import { getSubagentTools } from './tools/subagent'
import { getSkillTools } from './tools/skill'
import { getMemoryTools } from './tools/memory'
export enum AgentAction {
WebSearch = 'web_search',
@@ -15,6 +16,7 @@ export enum AgentAction {
Subagent = 'subagent',
Schedule = 'schedule',
Skill = 'skill',
Memory = 'memory',
}
export interface AgentParams extends BaseModelConfig {
@@ -98,6 +100,11 @@ export const createAgent = (
})
Object.assign(tools, subagentTools)
}
if (allowedActions.includes(AgentAction.Memory)) {
const memoryTools = getMemoryTools({ fetch: fetcher })
Object.assign(tools, memoryTools)
}
return tools
}