boost_memento_confidence
Increase confidence scores for verified information in the MCP Memento memory system when knowledge is successfully applied or validated.
Instructions
Boost confidence when a memory is successfully used.
Use for:
Reinforcing valid knowledge
Manual confidence increase for verified information
After successfully applying a solution
When verifying old information is still valid
Usage patterns:
After successfully applying a solution → boost its confidence
When verifying old information is still valid → boost confidence
When multiple team members confirm a pattern → boost confidence
Boost mechanics:
Base boost: +0.10 per access (capped at 1.0)
Additional boost for validation: +0.10 to +0.20
Maximum confidence: 1.0 (cannot exceed)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| memory_id | Yes | ID of the memory to boost confidence for. When provided, boosts confidence on all relationships of that memory. Either memory_id or relationship_id must be specified. | |
| relationship_id | No | ID of a specific relationship to boost confidence for. Use this to target a single relationship instead of all relationships of a memory. Either memory_id or relationship_id must be specified. | |
| boost_amount | No | Amount to boost confidence (default: 0.10) | |
| reason | No | Reason for the boost |
Implementation Reference
- The handler logic for 'boost_memento_confidence', which adjusts the confidence of a memory or its associated relationships in the database.
async def handle_boost_memento_confidence( memory_db: SQLiteMemoryDatabase, arguments: Dict[str, Any] ) -> CallToolResult: """Handle boost_confidence tool call. Boost confidence when a memory or relationship is used successfully. Args: memory_db: Database instance for memory operations arguments: Tool arguments from MCP call containing: - memory_id: ID of memory to boost (optional, requires relationship_id if not provided) - relationship_id: ID of relationship to boost (optional, requires memory_id if not provided) - boost_amount: Amount to boost confidence (default: 0.1) - reason: Reason for the boost Returns: CallToolResult with confirmation or error message """ memory_id = arguments.get("memory_id") relationship_id = arguments.get("relationship_id") boost_amount = float(arguments.get("boost_amount", 0.1)) reason = arguments.get("reason", "Successful usage") if not memory_id and not relationship_id: return CallToolResult( content=[ TextContent( type="text", text="Either memory_id or relationship_id must be provided", ) ], isError=True, ) if boost_amount < 0.0 or boost_amount > 0.5: return CallToolResult( content=[ TextContent( type="text", text="Boost amount must be between 0.0 and 0.5", ) ], isError=True, ) if memory_id: # Boost confidence for all relationships of this memory try: # Get memory to check current confidence memory = await memory_db.get_memory_by_id(memory_id) if not memory: return CallToolResult( content=[ TextContent( type="text", text=f"Memory not found: {memory_id}", ) ], isError=True, ) # Calculate new confidence new_confidence = min(1.0, memory.confidence + boost_amount) # Update memory confidence # Note: This requires adding update_memory_confidence method to database # For now, we'll update through relationships # Get relationships for this memory relationships = await memory_db.get_relationships_for_memory(memory_id) for rel in relationships: new_rel_confidence = min(1.0, rel.properties.confidence + boost_amount) await memory_db.adjust_confidence( rel.id, new_rel_confidence, f"Boosted via memory {memory_id}: {reason}", ) if not relationships: message = ( f"Memory '{memory_id}' has no relationships — confidence boost requires " f"at least one relationship. " f"Create one first with `create_memento_relationship`." ) else: message = f"Boosted confidence for {len(relationships)} relationships of memory {memory_id} by {boost_amount:.2f}" except Exception as e: logger.error(f"Failed to boost confidence for memory {memory_id}: {e}") return CallToolResult( content=[ TextContent( type="text", text=f"Failed to boost confidence: {str(e)}", ) ], isError=True, ) else: # relationship_id is provided try: # Get current relationship confidence relationships = await memory_db.get_relationships_for_memory( relationship_id ) if not relationships: return CallToolResult( content=[ TextContent( type="text", text=f"Relationship not found: {relationship_id}", ) ], isError=True, ) # Find the specific relationship rel = next((r for r in relationships if r.id == relationship_id), None) if not rel: return CallToolResult( - The MCP tool definition (schema and description) for 'boost_memento_confidence'.
Tool( name="boost_memento_confidence", description="""Boost confidence when a memory is successfully used. Use for: - Reinforcing valid knowledge - Manual confidence increase for verified information - After successfully applying a solution - When verifying old information is still valid Usage patterns: - After successfully applying a solution → boost its confidence - When verifying old information is still valid → boost confidence - When multiple team members confirm a pattern → boost confidence Boost mechanics: - Base boost: +0.10 per access (capped at 1.0) - Additional boost for validation: +0.10 to +0.20 - Maximum confidence: 1.0 (cannot exceed)""", inputSchema={ "type": "object", "properties": { "memory_id": { "type": "string", "description": ( "ID of the memory to boost confidence for. " "When provided, boosts confidence on all relationships of that memory. " "Either memory_id or relationship_id must be specified." - src/memento/tools/registry.py:73-73 (registration)Registration of the 'boost_memento_confidence' handler within the tools registry.
"boost_memento_confidence": handle_boost_memento_confidence,