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

@agents-js/memory

v0.5.1

Published

Library-agnostic write-side memory primitive for agents-js. Defines MemoryProvider, actor/scope/record types, and a conformance harness for backend implementations.

Readme

@agents-js/memory

Library-agnostic write-side memory primitive for agents-js. Defines MemoryProvider, actor/scope/record types, and a conformance harness for backend implementations.

Installation

bun add @agents-js/memory

API

Classes

  • InMemoryProvider — Reference provider — all capabilities = true. Lives in the package so the conformance harness has a known-good target. Consumers MAY use it as a test fixture; not intended for production storage.
  • MemoryAclError — Thrown by providers when actor lacks permission to act on scope.
  • MemoryRevisionConflictError — Thrown by providers when expectedRevision doesn't match current.

Functions

  • createMockActor
  • runProviderConformanceTests — Drop-in conformance suite. v1 has no read surface, so cross-record visibility tests are deferred to v2 — the suite only exercises what is observable through saveMemory, updateMemory, `deleteMem...

Interfaces

  • ConformanceOptions — Conformance harness arguments. Pass describe, it, and expect directly from bun:test / vitest / jest — keeps the package framework-agnostic via dependency injection.
  • DeleteMemoryInput
  • InMemoryProviderOptions
  • MemoryActor — Caller principal. Every primitive operation carries one. The provider uses this to enforce scope ACL (if it implements ACL) and to populate record provenance. Future versions MAY add more principal...
  • MemoryProvider — Provider contract. Consumers implement this against the storage backend of their choice (in-process map, key-value store, document database, etc.) and pass the implementation to the runtime composi...
  • MemoryRecord — Canonical record shape returned by save/update. Providers MUST populate all required fields; optional fields are present iff the provider's capabilities advertise support.
  • ProviderCapabilities — Capability discovery — consumers can probe provider behavior without hard-coding backend assumptions. Providers MUST return this from capabilities().
  • SaveMemoryInput
  • UpdateMemoryInput

Types

  • MemoryScope — Where a memory entry is visible. Caller resolves identity before calling — there is no "self" sentinel. The provider treats the scope as opaque for storage and as input to ACL when ACL is supported.
  • MemoryType — Open enum. Recommended initial subset; providers MAY accept additional type strings, but consumers SHOULD pick from this list when possible so cross-provider queries (via fetchContext) can filter c...

Exports

  • type InMemoryProviderOptions

Import paths

The API section above lists every documented export across both the package's main entry and its /testing subpath. Real consumer imports are split between them — picking the wrong path is a compile error, so it pays to know which symbol lives where.

Main entry@agents-js/memory — runtime types and the provider contract (always available, zero runtime deps):

import {
  type MemoryActor,
  type MemoryScope,
  type MemoryType,
  type MemoryRecord,
  type MemoryProvider,
  type SaveMemoryInput,
  type UpdateMemoryInput,
  type DeleteMemoryInput,
  type ProviderCapabilities,
  MemoryAclError,
  MemoryRevisionConflictError,
} from "@agents-js/memory";

Testing subpath@agents-js/memory/testing — conformance harness, reference provider, and helpers (test-time only; not intended for production code paths):

import {
  runProviderConformanceTests,
  type ConformanceOptions,
  InMemoryProvider,
  type InMemoryProviderOptions,
  createMockActor,
} from "@agents-js/memory/testing";

The conformance harness takes describe, it, and expect directly from any compatible framework (bun:test, vitest, jest):

import { describe, expect, it } from "bun:test";
import {
  InMemoryProvider,
  runProviderConformanceTests,
} from "@agents-js/memory/testing";

runProviderConformanceTests({
  describe,
  it,
  expect,
  makeProvider: () => new InMemoryProvider(),
});

License

MIT