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

@galdor/memory-s3vectors

v0.3.1

Published

Amazon S3 Vectors long-term memory store for galdor-bun, implementing the core memory.Store interface.

Readme

@galdor/memory-s3vectors

An Amazon S3 Vectors long-term memory store for galdor. It implements the core memory.Store interface, so it drops in behind a Retriever exactly like the bundled InMemoryStore — but persists vectors in an S3 Vectors index.

Credentials

Resolved by the AWS SDK's default provider chain (environment variables → shared ~/.aws config → ECS container credentials → EC2 IMDS / task role). No static keys are accepted here; configure AWS the standard way.

Usage

import { openS3Vectors } from "@galdor/memory-s3vectors";
import { Retriever } from "@galdor/core/memory";

// Probes the index and creates it if missing.
const store = await openS3Vectors({
  bucket: "my-vectors",     // an existing S3 Vectors bucket
  index: "galdor-chunks",   // optional; default "galdor-chunks", created if absent
  region: "us-east-1",      // optional; default from the AWS chain
  dim: 1024,                // embedding dimensionality
  // distance: "cosine",    // optional; default cosine (ignored if the index exists)
});

await store.add([
  { id: "c1", documentId: "d1", index: 0, text: "…", embedding: vec, metadata: { lang: "es" } },
]);

const hits = await store.retrieve({ embedding: queryVec, k: 5, filter: { lang: "es" } });
// hits: Result[] in descending relevance (higher score = more relevant)

await store.delete("d1"); // removes every chunk of document d1
await store.close();

Compose it with an embedder via Retriever for text queries:

const retriever = new Retriever({ store, embedder, defaultK: 5 });
const hits = await retriever.retrieve({ text: "capital of Ecuador" });

Behavior

  • Open — validates bucket/dim/index name, then probes the index; if missing, creates it as float32, the configured dim and distance metric, with __text declared non-filterable.
  • add — upserts each chunk keyed by its id (idempotent). Stores the embedding plus documentId, index, text and any chunk metadata. Rejects empty ids, dimension mismatches, and metadata keys using the reserved __ prefix. Batched at 500 vectors per call.
  • retrieve — top-K nearest by the query embedding; filter is an exact-match AND over metadata (single key bare, multiple keys via $and). Cosine distance becomes 1 - distance (anti-correlated hits dropped); Euclidean becomes 1 / (1 + distance).
  • delete — scans the index and removes every vector whose documentId metadata matches; batched at 500 keys per call.
  • close — destroys the underlying client.

Notes

  • Vector-only: retrieve requires query.embedding.
  • The metadata keys __document_id, __index, __text are reserved.