High-performance structured memory system with native C++ capabilities and comprehensive Claude integration.
Mnemonic is a monorepo containing multiple packages that work together to provide a robust, scalable memory management system with both JavaScript and C++ implementations.
- @mnemonic/core - Main memory system with domain-driven architecture
- @mnemonic/native - High-performance C++ addon for critical operations
- @mnemonic/cli - Command-line tools for memory management
- @mnemonic/utils - Python utilities for monitoring and maintenance
- @mnemonic/legacy - Legacy MCP server (deprecated)
- Node.js >= 16.0.0
- Python >= 3.8 (for utilities)
- C++ compiler (for native addon)
# Install all dependencies and build native addon
npm run install:all
# Or install step by step
npm install
npm run build:native# Start with C++ engine (recommended for production)
npm run dev
# Start with JavaScript engine only
npm run dev:js
# Start legacy MCP server
npm run dev:legacy# Build all packages
npm run build
# Build native addon only
npm run build:native
# Clean all builds
npm run clean# Run tests for all packages
npm test
# Test specific package
npm test --workspace=packages/mnemonic-core# Lint all packages
npm run lint
# Type check all packages
npm run typecheckCopy .env.example to .env and configure your environment variables:
cp .env.example .envKey configuration options:
MNEMONIC_ENABLE_AUTH- Enable/disable authenticationMNEMONIC_API_KEYS- Comma-separated API keysMEMORY_ENGINE_TYPE- Choose 'C++' or 'JavaScript'MNEMONIC_PORT- Server port (default: 8081)
mnemonic/
├── packages/
│ ├── mnemonic-core/ # Main application
│ ├── mnemonic-native/ # C++ addon
│ ├── mnemonic-cli/ # CLI tools
│ ├── mnemonic-utils/ # Python utilities
│ └── mnemonic-legacy/ # Legacy system
├── infrastructure/ # DevOps configs
│ ├── docker/
│ ├── monitoring/
│ └── deployment/
└── docs/ # Documentation
- Domain Layer - Business logic and entities
- Infrastructure Layer - External services and repositories
- Presentation Layer - API controllers and routers
- Native Layer - C++ performance optimisations
The system exposes RESTful APIs on port 8081 (configurable):
GET /api/v2/memory- Retrieve memory entriesPOST /api/v2/memory- Store memory entriesGET /api/v2/security- Security managementGET /health- Health check endpoint
- Prometheus - Metrics collection
- Grafana - Visualisation dashboards
- Jaeger - Distributed tracing
- Custom SLI/SLO - Performance monitoring
Start monitoring stack:
cd infrastructure/docker
docker-compose up -dAccess dashboards:
- Grafana: http://localhost:3000
- Prometheus: http://localhost:9090
- Jaeger: http://localhost:16686
# Basic memory operations
mnemonic store "key" "value"
mnemonic retrieve "key"
# System management
mnemonic-coach analyse
mnemonic-intercept start
# Shell integration
source packages/mnemonic-cli/shell/mnemonic-shell-integration.sh# Check memory health
cd packages/mnemonic-utils
python scripts/check_memory.py
# Monitor logs
python scripts/monitor_logs.py
# Update memory configurations
python scripts/update_memory.pycd infrastructure/docker
docker-compose -f docker-compose.prod.yml up -dEnsure these environment variables are set in production:
NODE_ENV=productionMNEMONIC_ENABLE_AUTH=trueMNEMONIC_API_KEYS=your-production-keysGRAFANA_ADMIN_PASSWORD=secure-password
- API keys are required in production
- CORS is restricted to allowed origins
- All inputs are validated and sanitised
- Session management includes expiration and role-based access
- C++ Engine: ~50,000 ops/sec
- JavaScript Engine: ~15,000 ops/sec
- Memory Usage: <100MB typical
- Startup Time: <2 seconds
- Use C++ engine for production workloads
- Configure appropriate
NODE_OPTIONSfor memory - Enable connection pooling for high-traffic scenarios
- Monitor via Prometheus metrics
- Fork the repository
- Create a feature branch
- Make changes with tests
- Ensure linting passes
- Submit a pull request
- Follow NZ English spelling conventions
- Include comprehensive tests
- Document public APIs
- Maintain backwards compatibility
Native addon build fails:
# Install build tools
npm install -g node-gyp
# Rebuild
npm run build:nativePermission errors:
# Check file permissions
ls -la packages/
# Fix if needed
chmod -R 755 packages/Port conflicts:
# Change port in .env
MNEMONIC_PORT=8082- Issues: https://github.com/dupesnduds/mnemonic/issues
- Documentation: https://github.com/dupesnduds/mnemonic/wiki
- Performance: Check monitoring dashboards first
MIT License - see LICENSE file for details.
- Monorepo reorganisation
- C++ native addon integration
- Enhanced security features
- Comprehensive monitoring
- NZ English conventions