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

@tensakulabs/memory

v0.1.1

Published

Three-tier memory system (hot/warm/cold) with REM Sleep batch consolidation for AI agents

Readme

@tensakulabs/memory

A CLI for three-tier memory management (hot/warm/cold) with REM Sleep batch consolidation. Built for AI agents that need persistent, cost-efficient memory across sessions.

Install

bun add -g @tensakulabs/memory

Quick Start

# Create config at ~/.pai/memory/
memory init

# Edit the config for your agent
nano ~/.pai/memory/memory-config.json

# Stage a fact during a session ($0 cost)
memory stage "MiniMax M2.5 deployed as primary model on 2026-02-15"

# Run REM Sleep to batch-process staged facts
memory sleep --dry-run    # preview what would happen
memory sleep              # actually process

Commands

memory stage

Stage facts for later batch processing. Costs $0 — just appends to a local JSONL file.

memory stage "fact text"                            # auto-classify tier
memory stage "fact text" --tier cold                 # force tier
memory stage "fact text" --context "model research"  # add context
memory stage --list                                  # show pending facts
memory stage --count                                 # count pending

memory sleep

Run the REM Sleep batch processor. Classifies staged facts into tiers, deduplicates against mem0, and routes to the right storage.

memory sleep              # full run
memory sleep --dry-run    # preview decisions without executing
memory sleep --stats      # show staging statistics only

memory init

Create a config file at ~/.pai/memory/memory-config.json.

memory init               # default location
memory init --path ./     # custom location

memory config

Show current configuration and resolved paths.

Configuration

memory-config.json controls all behavior. Create from the example:

{
  "agent": "sage",
  "hot":  { "path": "~/.claude/projects/-Users-you/memory/MEMORY.md" },
  "warm": { "path": "./warm.jsonl" },
  "cold": {
    "mode": "mcp",
    "userId": "your-user-id"
  },
  "remSleep": {
    "maxColdWrites": 5,
    "dedupThreshold": 0.85,
    "stagingPath": "./rem-staging.jsonl"
  }
}

Config is found in this order:

  1. --config flag
  2. MEMORY_CONFIG env var
  3. ~/.pai/memory/memory-config.json
  4. ./memory-config.json

Cold Mode

| Mode | Use Case | How It Works | |------|----------|--------------| | mcp | Claude Code agents | Calls mem0 via claude -p MCP tools | | http | Standalone agents | Direct HTTP to mem0 REST API |

For HTTP mode, add "endpoint": "http://localhost:8080" to the cold config.

See examples/ for pre-made configs (Sage MCP, Atlas HTTP).

How It Works

Session                          Batch (REM Sleep)
───────                          ─────────────────
memory stage "fact" ──→ staging.jsonl ──→ classify ──→ hot (suggested)
                                                  ──→ warm (shared JSONL)
                                                  ──→ cold (mem0, deduplicated)
  1. During sessions: memory stage "fact" appends to rem-staging.jsonl ($0)
  2. REM Sleep runs periodically (cron, launchd, or manual memory sleep)
  3. Each fact is classified by signal matching: hot / warm / cold
  4. Cold candidates are deduplicated against mem0 (skip if >85% match)
  5. Max 5 cold writes per run (~$0.005 max cost)
  6. Hot facts are printed as suggestions — never auto-written

Memory Tiers

| Tier | Storage | TTL | Purpose | |------|---------|-----|---------| | Hot | Local MEMORY.md | Permanent | Agent-specific, always loaded | | Warm | Shared JSONL | 7 days | Cross-agent working context | | Cold | mem0 | Permanent | Long-tail semantic search |

Requirements

  • Bun >= 1.0.0
  • mem0 instance (for cold tier)
  • Claude Code (for MCP mode) or direct mem0 API access (for HTTP mode)

License

MIT