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

@mastra/pg

Package Overview
Dependencies
Maintainers
7
Versions
1005
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
This package has malicious versions linked to the ongoing "Mastra AI framework compromise" supply chain attack.

Affected versions:

1.13.1
View campaign page

@mastra/pg

Postgres provider for Mastra - includes both vector and db storage capabilities

Source
npmnpm
Version
1.24.0-alpha.3
Version published
Weekly downloads
573K
19.1%
Maintainers
7
Weekly downloads
 
Created
Source

@mastra/pg

PostgreSQL implementation for Mastra, providing both vector similarity search (using pgvector) and general storage capabilities with connection pooling and transaction support.

Installation

npm install @mastra/pg

Usage

Vector Store

Basic Configuration

PgVector supports multiple connection methods:

1. Connection String (Recommended)

import { PgVector } from '@mastra/pg';

const vectorStore = new PgVector({
  connectionString: 'postgresql://user:pass@localhost:5432/db',
});

Documentation

  • @mastra/pg documentation

Changelog

See the package changelog for version history and release notes.

Support

We have an open community Discord. Come and say hello and let us know if you have any questions or need any help getting things running.

FAQs

Package last updated on 10 Sep 2026

Related posts