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

gentle-engram

v0.1.7

Published

Persistent memory for Pi agents — one local-or-cloud brain shared across sessions, compactions, and MCP agents

Readme

Engram for Pi

Give every Pi session the same brain — local by default, cloud when you want it, and searchable across agents.

Pi is great at doing the work in front of it. The problem is everything around the work: what the agent learned yesterday, which architecture decision was accepted, why a bug was fixed a certain way, what the user prefers, and what should survive when the context window compacts.

Engram is persistent memory for AI coding agents. gentle-engram connects Pi to that memory so your agent can save the useful parts of a session and retrieve them later — without stuffing raw tool output back into the prompt.

At a glance

| You want | Engram gives Pi | | --------------------------- | ------------------------------------------------ | | Fewer repeated explanations | Searchable memories from previous sessions | | Lower context waste | Curated saves instead of raw tool-call dumps | | Continuity after compaction | Required session summaries and recovery protocol | | One memory across tools | Shared MCP-backed memory for Pi and other agents | | Team/project memory | Optional Engram Cloud replication and dashboard |

The promise

Install it once. Keep coding. Pi remembers.

  • One brain for many agents — Pi, Claude Code, OpenCode, Gemini CLI, Codex, VS Code/Copilot, Cursor, Windsurf, Antigravity, and any MCP-compatible agent can read/write the same Engram memory.
  • Local-first memory — a single Go binary writes to SQLite + FTS5 on your machine. No Node service, Python stack, or hosted account required for the core path.
  • Cloud when the team needs it — Engram Cloud adds opt-in, project-scoped replication, shared access, and a browser dashboard while keeping local SQLite authoritative.
  • Token-efficient by design — Engram stores curated summaries, decisions, prompts, and session handoffs instead of a noisy firehose of raw tool calls. Agents search first, then fetch only the relevant memory.
  • Compaction survival — before context resets, the Memory Protocol pushes summaries into Engram so the next session can recover what matters.
  • Simple Pi setup — install the Pi package, install the MCP adapter, run pi-engram init, restart Pi.
  • Built by Gentleman Programming — Engram comes from the Gentleman Programming ecosystem: an open-source engineering community, YouTube channel, and hands-on agentic-coding workflow around real tools instead of toy demos.
  • Real open-source project — Engram ships docs, releases, beta programs, contributor guidelines, issue templates, CI, and a growing contributor/community workflow around the main repository.

Built with the community

Engram is not an abandoned side script or a black-box SaaS. It is built in public by Gentleman Programming for developers who are already using coding agents seriously.

The goal is simple: make agentic development feel like a real engineering system — memory, specs, skills, cloud sync, review discipline, and community learning all connected.

Why this is different from “more context”

Context windows are temporary. Engram is memory.

| More context | Engram memory | | ----------------------------------- | -------------------------------------------------------- | | Helps during the current run | Helps across sessions, agents, machines, and compactions | | Often includes raw logs/tool output | Stores curated, searchable knowledge | | Gets summarized away | Persists in SQLite + FTS5 | | Usually tied to one agent | Works through MCP across agent clients |

Engram does not try to make the model read everything. It gives the model a disciplined memory protocol: save important knowledge, search before repeating work, and fetch full details only when needed.

See the memory

Engram includes a terminal UI for browsing sessions, observations, prompts, projects, timelines, and search results. Engram Cloud adds browser visibility for shared project memory.

Quick start

pi install npm:[email protected]
pi install npm:pi-mcp-adapter
pi-engram init

Restart Pi after installation, then ask Pi what it remembers about the current project or call mem_context.

What gets installed

gentle-engram connects Pi to Engram through two complementary paths:

| Path | Purpose | | ------------ | -------------------------------------------------------------------------------------------------------------------------------------- | | Pi extension | Captures prompts/session events, injects the Memory Protocol, and exposes compact Pi-native mem_* tools over the Engram HTTP server. | | MCP tools | Keeps Engram's MCP surface available through pi-mcp-adapter for clients and flows that use MCP directly. |

Pi events/tools -> gentle-engram extension -> ENGRAM_URL / engram serve -> SQLite
Pi MCP tools   -> pi-mcp-adapter -> ENGRAM_BIN / engram mcp -> SQLite

Pi-native compact tools use the same HTTP server path as event capture, including project detection, diagnostics, passive capture, and conflict-judgment tools such as mem_current_project, mem_doctor, mem_capture_passive, mem_judge, and mem_compare. MCP tools remain a separate stdio path, so direct MCP usage still needs an Engram binary even when ENGRAM_URL points at a remote HTTP server. Engram MCP direct tools are not enabled by default in Pi to avoid duplicate raw engram_mem_* tool rows.

Compact memory tool rendering

gentle-engram owns the Pi chrome for Engram memory tools by registering compact Pi-native mem_* tools in the companion package. When tools such as mem_search, mem_context, mem_save, mem_session_summary, mem_get_observation, mem_judge, and mem_doctor run in Pi, the default collapsed view stays compact:

🧠 search “auth model” …
↳ ✓ 4 results

Normal memory activity also updates the status bar with short progress/result text such as 🧠 engram · search… and 🧠 engram · ✓ 4 results. The extension does not use notifications for normal memory operations.

Full tool details remain available by expanding the tool output in Pi. If gentle-engram or the Engram server is not installed/running, the compact tool reports an error instead of implying memory is available.

What Pi can remember

  • Architecture decisions and tradeoffs
  • Bug fixes, root causes, and gotchas
  • User preferences and project conventions
  • Session goals, next steps, and handoff summaries
  • Prompt context tied to meaningful saved observations
  • Cross-machine/team memory once a project is enrolled in Engram Cloud

Private blocks

gentle-engram redacts explicit private blocks before sending captured prompts, passive observations, or compaction summaries to Engram:

<private>
this should not be persisted verbatim
</private>

The persisted payload keeps the surrounding text but replaces the private block with [REDACTED]. Redaction is applied recursively to string values in outgoing JSON payloads and to query values in Engram HTTP requests.

This is a lightweight convenience convention, not a full secret-scanning system. Do not rely on it to detect credentials automatically.

Compaction recovery

When Pi emits a compaction lifecycle event, gentle-engram best-effort extracts a compacted summary from supported event fields and saves it as a session_summary observation with topic key session/compaction-recovery.

Unsupported event shapes fail gracefully. The extension still injects a manual recovery instruction containing FIRST ACTION REQUIRED, so the next agent turn can call mem_session_summary if the Engram MCP tools are installed and active. If the tools are unavailable, save the compacted summary manually after Engram is available again.

Local, sync, or cloud

Engram can grow with your workflow:

| Mode | Use it when | | ------------ | ------------------------------------------------------------------------------------------- | | Local SQLite | You want fast private memory on one machine. | | Git sync | You want portable compressed memory chunks without a hosted service. | | Engram Cloud | You want shared project memory, browser visibility, and replication across machines/agents. |

Cloud is opt-in and project-scoped. Local SQLite remains the source of truth; cloud replicates and makes memory visible when you explicitly enroll a project.

Requirements

  • Pi coding agent with npm package support.
  • Engram installed as engram on PATH, or ENGRAM_BIN pointing at the binary.
  • pi-mcp-adapter only if you want the optional MCP gateway for compatibility/debugging; Pi-native mem_* tools come from gentle-engram.

If you only want HTTP session capture against an already running Engram server, set ENGRAM_URL and the extension will not auto-start a local engram serve process.

Configuration

Existing Engram server

Use an already running Engram HTTP server:

ENGRAM_URL=http://127.0.0.1:7437 pi

When ENGRAM_URL is set, the extension treats the server as externally managed and does not auto-start engram serve.

Custom Engram binary

Use a custom Engram binary for MCP tools and local auto-start:

ENGRAM_BIN=/path/to/engram pi

If the binary is missing, Pi keeps running and memory degrades instead of crashing with spawn engram ENOENT.

Install command details

pi-engram init writes Pi-owned config in the Pi agent directory:

  • settings.json: ensures npm:pi-mcp-adapter and npm:[email protected] are declared.
  • mcp.json: adds an engram MCP server that launches engram mcp --tools=agent through a safe Node wrapper with directTools: false, so MCP remains available through the gateway without duplicating Pi-native mem_* tools.

Existing mcpServers.engram entries are preserved unless you pass --force:

pi-engram init --force

The command respects PI_CODING_AGENT_DIR; otherwise it writes to ~/.pi/agent.

Project detection

The HTTP event-capture path mirrors Engram's normal project detection order as closely as a Pi adapter can:

  1. nearest .engram/config.json inside the current git repo
  2. git origin remote name
  3. git root directory name
  4. single child git repo name
  5. current directory basename

MCP tool calls still use Engram core's canonical project resolver at call time. Pi-native tool calls ask the Engram HTTP server for /project/current; if that route is missing on an older running server, the adapter falls back to the nearest local .engram/config.json and returns a version-mismatch warning. For critical repos or monorepos, prefer an explicit .engram/config.json:

{
  "project_name": "my-project"
}

Troubleshooting

| Symptom | Fix | | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | mem_* tools are missing | Install pi-mcp-adapter, run pi-engram init, then restart Pi. | | Pi cannot find engram | Set ENGRAM_BIN=/absolute/path/to/engram. | | Session capture should use another server | Set ENGRAM_URL=http://host:7437. | | Existing MCP config was not replaced | Run pi-engram init --force. | | mem_current_project reports /project/current unsupported | Restart or upgrade the running engram serve; check ENGRAM_URL/ENGRAM_BIN. If .engram/config.json exists, Pi uses it as a temporary fallback. | | mem_session_summary cannot detect a project | Ask the user which project should receive the summary, then retry mem_session_summary with project: "name". |

Next steps