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

@vtstech/pi-long-term-memory

v1.3.5

Published

Long-term memory extension for Pi - persistent memory across sessions

Readme

@vtstech/pi-long-term-memory

Long-term memory extension for the Pi Coding Agent.

Persistent memory across sessions with automatic injection, AI-driven memory creation, and a ~4k token window.

Install

pi install "npm:@vtstech/pi-long-term-memory"

Features

  • Persistent Storage: Memories survive across sessions and restarts
  • Auto-Injection: Memory automatically injected at session start
  • AI-Driven Creation: AI can request memories via create_memory tool
  • Memory Gate: Confirm before creating memories (enabled by default)
  • Tag Organization: Organize memories with tags
  • Token Management: ~4k token window with auto-summarization

Commands

/memory add <text>     - Add memory (with optional tags)
/memory delete <id|content> - Delete memory by ID or content
/memory replace <id> <new-content> [comma-separated-tags] - Replace memory content by ID
/memory list           - List all memories
/memory clear          - Clear memories (preserves metadata)
/memory clear-meta     - Reset metadata
/memory meta           - Show metadata
/memory backups        - List available memory backups
/memory stats          - Show comprehensive memory statistics
/memory-gate           - Toggle memory creation gate
/memory --help         - Show help

Memory Management

Delete Operations:

  • /memory delete <id> - Delete specific memory by ID
  • /memory delete <content> - Delete any memory containing the specified text

Replace Operations:

  • /memory replace <id> <new-content> - Replace memory content by ID
  • /memory replace <id> <new-content> tag1,tag2 - Replace content and update tags

Memory Statistics

The /memory stats command provides detailed metrics:

  • Total memories count
  • Total content characters
  • Estimated tokens (rough calculation)
  • Average tokens per memory
  • Formatted context tokens
  • Memory gate status
  • Last compaction timestamp

Enhanced Features

  • User-Prompted Metadata: Primary User, Environment, and Framework fields are now prompted on first run
  • Backup System: Automatic backup of pre-compacted memories to memory-backups directory
  • Enhanced Error Handling: Comprehensive debugging and error handling throughout memory operations
  • Memory Injection Hooks: Proper timing ensures memory is loaded and displayed before AI responses

AI-Driven Memory

The AI can request memory creation via the create_memory tool:

{
  "action": "create_memory",
  "content": "Decided on PostgreSQL for session storage",
  "tags": "decision, architecture",
  "reason": "Better consistency guarantees needed"
}

With the memory gate enabled (default), you'll be prompted to confirm before creation.

Memory Injection

Memory is automatically injected at session start, BEFORE the AI generates its first response. The extension hooks into:

  • pre_session_start - Ensures metadata is complete
  • session_start - Displays memory context to user
  • before_provider_request - Prepends memory to the API request

Token Management

Memory operates within a ~4k token window with automatic summarization:

  • Memories are sorted by importance and last accessed
  • When approaching token limits, older/less important memories are compacted
  • System preserves all memories across sessions

Metadata

User-prompted on first run:

  • Primary User: Prompted for user name
  • Environment: Prompted for environment (e.g., development, production, G! Colab)
  • Framework: Prompted for framework name (defaults to "Pi Coding Agent")

The system ensures metadata is complete before memory injection.

Storage

Memory file: .pi/agent/long-term-memory.json

Links

License

MIT — VTSTech