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

@sukep/engram

v0.7.0

Published

MCP server for persistent memory - stores, searches, and associates conversation logs using hybrid search (FTS5 + vector) with A-MEM style note structuring

Readme

memory-mcp-server

A Model Context Protocol (MCP) server that provides persistent memory for AI assistants. Stores, searches, and associates conversation logs using hybrid search (FTS5 full-text + vector similarity) with A-MEM style note structuring.

Features

  • Hybrid Search -- FTS5 full-text search + vector similarity with RRF (Reciprocal Rank Fusion)
  • A-MEM Note Structuring -- Automatic summary, keywords, tags, and context extraction via LLM
  • Associative Search -- Serendipity-driven discovery through TF-IDF random walk and link exploration
  • Multi-backend Storage -- SQLite (local), Turso (cloud), or Hybrid (local + cloud sync)
  • MEMORY.md / CLAUDE.md Integration -- Auto-generated memory index and project context import
  • Data Export/Import -- JSONL format for backup and migration
  • Structured Logging -- Configurable log levels, output to stderr (MCP-safe)
  • Embedding Queue -- Batched, async embedding generation for performance

Installation

npm install memory-mcp-server

Or run directly:

npx memory-mcp-server

Quick Start

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "memory-mcp-server"],
      "env": {
        "MEMORY_DB_PATH": "/path/to/memory.db",
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

Environment Variables

| Variable | Description | Default | |---|---|---| | MEMORY_DB_PATH | Path to SQLite database file | ./memory.db | | MEMORY_TENANT_ID | Tenant ID for multi-tenant isolation | default | | MEMORY_STORAGE_TYPE | Storage backend: sqlite, turso, hybrid | sqlite | | OPENAI_API_KEY | OpenAI API key for embeddings + LLM structuring | (optional) | | MEMORY_INDEX_PATH | Path for auto-generated MEMORY.md | (optional) | | CLAUDE_MD_PATH | Path to CLAUDE.md project context | (optional) | | TURSO_DATABASE_URL | Turso database URL (for turso/hybrid mode) | (optional) | | TURSO_AUTH_TOKEN | Turso auth token (for turso/hybrid mode) | (optional) | | MEMORY_SYNC_INTERVAL | Hybrid sync interval in ms | 30000 | | MEMORY_SYNC_ON_WRITE | Sync to cloud on every write | false | | MEMORY_LOG_LEVEL | Log level: debug, info, warn, error | info | | MEMORY_LOG_FORMAT | Log format: text or json | text |

MCP Tools

memory_save

Save a conversation message as a memory note. Automatically generates summary, keywords, tags, embeddings, and links when OpenAI API key is configured.

Parameters:
  content    (string, required)  -- The content to save
  role       (enum, required)    -- user | assistant | system | summary
  session_id (string, optional)  -- Session ID
  project    (string, optional)  -- Project name
  keywords   (string[], optional) -- Keywords (auto-generated if omitted)
  tags       (string[], optional) -- Tags (auto-generated if omitted)

memory_search

Search memories using hybrid search (FTS5 + vector similarity with RRF fusion).

Parameters:
  query      (string, required)  -- Search query (keywords or natural language)
  date_from  (string, optional)  -- Filter: earliest date (ISO 8601)
  date_to    (string, optional)  -- Filter: latest date (ISO 8601)
  project    (string, optional)  -- Filter: project name
  tags       (string[], optional) -- Filter: tags
  session_id (string, optional)  -- Filter: session ID
  limit      (number, optional)  -- Max results (default: 10)

memory_associate

Discover related memories through associative (serendipity) search.

Parameters:
  seed        (string, optional) -- Seed text (random if omitted)
  temperature (number, optional) -- 0.0=focused, 1.0=exploratory (default: 0.5)
  limit       (number, optional) -- Max results (default: 5)

memory_stats

Get statistics about stored memories: total notes, sessions, links, date range, and top keywords.

memory_summarize

Summarize memories for a given period or project using LLM.

Parameters:
  project   (string, optional) -- Filter by project
  date_from (string, optional) -- Start date (ISO 8601)
  date_to   (string, optional) -- End date (ISO 8601)

memory_update_index

Update the MEMORY.md index file and optionally import CLAUDE.md content.

memory_export

Export memory data as JSON Lines (JSONL) format for backup or migration.

Parameters:
  date_from        (string, optional)  -- Export from date
  date_to          (string, optional)  -- Export until date
  include_links    (boolean, optional) -- Include note links (default: true)
  include_sessions (boolean, optional) -- Include sessions (default: true)

memory_import

Import memory data from JSONL format (from a previous export).

Parameters:
  data           (string, required) -- JSONL content to import
  merge_strategy (enum, optional)   -- skip (default) or overwrite

memory_migrate

Migrate data between storage backends (e.g., SQLite to Turso).

memory_sync_status

(Hybrid mode only) Get sync status of the hybrid adapter.

Architecture

                    MCP Client (Claude Desktop, etc.)
                              |
                         stdio transport
                              |
                    +-------------------+
                    |   MCP Server      |
                    |   (10 tools)      |
                    +-------------------+
                              |
          +-------------------+-------------------+
          |                   |                   |
    NoteBuilder         SearchEngine       AssociateEngine
    (LLM + Embed)       (FTS + Vec)        (Random Walk)
          |                   |                   |
          +-------------------+-------------------+
                              |
                    +-------------------+
                    |  StorageAdapter    |
                    |  (interface)       |
                    +---+-------+---+---+
                        |       |       |
                   SQLite   Turso   Hybrid
                  (local)  (cloud)  (sync)

Key Components

  • NoteBuilder -- A-MEM style note structuring with LLM (summary, keywords, tags, context) and embedding generation
  • SearchEngine -- Hybrid search combining FTS5 BM25 scoring with vector cosine similarity via RRF
  • AssociateEngine -- Serendipity search using TF-IDF random walk, link exploration, and vector space exploration with MMR diversity
  • EmbeddingQueue -- Batched async embedding generation with configurable batch size and flush delay
  • ImportanceScorer -- Multi-signal importance scoring (content, links, freshness, role)
  • DataTransfer -- JSONL-based export/import for backup and migration
  • MemoryIndex -- Auto-generates MEMORY.md with recent memories, frequent topics, and user preferences
  • ClaudeContext -- Imports CLAUDE.md sections as searchable system notes
  • SessionManager -- Session lifecycle with timeout-based auto-end and MEMORY.md update triggers
  • Logger -- Structured logging to stderr with configurable levels (debug/info/warn/error)

Storage Backends

| Backend | Use Case | Vector Search | FTS5 | |---|---|---|---| | SQLite | Local development, single machine | Yes (sqlite-vec) | Yes | | Turso | Cloud deployment, multi-device | No | LIKE fallback | | Hybrid | Best of both -- local speed + cloud sync | Yes (via local) | Yes (via local) |

Graceful Degradation

The server works without an OpenAI API key:

  • Without API key: FTS-only search, no auto-structuring, no embeddings
  • With API key: Full hybrid search, LLM structuring, vector embeddings, auto-linking

Development

# Install dependencies
npm install

# Run in development mode
npm run dev

# Run tests
npm test

# Type check
npm run typecheck

# Build
npm run build

License

MIT