Built on Node.js for persistent memory management, allowing AI systems to store, index, and retrieve facts across sessions with semantic search capabilities.
Provides persistent memory for React-specific knowledge, storing insights about React patterns, hooks, and performance optimizations that can be queried and retrieved during development discussions.
meMCP - Memory-Enhanced Model Context Protocol
A persistent memory system for Large Language Models (LLMs) that enables continuous learning and knowledge retention across sessions through the Model Context Protocol (MCP).
Overview
meMCP (Memory-Enhanced Model Context Protocol) is a sophisticated memory management system designed to give LLMs persistent, searchable memory capabilities. Unlike traditional stateless LLM interactions, meMCP allows AI assistants to build cumulative knowledge over time, remember insights from previous conversations, and provide increasingly intelligent responses based on accumulated experience.
Key Features
Persistent Memory
Facts and insights stored permanently across sessions
Automatic loading of historical knowledge on startup
Robust JSON-based storage with corruption prevention
Atomic write operations to prevent data loss
Semantic Search
TF-IDF based semantic indexing for intelligent fact retrieval
Cosine similarity scoring for relevance ranking
Cross-session search capabilities
Keyword extraction and document similarity analysis
Quality Assessment
Multi-dimensional quality scoring system (novelty, generalizability, specificity, validation, impact)
Configurable scoring weights and thresholds
Automatic fact classification and prioritization
Quality-based cleanup and retention policies
Streaming Support
Efficient handling of large result sets through chunked streaming
Pause/resume/cancel operations for long-running queries
Progress tracking and estimated completion times
Configurable chunk sizes for optimal performance
Modular Architecture
Separate modules for operations, queries, streaming, and management
Clean separation of concerns for maintainability
Backward compatibility with existing integrations
Easy extension and customization
Architecture
Core Components
SequentialGraphitiIntegration: Main orchestrator that initializes and coordinates all system components.
FactStore: Central storage manager handling fact persistence, indexing, and retrieval with semantic search capabilities.
MemoryTools: Modular MCP tool registration system with four specialized modules:
MemoryOperations: CRUD operations for facts
MemoryQueryHandler: Search and retrieval functionality
MemoryStreamingTools: Large dataset streaming capabilities
MemoryManagement: Cleanup, backup, and maintenance operations
SemanticIndex: TF-IDF based search engine providing intelligent fact discovery and similarity matching.
FileManager: Robust file I/O system with atomic writes, corruption detection, and automatic recovery.
ConfigurationManager: Flexible configuration system for customizing fact types, scoring weights, and system behavior.
HookManager: Event-driven system for capturing user interactions and processing sequential thinking data.
Data Flow
Input Processing: User interactions and insights are captured via hooks or direct tool calls
Quality Assessment: Multi-dimensional scoring evaluates the value and relevance of new information
Storage: Facts are atomically written to JSON files with semantic indexing
Retrieval: Semantic search finds relevant facts across all sessions with relevance scoring
Streaming: Large result sets are delivered in configurable chunks for optimal performance
Storage Structure
Installation
Prerequisites
Node.js 18+
npm or yarn package manager
Setup
Clone the repository:
Install dependencies:
Initialize the system:
The system will automatically create the necessary directory structure and configuration files on first run.
MCP Integration
Add to your MCP configuration file (typically mcp_config.json
):
Usage
Basic Operations
Store an insight:
Search for facts:
Stream large result sets:
MCP Tools
The system provides comprehensive MCP tools for integration with AI assistants:
memory_store_insight
: Store new knowledgememory_query
: Search existing factsmemory_update_fact
: Modify existing factsmemory_delete_fact
: Remove factsmemory_get_stats
: System statisticsmemory_get_related
: Find related factsmemory_bulk_process
: Process multiple insightsmemory_cleanup
: Maintenance operationsmemory_stream_query
: Start streaming querymemory_stream_next
: Get next chunkmemory_stream_status
: Check stream statusmemory_stream_cancel
: Cancel stream
Configuration
Fact Types: Define custom fact types with priorities and scoring multipliers:
Scoring Weights: Customize quality assessment dimensions:
System Settings: Adjust operational parameters:
Slash Commands
The system provides convenient slash commands for interactive use:
/memconfig
: Open configuration interface/remember <insight>
: Store new knowledge/recall <query>
: Search for facts/insights
: View recent high-quality insights
Testing
Run the comprehensive test suite:
Performance Characteristics
Storage
Fact Storage: Individual JSON files for atomic operations
Indexing: In-memory indexes with periodic persistence
Search: TF-IDF semantic search with cosine similarity
Corruption Handling: Automatic detection and recovery
Scalability
Facts: Tested with 1000+ facts
Search: Sub-second response times for typical queries
Streaming: Configurable chunk sizes for large datasets
Memory: Efficient in-memory indexing with lazy loading
Reliability
Atomic Writes: Prevents data corruption during writes
Backup System: Automatic backups with configurable retention
Error Recovery: Graceful handling of corrupted files
Data Validation: JSON schema validation for all stored data
Development
Project Structure
Adding New Features
New Fact Types: Add to
config/fact-types.json
Custom Scoring: Implement in
src/processing/QualityScorer.js
Search Enhancements: Extend
src/indexing/SemanticIndex.js
New Tools: Add to appropriate module in
src/tools/modules/
Contributing
Fork the repository
Create a feature branch
Add tests for new functionality
Ensure all tests pass
Submit a pull request
Troubleshooting
Common Issues
Storage directory not found: The system automatically creates directories on first run. Ensure write permissions to the home directory.
Corrupted JSON files: The system includes automatic corruption detection and repair. Corrupted files are quarantined and restored from backups when possible.
Memory usage: For large fact collections, consider adjusting max_facts_per_session
and enabling periodic cleanup.
Search performance: Semantic indexing is rebuilt on startup. For large datasets, consider implementing incremental indexing.
Debug Mode
Enable debug mode in configuration for detailed logging:
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Built on the Model Context Protocol (MCP) specification
Uses TF-IDF for semantic search implementation
Inspired by Sequential-Graphiti memory architecture
Designed for integration with Claude and other LLM systems
Tools
A persistent memory system for Large Language Models (LLMs) that enables continuous learning and knowledge retention across sessions through the Model Context Protocol (MCP).
Related MCP Servers
- -securityFlicense-qualityAn MCP server that allows Claude and other LLMs to manage persistent memories across conversations through text file storage, enabling commands to add, search, delete and list memory entries.Last updated -377
- AsecurityAlicenseAqualityA high-performance, persistent memory system for the Model Context Protocol (MCP) providing vector search capabilities and efficient knowledge storage using libSQL as the backing store.Last updated -624617MIT License
- -securityAlicense-qualityA high-performance Model Context Protocol (MCP) server designed for large language models, enabling real-time communication between AI models and applications with support for session management and intelligent tool registration.Last updated -2MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides knowledge graph-based persistent memory for LLMs, allowing them to store, retrieve, and reason about information across multiple conversations and sessions.Last updated -952,5552MIT License