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

@gotong/personal-memory

v0.1.0

Published

Gotong personal-butler memory — file-first MemorySession + prefix-cache-preserving frozen block + remember/recall/forget MemoryToolset + MemoryAugmentedAgent. The memory engine the resident butler stands on (对标 OpenClaw / Hermes).

Downloads

112

Readme

@gotong/personal-memory

The memory engine the resident personal butler stands on. M1 of the butler build (see docs/zh/PERSONAL-BUTLER-DESIGN.md). 对标 OpenClaw / Hermes 的文件优先记忆 + 前缀缓存友好的冻结块。

Leaf package — depends only on @gotong/core, @gotong/llm, @gotong/services-sdk. No host, no identity, no LLM credentials.

What's in the box

| Export | What it does | |---|---| | renderFrozenBlock(entries, opts) | Pure, byte-stable renderer: a SET of memory entries → a markdown block. Independent of input order (re-sorts ts desc, ties by id; one entry = one line). | | MemorySession | Computes the frozen block once per session and caches it. New memories written mid-session land on disk but don't mutate the cached block — they surface next session. | | MemoryToolset | remember / recall / forget exposed as LLM tools (implements LlmAgentToolset). Tool failures come back as isError, never thrown. | | MemoryAugmentedAgent | LlmAgent + frozen-block injection (front of the system prompt) + the memory toolset composed into tools. |

Why "frozen" — prompt-cache preservation

Anthropic / OpenAI prompt caching keys on a byte-identical prefix. If the system prompt shifts between turns, the cache misses and every turn re-bills the whole prefix. So the memory block is computed once at session start and kept identical for the rest of the session — exactly Hermes' model. The block draws from curated semantic memory (the profile); raw episodic history is fetched on demand via the recall tool, not poured into every prompt.

import { MemoryAugmentedAgent } from '@gotong/personal-memory'

const butler = new MemoryAugmentedAgent({
  id: 'butler',
  provider,                 // any LlmProvider
  memory: services.memory,  // a per-user MemoryHandle (or pass via services)
  system: 'You are my personal butler.',
  tools: dispatchToolset,   // optional — memory tools compose alongside
})

The model writes durable facts with remember (they appear in the next session's frozen block) and digs up older history with recall. In M1 all three memory tools run directly — they only touch the butler's own per-user memory. Hub-mutating / spending / sending tools are approval-gated in a later milestone (Phase 16 inbox), per the North Star: the framework proposes, sensitive actions wait for a human.

Tests

pnpm --filter @gotong/personal-memory test

Covers: frozen-block determinism + cap, session memoization + mid-session freeze, toolset round-trip + validation, and an integration test proving the system prefix stays byte-identical across turns and that a mid-session remember surfaces only in the next session.