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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jungjaehoon/mama-core

v1.1.4

Published

MAMA Core - Shared modules for Memory-Augmented MCP Assistant

Readme

@jungjaehoon/mama-core

Shared core modules for MAMA (Memory-Augmented MCP Assistant).

What is MAMA Core?

MAMA Core is a shared package containing the fundamental modules used by all MAMA packages:

  • mcp-server: MCP protocol server
  • claude-code-plugin: Claude Code plugin
  • standalone: Standalone HTTP server

This package provides embedding generation, database management, decision tracking, and other core functionality without the transport layer (MCP/HTTP).

Installation

npm install @jungjaehoon/mama-core
# or
pnpm add @jungjaehoon/mama-core

Usage

Import Everything

const mama = require('@jungjaehoon/mama-core');

// Access all exported functions
const embedding = await mama.generateEmbedding('your text');
await mama.initDB();

Import Specific Modules

const { generateEmbedding } = require('@jungjaehoon/mama-core/embeddings');
const { initDB, getDB } = require('@jungjaehoon/mama-core/db-manager');
const mamaApi = require('@jungjaehoon/mama-core/mama-api');

Available Modules

Embedding Modules

  • embeddings - Generate embeddings using Transformers.js

    • generateEmbedding(text) - Single text embedding
    • generateBatchEmbeddings(texts) - Batch embedding generation
    • cosineSimilarity(a, b) - Similarity calculation
  • embedding-cache - In-memory embedding cache

    • embeddingCache.get(key) - Retrieve cached embedding
    • embeddingCache.set(key, value) - Store embedding
    • embeddingCache.clear() - Clear cache
  • embedding-client - HTTP client for embedding server

    • isServerRunning() - Check server availability
    • getEmbeddingFromServer(text) - Get embedding via HTTP
    • getServerStatus() - Server health check

Database Modules

  • db-manager - SQLite database initialization

    • initDB() - Initialize database with migrations
    • getDB() - Get database connection
    • closeDB() - Close connection
  • db-adapter - Database adapter interface

    • createAdapter(type) - Create SQLite adapter
    • Supports prepared statements and transactions
  • memory-store - Decision storage operations

    • CRUD operations for decisions
    • Vector similarity search

Core API

  • mama-api - High-level API interface

    • save(decision) - Save decision
    • recall(topic) - Retrieve decision history
    • suggest(query) - Semantic search
    • updateOutcome(id, outcome) - Update decision outcome
  • decision-tracker - Decision graph management

    • learnDecision(decision) - Learn from decision
    • createEdgesFromReasoning(reasoning) - Parse decision links
  • relevance-scorer - Semantic similarity scoring

    • scoreRelevance(query, decisions) - Score decision relevance
    • Combines vector, graph, and recency signals

Configuration

  • config-loader - Configuration management
    • loadConfig() - Load MAMA configuration
    • getModelName() - Get embedding model name
    • getEmbeddingDim() - Get embedding dimensions
    • updateConfig(config) - Update configuration

Environment Variables

  • MAMA_DB_PATH - Database file path (default: ~/.claude/mama-memory.db)
  • MAMA_EMBEDDING_PORT - Embedding server port (default: 3849)
  • MAMA_HTTP_PORT - Backward-compatible alias for embedding server port

Dependencies

  • @huggingface/transformers - Local embedding generation
  • better-sqlite3 - SQLite database
  • sqlite-vec - Vector similarity extension

Development

# Install dependencies
pnpm install

# Run tests
pnpm test

# Watch mode
pnpm test:watch

Test Coverage

  • 35 unit tests
  • 100% passing
  • Tests cover:
    • Config loader
    • Database initialization
    • Module exports

Architecture

MAMA Core uses CommonJS modules and is designed to be shared across multiple packages:

packages/mama-core/
├── src/
│   ├── index.js              # Main exports
│   ├── embeddings.js         # Embedding generation
│   ├── db-manager.js         # Database management
│   ├── mama-api.js           # High-level API
│   └── db-adapter/           # Database adapter
├── db/migrations/            # SQLite migrations
└── tests/                    # Unit tests

Migration Files

Database migrations are included in db/migrations/:

  • 001-initial-decision-graph.sql
  • 002-add-error-patterns.sql
  • 003-add-validation-fields.sql
  • (and more...)

License

MIT - see LICENSE file for details

Links


Part of the MAMA monorepo - Memory-Augmented MCP Assistant