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

@mipsel64/pi-pensieve

v0.3.0

Published

Pensieve short-term memory for Pi

Readme

pi-pensieve

Short-term memory for Pi, kept in Pensieve.

Pensieve is a self-hosted memory server that all of your agents share: a wiki of Markdown pages connected by [[links]], stored in SQLite and served over MCP, with a web UI for reading it. Claude Code, Codex and Pi recall from it and write to it through its MCP tools. This extension adds what those tools don't do on their own in Pi:

  • Memory at the start of every session. It adds Pensieve's agent guide and memory map, the open items on your Scratchpad page, and recent entries of today's and yesterday's journal pages to Pi's system prompt. Entries of the current project come first, then the newest of the others, up to 6000 characters. Entries that don't fit are listed by heading, so the agent can read them. The snapshot stays the same until compaction or the next day, so the prompt cache isn't reset every turn.
  • A journal of your sessions, written while you work. A background pi -p with no tools asks the model for a short summary of the part of the session that isn't journaled yet: key files and how they work, decisions, lessons and unfinished work. It appends the summary to that day's Journal YYYY-MM-DD page. This happens 10 minutes after the agent goes idle, before each compaction, and when the session ends (quit, /new, resume or fork). Nothing waits for it, so a long session that you never quit still leaves a journal. Parts with nothing worth keeping write nothing, and print mode (pi -p) and subagent sessions never write.
  • Recall before the first prompt. Before the first prompt of a session and after each compaction, the extension asks Pensieve for the passages that match your prompt and adds them to the turn, hidden from the screen. The model does not need to call recall first.

Journal pages and the Scratchpad have type: journal. Pensieve's search skips them unless an agent passes type: "journal", and recall includes journal pages from the last 7 days. Only server 0.3.0 or newer returns recent journals in recall; older servers skip them. Lasting decisions and lessons still belong on regular pages. Pensieve's web UI shows the journal and Scratchpad in its Journal tab. The extension registers no tools; agents edit the Scratchpad with Pensieve's edit tool.

It replaces pi-memory's local daily logs and scratchpad, and because the memory lives on the server, every device and agent sees the same journal.

Setup

  1. Run a Pensieve server, 0.2.0 or newer (the first release with journal pages). Use 0.3.0 or newer for recent journals in recall; see its README.

  2. Connect Pi to it with pi-mcp-adapter, as the Pensieve README describes. pi-pensieve reads the same entry in ~/.config/mcp/mcp.json:

    {
      "mcpServers": {
        "pensieve": {
          "url": "https://my-server.tailnet.ts.net/mcp",
          "auth": "bearer",
          "bearerTokenEnv": "PENSIEVE_TOKEN",
          "headers": { "X-Pensieve-Agent": "pi" },
          "directTools": true
        }
      }
    }

    bearerToken holds a literal token instead. Setting both PENSIEVE_URL and PENSIEVE_TOKEN overrides the file.

  3. Install the extension and restart Pi:

    pi install npm:@mipsel64/pi-pensieve

If Pensieve can't be reached, Pi starts without memory, warns once, and retries on a later turn.

Settings

/pensieve:settings has two sections. "Session journal" turns the journal on or off and chooses the model and thinking level that write the summaries. By default, the session's own model writes them with low thinking. "Recall" turns on or off "Recall on first prompt", which is on by default. As in pi-processes' /ps:settings, the Global, Local and Memory tabs apply everywhere, in this project, or only to this session. Ctrl+S saves the Global tab to ~/.pi/agent/extensions/pensieve.json and the Local tab to .pi/extensions/pensieve.json.