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

pi-supermemory

v0.1.0

Published

Persistent memory extension for Pi coding agent - remember context across sessions using SuperMemory

Readme

🧠 Pi SuperMemory Extension

Persistent memory for Pi - the AI coding agent that remembers context across sessions using SuperMemory.

Note: This extension is compatible with SuperMemory SDK v2. API parameters have changed from earlier versions (containerTag instead of containerTags, limit instead of topK, q instead of context, forget instead of delete).

Overview

This extension gives Pi long-term memory capabilities, allowing it to:

  • Remember user preferences across all projects (coding style, favorite tools, etc.)
  • Maintain project context between sessions (architecture decisions, pending tasks)
  • Learn from conversations and recall relevant information when needed
  • Build a user profile that accumulates facts about you over time

Features

🔄 Automatic Context Injection

  • Relevant memories are automatically injected into prompts based on semantic similarity
  • No manual searching required - memories surface when they're needed

🎯 Two Memory Scopes

  • User scope: Cross-project knowledge that follows you everywhere
  • Project scope: Project-specific knowledge tied to the current directory

🤖 LLM Tool Access

The supermemory tool gives the AI direct access to:

  • add - Store new memories with type classification
  • search - Find relevant memories by query
  • profile - View accumulated user profile
  • list - Browse recent memories
  • forget - Delete specific memories

⌨️ Slash Commands

  • /remember <text> - Quick-save something to memory
  • /recall <query> - Search your memories
  • /memory-profile - View your user profile

💾 Automatic Conversation Capture

Conversations are automatically stored (when substantial) for future reference.

Installation

Prerequisites

  1. Get a SuperMemory API key:

  2. Set environment variables:

    export SUPERMEMORY_API_KEY="your-api-key-here"
    # Optional: customize container prefix (default: "pi")
    export SUPERMEMORY_CONTAINER="myorg"

Install the Extension

# In your Pi extensions directory (usually ~/.pi/agent/extensions/)
cd ~/.pi/agent/extensions/

# Clone or copy this extension
git clone https://github.com/dan/pi-supermemory.git supermemory

# Install dependencies
cd supermemory
npm install

Verify Installation

Start Pi and look for the 🧠 indicator in the status bar, or check that no "SUPERMEMORY_API_KEY not set" warning appears.

Usage

Let the AI Remember Things

Simply tell Pi to remember something:

"Remember that I prefer 2-space indentation in TypeScript" "Save this for later - the database connection string is..." "Remember this project uses a monorepo structure"

The AI will use the supermemory tool to store this information with the appropriate scope and type.

Manual Commands

# Quick save
/remember I always use pnpm instead of npm

# Search memories
/recall database schema

# View your profile
/memory-profile

Memory Types

When storing memories, they can be classified as:

| Type | Description | |------|-------------| | preference | Personal preferences (coding style, tools, etc.) | | project-config | Project configuration details | | architecture | System design and architecture decisions | | error-solution | Solutions to problems you've encountered | | learned-pattern | General patterns and insights | | conversation | Automatically captured conversations |

Memory Scopes

  • user: Available across all projects (good for personal preferences)
  • project: Only available in the current project directory (default)

Configuration

Environment Variables

| Variable | Required | Default | Description | |----------|----------|---------|-------------| | SUPERMEMORY_API_KEY | Yes | - | Your SuperMemory API key | | SUPERMEMORY_CONTAINER | No | pi | Prefix for container tags |

How Container Tags Work

The extension uses container tags to organize memories:

  • User memories: {SUPERMEMORY_CONTAINER}_user_{username}
  • Project memories: {SUPERMEMORY_CONTAINER}_project_{project_name}

This keeps different users' and projects' memories separate.

API Reference

Tool: supermemory

The LLM can call this tool with the following parameters:

{
  mode: "add" | "search" | "profile" | "list" | "forget" | "help",
  content?: string,      // For "add" mode
  query?: string,        // For "search" or "profile" modes
  type?: MemoryType,     // For "add" mode
  scope?: "user" | "project",  // For "add", "search", "list" modes
  memoryId?: string,     // For "forget" mode
  limit?: number         // For "search" and "list" modes
}

Note: The SuperMemory SDK v2 API uses containerTag (singular), limit (instead of topK), and q (instead of context). This extension has been updated to match the latest SDK.

Example Tool Calls

// Store a preference
{ mode: "add", content: "Prefers dark mode themes", type: "preference", scope: "user" }

// Search for relevant memories
{ mode: "search", query: "database connection", scope: "project", limit: 5 }

// View user profile
{ mode: "profile", query: "coding preferences" }

// List recent memories
{ mode: "list", scope: "project", limit: 10 }

// Forget a memory
{ mode: "forget", memoryId: "mem_abc123", scope: "project" }

Architecture

The extension works by:

  1. Before each agent turn: Searches SuperMemory for context relevant to the user's prompt, injects matching memories into the system prompt

  2. After each agent turn: Captures the conversation text and stores it in project scope for future reference

  3. During tool execution: Provides the LLM with tools to actively manage memory (add, search, delete)

  4. On session start: Shows a 🧠 status indicator when memory is active

Development

# Clone the repo
git clone https://github.com/dan/pi-supermemory.git
cd pi-supermemory

# Install dependencies
npm install

# Link for local development
npm link

# In Pi extensions directory
npm link pi-supermemory

Troubleshooting

"SUPERMEMORY_API_KEY not set - extension disabled"

  • Make sure you've set the SUPERMEMORY_API_KEY environment variable
  • Restart Pi after setting environment variables

Memories not appearing

  • Check that the SuperMemory API key is valid
  • Verify network connectivity to supermemory.ai
  • Check Pi's console for error messages

Wrong project scope

  • The project scope is derived from the current working directory name
  • Make sure you're in the correct project directory

Related

License

MIT

Contributing

Contributions welcome! Please open an issue or PR on GitHub.