| 27 | // --------------------------------------------------------------------------- |
| 28 | |
| 29 | export function getMemoryToolDefinitions(): ToolDef[] { |
| 30 | return [ |
| 31 | { |
| 32 | type: 'function', |
| 33 | function: { |
| 34 | name: 'save_memory', |
| 35 | description: |
| 36 | 'Save an important piece of information about the user to long-term memory. ' + |
| 37 | 'Use this when you learn something significant about the user that should be remembered across conversations. ' + |
| 38 | 'Examples: user preferences, important facts, emotional moments, key events.', |
| 39 | parameters: { |
| 40 | type: 'object', |
| 41 | properties: { |
| 42 | content: { |
| 43 | type: 'string', |
| 44 | description: 'The memory content to save (concise, one key fact per call)', |
| 45 | }, |
| 46 | category: { |
| 47 | type: 'string', |
| 48 | description: |
| 49 | 'Category: "fact" (user facts), "preference" (likes/dislikes), "event" (what happened), "emotion" (emotional moments), "other"', |
| 50 | }, |
| 51 | }, |
| 52 | required: ['content', 'category'], |
| 53 | }, |
| 54 | }, |
| 55 | }, |
| 56 | ]; |
| 57 | } |
| 58 | |
| 59 | export function isMemoryTool(toolName: string): boolean { |
| 60 | return toolName === 'save_memory'; |