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

@alineo-labs/postgres-memory

v0.2.4

Published

Shared, multi-process `@alineo-labs/memory` backend for [alineo](https://alineo.tech), via Postgres.

Readme

@alineo-labs/postgres-memory

Shared, multi-process @alineo-labs/memory backend for alineo, via Postgres.

bun add @alineo-labs/postgres-memory

For local dev with zero infrastructure, use @alineo-labs/sqlite-memory instead.


Usage

import { Memory } from "@alineo-labs/memory";
import {
  PostgresWorkingMemoryProvider,
  PostgresSemanticMemoryProvider,
} from "@alineo-labs/postgres-memory";

const memory = new Memory({
  workingMemory: new PostgresWorkingMemoryProvider(connectionString),
  semantic: new PostgresSemanticMemoryProvider(connectionString, myEmbeddingProvider),
});

Migrations run lazily on first query — no separate connect() step.

Team isolation

Rows carrying a ResourceRef.teamId are isolated via row-level security: every query runs inside a transaction that first sets app.team_id for that transaction, and each table's RLS policy only allows access to rows where team_id is NULL or matches. FORCE ROW LEVEL SECURITY is set so this applies even to the role that owns the tables. See src/migrations.ts for the exact policy.

Vector search

recall() uses a real pgvector HNSW index whenever the connected Postgres instance allows CREATE EXTENSION IF NOT EXISTS vector (on by default on Supabase/Neon, allowlisted on RDS, unavailable on a bare Postgres with no superuser access) — falling back to an in-JS cosine-similarity scan over every row for the resource otherwise. Check PostgresSemanticMemoryProvider.hasVectorIndex to see which path is active; the plain vector (double precision[]) column on alineo_semantic_memory is always populated regardless, so the fallback is never a degraded schema, only a slower code path over the same data. The indexed path's own table (alineo_semantic_vec, created lazily once the embedding dimension is known) gets identical row-level-security policies to the primary table, so scoping doesn't depend on which path a given call takes.

This package has not been run against a live Postgres instance in this repo's own test suite (none is available here) — it ships type-checked, matching @alineo-labs/postgres's own testing posture, not integration-tested against a real server. That applies to this HNSW path too: it's implemented against pgvector's documented SQL surface, not verified against a live instance with the extension installed.


License

Apache 2.0