0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00
mastra/stores/pg
dane-ai-mastra[bot] a5859ee2b9
chore: version packages (alpha) (#30430)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
History 2026-11-16 14:09:31 +01:00
..
scripts perf(pg): reduce warm init from ~350 round trips to 6 (#20394) 2026-07-30 23:08:13 +02:00
src refactor(factory): skip legacy migration tables on new databases (#30488) 2026-11-16 13:11:56 +01:00
.gitignore feat: combine @mastra/vector-pg and @mastra/store-pg into @mastra/pg (#1777) 2025-02-07 11:51:45 -08:00
CHANGELOG.md chore: version packages (alpha) (#30430) 2026-11-16 14:09:31 +01:00
docker-compose.benchmark.yaml chore(deps): update docker images (#28011) 2026-10-29 15:53:50 +00:00
docker-compose.perf.yaml update prettier lint (#4189) 2025-05-14 16:22:14 +02:00
docker-compose.pooler.yaml chore(deps): update docker images (#28011) 2026-10-29 15:53:50 +00:00
docker-compose.vnext.yaml draft: Add v-next Postgres observability storage domain (#16760) 2026-06-05 16:00:43 -07:00
docker-compose.yaml chore(deps): update docker images (#28011) 2026-10-29 15:53:50 +00:00
lint-staged.config.js refactor(lint): replace ESLint with type-aware oxlint (#27476) 2026-10-18 10:38:35 -07:00
package.json chore: version packages (alpha) (#30430) 2026-11-16 14:09:31 +01:00
README.md docs: point store READMEs at the new integrations vector pages (#28970) 2026-10-30 11:31:23 +01:00
tsconfig.build.json chore: fix go-to-definition using tsc declaration maps (#6089) 2025-07-30 15:41:00 -07:00
tsconfig.json test(pg): run store test files in parallel on per-worker databases (#29093) 2026-11-10 16:32:30 -07:00
tsdown.config.ts feat(storage): add LibSQL and PostgreSQL Knowledge v2 schema (#26018) 2026-10-08 23:34:57 -07:00
turbo.json chore: migrate package builds to tsdown (#19829) 2026-07-28 12:32:21 +02:00
vitest.config.ts test(pg): run store test files in parallel on per-worker databases (#29093) 2026-11-10 16:32:30 -07:00
vitest.global-setup.ts test(pg): run store test files in parallel on per-worker databases (#29093) 2026-11-10 16:32:30 -07:00
vitest.perf.config.ts Postgresql Storage Query Index Performance (#7757) 2025-09-12 15:02:33 -04:00
vitest.pooler.config.ts fix(pg): pin DDL to a single backend during PostgresStore.init() to fix observability timeout (#17833) 2026-06-12 09:00:01 -07:00
vitest.setup.ts test(pg): run store test files in parallel on per-worker databases (#29093) 2026-11-10 16:32:30 -07:00

@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

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.