New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@aibind/postgres

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aibind/postgres

PostgreSQL-backed StreamStore and ConversationStore for @aibind — works with pg, postgres.js, Neon, Supabase, and more

latest
Source
npmnpm
Version
0.4.0
Version published
Weekly downloads
3
-50%
Maintainers
1
Weekly downloads
 
Created
Source

@aibind/postgres

PostgreSQL-backed StreamStore and ConversationStore for @aibind. Works with pg (node-postgres), postgres.js, Neon, Supabase, Vercel Postgres, and any compatible client.

Install

npm install @aibind/postgres

Usage

// pg (node-postgres) — implements PostgresClient directly
import { Pool } from "pg";
import { PostgresStreamStore, PostgresConversationStore } from "@aibind/postgres";

const pool = new Pool({ connectionString: process.env.DATABASE_URL });

const streamStore = new PostgresStreamStore(pool);
const conversationStore = new PostgresConversationStore(pool);
// Neon serverless
import { neon } from "@neondatabase/serverless";
import { wrapNeon, PostgresStreamStore } from "@aibind/postgres";

const store = new PostgresStreamStore(wrapNeon(neon(process.env.DATABASE_URL!)));

Required schema

You must create these tables yourself — the store does not run migrations automatically.

CREATE TABLE aibind_stream_chunks (
  id   TEXT    NOT NULL,
  seq  INTEGER NOT NULL,
  data TEXT    NOT NULL,
  PRIMARY KEY (id, seq)
);

CREATE TABLE aibind_stream_status (
  id           TEXT    PRIMARY KEY,
  state        TEXT    NOT NULL DEFAULT 'active',
  error        TEXT,
  total_chunks INTEGER NOT NULL DEFAULT 0,
  expires_at   BIGINT  NOT NULL
);

CREATE TABLE aibind_conversations (
  session_id TEXT   PRIMARY KEY,
  data       TEXT   NOT NULL,
  expires_at BIGINT NOT NULL
);

Custom table names are supported via options — see the full docs.

Documentation

Full docs →

Keywords

postgres

FAQs

Package last updated on 06 Mar 2026

Related posts