search_memories
Search stored memories by content or category using natural language queries. Automatically triggered by phrases like 'find in memories' or 'look for' to retrieve relevant information.
Instructions
IMPORTANT: This tool should be automatically called when users say "찾아", "검색", "기억 중에", "search memory", "find in memories", "look for" or similar keywords. Search memories by content
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | Category to search in | |
| query | Yes | Search query |
Implementation Reference
- src/tools/memory/searchMemories.ts:23-45 (handler)Executes the core logic of the search_memories tool by querying the MemoryManager and formatting results.export async function searchMemoriesHandler(args: { query: string; category?: string }): Promise<ToolResult> { const { query, category: searchCategory } = args; try { const mm = MemoryManager.getInstance(); const results = mm.search(query); const resultList = results.map(m => `• ${m.key} (${m.category}): ${m.value.substring(0, 100)}${m.value.length > 100 ? '...' : ''}` ).join('\n'); return { content: [{ type: 'text', text: `✓ Found ${results.length} matches for "${query}":\n${resultList || 'None'}` }] }; } catch (error) { return { content: [{ type: 'text', text: `✗ Error: ${error instanceof Error ? error.message : 'Unknown error'}` }] }; } }
- Input/output schema and metadata definition for the search_memories tool.export const searchMemoriesDefinition: ToolDefinition = { name: 'search_memories', description: '찾아|검색|기억 중에|search|find|look for - Search memories by content', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query' }, category: { type: 'string', description: 'Category to search in' } }, required: ['query'] }, annotations: { title: 'Search Memories', audience: ['user', 'assistant'] } };
- src/index.ts:169-170 (registration)Registration in the main switch dispatcher for handling CallTool requests for search_memories.case 'search_memories': return await searchMemoriesHandler(args as any) as CallToolResult;
- src/index.ts:77-77 (registration)Inclusion of the tool definition in the tools array for ListTools requests.searchMemoriesDefinition,