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

mengram-ai

v2.22.0

Published

Human-like memory for AI — auto-save, auto-recall, cognitive profile. Claude Code hooks, MCP server (29 tools), semantic/episodic/procedural memory. Free Mem0 alternative.

Readme

mengram-ai

JavaScript / TypeScript SDK for Mengram — Human-like memory for AI with 3 memory types: semantic, episodic, and procedural.

Install

npm install mengram-ai

Quick Start

const { MengramClient } = require('mengram-ai');

const m = new MengramClient('om-your-api-key');

// Add memories — auto-extracts facts, events, workflows
await m.add([
  { role: 'user', content: 'Fixed the auth bug. My process: check logs, reproduce locally, fix and deploy.' },
]);

// Semantic search (classic)
const results = await m.search('auth issues');

// Episodic — what happened?
const events = await m.episodes({ query: 'auth bug' });
// → [{summary: "Fixed auth bug", outcome: "Resolved", participants: [...]}]

// Procedural — how to do it?
const procs = await m.procedures({ query: 'debug' });
// → [{name: "Debug process", steps: [...], success_count: 3}]

// Unified search — all 3 types at once
const all = await m.searchAll('deployment issues');
// → { semantic: [...], episodic: [...], procedural: [...] }

// Procedure feedback — AI learns what works
await m.procedureFeedback(procId, { success: true });

// Experience-driven evolution — procedure improves on failure
await m.procedureFeedback(procId, {
  success: false, context: 'OOM on step 3', failedAtStep: 3
});

// View procedure version history
const history = await m.procedureHistory(procId);
// → { versions: [v1, v2, v3], evolution_log: [...] }

// Cognitive Profile — instant personalization
const profile = await m.getProfile('ali');
// → { system_prompt: "You are talking to Ali, a developer..." }

TypeScript

import { MengramClient, SearchResult, Episode, Procedure, UnifiedSearchResult, ProcedureHistoryResult } from 'mengram-ai';

const m = new MengramClient('om-...');

const results: SearchResult[] = await m.search('preferences');
const events: Episode[] = await m.episodes({ query: 'deployment' });
const procs: Procedure[] = await m.procedures({ query: 'release' });
const all: UnifiedSearchResult = await m.searchAll('issues');

Import Existing Data

Kill the cold-start problem — import ChatGPT, Obsidian, or text files (Node.js only, requires jszip for ChatGPT):

// ChatGPT export
npm install jszip  // one-time dependency
await m.importChatgpt('~/Downloads/chatgpt-export.zip');

// Obsidian vault
await m.importObsidian('~/Documents/MyVault');

// Text/markdown files
await m.importFiles(['notes.md', 'journal.txt']);

// With progress callback
await m.importChatgpt('export.zip', {
  onProgress: (current, total, title) => console.log(`${current}/${total} ${title}`)
});

API

| Method | Description | |--------|-------------| | Core | | | add(messages, options?) | Add memories (extracts all 3 types) | | addText(text, options?) | Add memories from plain text | | search(query, options?) | Semantic search | | searchAll(query, options?) | Unified search (all 3 types) | | getAll(options?) | List all memories | | getAllFull(options?) | List all memories with full details | | get(name) | Get specific entity | | delete(name) | Delete entity | | stats(options?) | Usage statistics | | Memory Types | | | episodes(options?) | Search/list episodic memories | | procedures(options?) | Search/list procedural memories | | procedureFeedback(id, options?) | Record success/failure (triggers evolution) | | procedureHistory(id) | Version history + evolution log | | procedureEvolution(id) | Evolution log (what changed and why) | | getProfile(userId?, options?) | Cognitive Profile | | Memory Management | | | dedup(options?) | Find and merge duplicate entities | | dedupAll(options?) | Deduplicate facts across all entities | | dedupEntity(name, options?) | Deduplicate facts on specific entity | | merge(source, target, options?) | Merge two entities | | archiveFact(entity, fact, options?) | Archive a specific fact | | reindex(options?) | Re-embed all entities | | fixEntityType(name, type, options?) | Fix entity type classification | | Search & Discovery | | | graph(options?) | Get knowledge graph (nodes + edges) | | timeline(options?) | Search facts by time range | | feed(options?) | Activity feed | | Agents & Insights | | | runAgents(options?) | Run memory agents (curator, connector, digest) | | agentHistory(options?) | Agent run history | | agentStatus(options?) | Check which agents are due | | insights(options?) | AI reflections | | reflect(options?) | Trigger memory reflection | | Triggers | | | getTriggers(options?) | List smart triggers | | detectTriggers(userId, options?) | Detect triggers for a user | | processTriggers() | Fire all pending triggers | | dismissTrigger(id) | Dismiss a trigger | | Webhooks | | | createWebhook(url, options?) | Create a webhook | | listWebhooks() | List all webhooks | | updateWebhook(id, options?) | Update a webhook | | deleteWebhook(id) | Delete a webhook | | Teams | | | createTeam(name) | Create shared team | | joinTeam(code) | Join team | | listTeams() | List your teams | | shareMemory(entity, teamId) | Share with team | | unshareMemory(entity, teamId) | Make memory personal again | | teamMembers(teamId) | List team members | | leaveTeam(teamId) | Leave a team | | deleteTeam(teamId) | Delete a team (owner only) | | Import | | | importChatgpt(zipPath, options?) | Import ChatGPT export ZIP | | importObsidian(vaultPath, options?) | Import Obsidian vault | | importFiles(paths, options?) | Import text/markdown files | | Billing | | | getBilling() | Current plan and usage | | createCheckout(plan) | Create checkout session | | createPortal() | Manage subscription |

Multi-User Isolation

Building a multi-tenant app? Pass userId to isolate memories per end-user. One API key, many users — each sees only their own data:

// Each userId gets its own isolated memory space
await m.add([{ role: 'user', content: 'I prefer dark mode' }], { userId: 'alice' });
await m.add([{ role: 'user', content: 'I prefer light mode' }], { userId: 'bob' });

const alice = await m.searchAll('preferences', { userId: 'alice' });
// → Only Alice's memories (dark mode)

const bob = await m.searchAll('preferences', { userId: 'bob' });
// → Only Bob's memories (light mode)

const profile = await m.getProfile('alice');
// → Alice's cognitive profile

No userId? Everything works as before — defaults to a single shared memory space.

Links