memory_store_insight
Capture, analyze, and retrieve context from memory storage within the meMCP server to enhance LLM performance and enable continuous learning across sessions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The core handler function for the memory_store_insight tool. It extracts and validates input arguments, constructs a fact object, stores it using this.factStore.storeFact, computes a quality score using this.qualityScorer.calculateQualityScore, and returns a formatted success or error response.async handleStoreInsight(args) { try { const { content, type, domain, tags = [], context = {} } = args; if (!content || content.trim().length === 0) { throw new Error('Content is required and cannot be empty'); } const fact = { content: content.trim(), type, domain, tags, context, metadata: { source: 'manual_input', addedAt: new Date().toISOString(), }, }; const storedFact = await this.factStore.storeFact(fact); const qualityResult = this.qualityScorer.calculateQualityScore(storedFact); return { content: [ { type: 'text', text: `✅ Insight stored successfully!\n\n**ID:** ${storedFact.id}\n**Type:** ${storedFact.type}\n**Quality Score:** ${qualityResult.totalScore}/100\n**Domain:** ${storedFact.domain || 'general'}\n\n**Content:** ${storedFact.content}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error storing insight: ${error.message}`, }, ], isError: true, }; } }
- JSON schema defining the input parameters for the memory_store_insight tool: content (required string), type (enum of fact types), domain (string), tags (array of strings), context (object).{ type: 'object', properties: { content: { type: 'string', description: 'The insight or knowledge content to store', }, type: { type: 'string', description: 'The type of fact (verified_pattern, anti_pattern, optimization, etc.)', enum: [ 'verified_pattern', 'anti_pattern', 'optimization', 'discovery', 'constraint', 'debugging_solution', 'tool_configuration', 'decision_rationale', 'experimental_approach', 'workflow_improvement', 'security_concern', ], }, domain: { type: 'string', description: 'The domain or area this applies to (e.g., web_development, data_science)', }, tags: { type: 'array', items: { type: 'string' }, description: 'Tags to categorize this insight', }, context: { type: 'object', description: 'Additional context about the technology, framework, or situation', }, }, required: ['content'], },
- src/tools/modules/MemoryOperations.js:15-63 (registration)Registers the 'memory_store_insight' tool using server.registerTool, providing the tool name, description, input schema, and an async handler that delegates to the handleStoreInsight method.registerStoreInsightTool(server) { server.registerTool( 'memory_store_insight', 'Store a new insight, pattern, or piece of knowledge in the memory system', { type: 'object', properties: { content: { type: 'string', description: 'The insight or knowledge content to store', }, type: { type: 'string', description: 'The type of fact (verified_pattern, anti_pattern, optimization, etc.)', enum: [ 'verified_pattern', 'anti_pattern', 'optimization', 'discovery', 'constraint', 'debugging_solution', 'tool_configuration', 'decision_rationale', 'experimental_approach', 'workflow_improvement', 'security_concern', ], }, domain: { type: 'string', description: 'The domain or area this applies to (e.g., web_development, data_science)', }, tags: { type: 'array', items: { type: 'string' }, description: 'Tags to categorize this insight', }, context: { type: 'object', description: 'Additional context about the technology, framework, or situation', }, }, required: ['content'], }, async (args) => { return await this.handleStoreInsight(args); } ); }