npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

model-memory-protocol

v1.0.0

Published

Model Memory Protocol (MMP) - A comprehensive memory protocol for LLMs based on MCP and OpenTelemetry patterns

Readme

Model Memory Protocol (MMP)

MIT License npm version Build Status

A comprehensive memory protocol for Large Language Models based on MCP and OpenTelemetry patterns

🚀 Overview

Model Memory Protocol (MMP) is a standardized protocol designed to solve the complex challenges of memory management in LLM systems. Inspired by the research findings on memory systems like EM-LLM, A-MEM, and CAMELoT, MMP provides a unified framework for:

  • Multi-tier memory storage (working, episodic, semantic, procedural, archival)
  • Real-time memory synchronization across distributed AI agents
  • Pluggable storage backends (in-memory, vector databases, graph stores)
  • Secure transport layers with authentication and authorization
  • Memory consolidation and optimization following neuroscience principles

🎯 Key Features

📊 Memory Types

  • Episodic Memory: Time-based memories with contextual information
  • Semantic Memory: Factual knowledge and relationships
  • Procedural Memory: How-to knowledge and learned behaviors
  • Working Memory: Short-term active memory for current tasks
  • Archival Memory: Long-term storage with compression and optimization

🔧 Storage Tiers

  • Main Context: RAM-like storage for immediate access
  • External Context: Disk-like storage for extended context
  • Vector Store: Semantic similarity search capabilities
  • Graph Store: Relationship modeling and traversal
  • Temporal Store: Time-based indexing and retrieval

🌐 Transport Mechanisms

  • WebSocket: Real-time bidirectional communication
  • HTTP/REST: Standard request-response patterns
  • Server-Sent Events: Streaming updates to clients
  • Stdio: Command-line interface integration

📦 Installation

npm install model-memory-protocol

🏃 Quick Start

import { MemoryProtocol, MemoryType, InMemoryBackend } from 'model-memory-protocol';

// Create protocol instance
const protocol = new MemoryProtocol({
  version: '1.0.0',
  transports: [{ type: 'websocket', options: { port: 8080 } }],
  storage: [{ backend: 'in-memory', tier: 'main_context', priority: 1 }],
  security: { /* security configuration */ },
  processing: { /* processing configuration */ },
  consolidation: { /* consolidation configuration */ }
});

// Initialize protocol
await protocol.initialize();

// Create a session
const sessionId = await protocol.createSession('user123', 'agent456');

// Store memory
const memoryId = await protocol.store(
  'The user prefers TypeScript over JavaScript',
  MemoryType.SEMANTIC,
  sessionId,
  { importance: 0.8, tags: ['preference', 'programming'] }
);

// Retrieve memories
const results = await protocol.retrieve(
  'programming preferences',
  sessionId,
  { limit: 5, threshold: 0.7 }
);

console.log('Found memories:', results.memories);

📚 Documentation

🏗️ Architecture

MMP follows a layered architecture inspired by OpenTelemetry:

┌─────────────────────────────────────────────────────────────┐
│                    Application Layer                        │
├─────────────────────────────────────────────────────────────┤
│                      MMP SDK                                │
├─────────────────────────────────────────────────────────────┤
│                   Protocol Layer                            │
├─────────────────────────────────────────────────────────────┤
│  Memory Collector │ Memory Processor │ Memory Exporter     │
├─────────────────────────────────────────────────────────────┤
│               Transport Layer                               │
├─────────────────────────────────────────────────────────────┤
│                Storage Backends                             │
└─────────────────────────────────────────────────────────────┘

🔒 Security Features

  • OAuth 2.0 / JWT Authentication: Secure session management
  • Role-based Authorization: Fine-grained access control
  • End-to-end Encryption: Protect sensitive memory data
  • Audit Logging: Track all memory operations
  • Rate Limiting: Prevent abuse and ensure fair usage

🔄 Memory Consolidation

MMP implements advanced memory consolidation strategies:

  • Novelty-based: Prioritize unique and unexpected information
  • Recency-based: Emphasize recently accessed memories
  • Importance-based: Focus on high-importance memories
  • Hybrid: Combine multiple strategies for optimal results

🌟 Research Foundation

MMP is built on cutting-edge research in LLM memory systems:

  • EM-LLM: Bayesian surprise and graph-theoretic boundary refinement
  • A-MEM: Zettelkasten-inspired dynamic memory structuring
  • CAMELoT: Neuroscience-inspired consolidation mechanisms
  • OpenTelemetry: Proven patterns for distributed system observability

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Related Projects

📞 Support