reinforce
Boost memory relevance and reset decay for AI agents by reinforcing topic mentions, automatically upgrading questions to interests after repeated engagement.
Instructions
The user mentioned this topic again — boost its relevance and reset decay clock. After 5 mentions, "question" auto-upgrades to "interest".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Memory ID | |
| content | No | Content to match |
Implementation Reference
- index.js:256-293 (handler)The handler function for the 'reinforce' tool, which updates the mention count, last_reinforced timestamp, and potentially re-categorizes a memory.
function handleReinforce(args) { const { id, content } = args; if (!id && !content) return { error: 'Provide "id" or "content" to reinforce' }; const memories = loadMemories(); let target; if (id) { target = memories.find(m => m.id === id); } else { const c = content.toLowerCase(); target = memories.find(m => m.content.toLowerCase().includes(c)); } if (!target) return { error: 'Memory not found' }; target.mention_count += 1; target.last_reinforced = Date.now(); if (target.mention_count >= 5 && target.category === 'question') { target.category = 'interest'; target.base_weight = CATEGORY_CONFIG['interest'].base_weight; target.decay_halflife_days = CATEGORY_CONFIG['interest'].decay_halflife_days; } saveMemories(memories); const rel = computeRelevance(target); return { id: target.id, content: target.content, mention_count: target.mention_count, category: target.category, relevance: rel.relevance, status: rel.status, message: `Reinforced. Mention #${target.mention_count}. Decay clock reset.` }; } - index.js:408-415 (registration)The MCP tool definition for 'reinforce', including its input schema.
{ name: 'reinforce', description: 'The user mentioned this topic again — boost its relevance and reset decay clock. After 5 mentions, "question" auto-upgrades to "interest".', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Memory ID' }, content: { type: 'string', description: 'Content to match' }