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

memshell

v0.4.0

Published

Persistent memory for AI agents. Like localStorage but for LLMs.

Readme

npm version license GitHub stars

Quick Start · Auto-Ingest · OpenClaw Integration · SDK · API Server · Architecture


Install

npm i memshell

Why mem.sh?

Agents forget everything between sessions. mem.sh gives them a brain.

| | mem.sh | LangChain Memory | Roll your own | |---|---|---|---| | Setup | npx memshell set "..." | 47 dependencies + config | Hours of boilerplate | | Auto-ingest | Built-in | No | You build it | | External APIs | None (optional) | OpenAI key required | Depends | | Semantic search | Built-in TF-IDF | Embedding models | You build it | | Storage | SQLite (local) | Varies | You choose |

Features

  • Fast -- TF-IDF vectorization with cosine similarity, instant results
  • Local-first -- SQLite storage at ~/.mem/mem.db, no data leaves your machine
  • Semantic -- Recall by meaning, not exact match
  • Auto-ingest -- Feed raw conversations, auto-extract key facts via LLM
  • OpenClaw integration -- Watch session transcripts and auto-learn
  • Zero config -- npx and go. No API keys needed for core features
  • Smart recall -- Shows source, creation time, and recall frequency

Quick Start

CLI

# Store a memory
npx memshell set "user prefers dark mode"

# Recall semantically
npx memshell recall "what theme does the user like?"
# => user prefers dark mode (score: 0.87)

# List all memories
npx memshell list

# Forget a specific memory
npx memshell forget <id>

# Wipe everything
npx memshell clear

Auto-Ingest

Feed raw conversations and let the LLM extract key facts automatically.

Requires OPENAI_API_KEY or ANTHROPIC_API_KEY (or configure via memshell config set apiKey <key>).

From a file

npx memshell ingest conversation.txt
npx memshell ingest chat.jsonl
npx memshell ingest notes.md

From stdin

echo "User said they prefer dark mode and use vim" | npx memshell ingest --stdin

Watch a directory

npx memshell ingest --watch ./logs/

Watches for new or changed .txt, .md, .json, and .jsonl files. Tracks what has been processed to avoid duplicates.

Via API

curl -X POST http://localhost:3456/mem/ingest \
  -H "Content-Type: application/json" \
  -d '{"text": "User mentioned they love Rust and prefer dark themes"}'
# => {"extracted": 2, "stored": 2, "duplicates": 0}

How it works

  1. Text is split into ~2000-token chunks
  2. Each chunk is sent to an LLM (gpt-4o-mini or claude-3-haiku) to extract standalone facts
  3. Facts are deduplicated against existing memories (Jaccard similarity > 0.85 = skip)
  4. New facts are stored with auto-generated tags and source tracking

OpenClaw Integration

Automatically learn from your OpenClaw agent conversations:

# Start watching OpenClaw session transcripts
npx memshell connect openclaw

# Or specify a custom path
npx memshell connect openclaw /path/to/sessions/

This watches the OpenClaw sessions directory (~/.openclaw/agents/main/sessions/ by default), parses JSONL transcripts, and auto-ingests new conversations.

Daemon mode

Run continuous ingestion in the background:

# Configure watchers first
npx memshell config set watch.openclaw ~/.openclaw/agents/main/sessions/

# Start the daemon
npx memshell daemon

Configuration

# Set LLM API key
npx memshell config set apiKey sk-...

# Set model
npx memshell config set model gpt-4o-mini

# View config
npx memshell config get

Config is stored at ~/.mem/config.json.

SDK

const mem = require('memshell');

// Store
await mem.set('user prefers dark mode');
await mem.set('favorite language is rust', { agent: 'coder-bot' });

// Recall (semantic search) -- now includes source and recall count
const results = await mem.recall('what does the user like?');
// [{ id, text, score, created_at, source, recall_count }]

// List all
const all = await mem.list();

// Delete
await mem.forget(id);

// Clear everything
await mem.clear();

How It Works

mem.sh uses TF-IDF vectorization with cosine similarity for semantic search. No OpenAI key needed. No external APIs. Everything runs locally.

Memories are stored in ~/.mem/mem.db (SQLite). Each memory is tokenized and vectorized on write. Queries are vectorized at recall time and ranked by cosine similarity against stored vectors.

Optional: Enable OpenAI embeddings with --embeddings flag for higher quality recall (requires OPENAI_API_KEY).

API Server

Run a shared memory server for multiple agents:

npx memshell serve --port 3456 --key my-secret-key

Endpoints

| Method | Path | Description | |--------|------|-------------| | POST | /mem | Store a memory | | POST | /mem/ingest | Auto-ingest raw text | | GET | /mem/recall?q= | Semantic recall | | GET | /mem/list | List all memories | | GET | /mem/stats | Memory statistics | | GET | /mem/export | Export all memories | | POST | /mem/import | Import memories | | DELETE | /mem/:id | Delete a memory | | DELETE | /mem | Clear all memories |

Headers

  • X-Mem-Key -- API key (required if --key is set)
  • X-Mem-Agent -- Agent namespace (optional, isolates memories per agent)

SDK with API Mode

const mem = require('memshell');

mem.configure({
  api: 'http://localhost:3456',
  key: 'my-secret-key',
  agent: 'my-bot'
});

await mem.set('user prefers dark mode');
const results = await mem.recall('theme preference');

All CLI Commands

memshell set <text>              Store a memory
memshell recall <query>          Semantic recall
memshell list                    List all memories
memshell forget <id>             Delete a memory by ID
memshell clear                   Wipe all memories
memshell important <id>          Boost memory importance
memshell ingest <file>           Extract facts from a file
memshell ingest --stdin          Extract facts from piped text
memshell ingest --watch <dir>    Watch directory for new files
memshell connect openclaw        Watch OpenClaw transcripts
memshell daemon                  Run continuous ingestion
memshell config set <key> <val>  Set config value
memshell config get [key]        Show config
memshell stats                   Show memory statistics
memshell export                  Export all memories as JSON
memshell import <file.json>      Import memories from JSON
memshell serve [--port N]        Start API server

License

ISC