Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7c42c1a
WIP
techiejd Jan 29, 2026
bfbe191
fix: ignore node_modules everywhere
techiejd Feb 1, 2026
5e28697
Adds split_db_adapter to CI run
techiejd Feb 4, 2026
3b0fef6
feat(cf-adapter): add Cloudflare Vectorize adapter (#28)
dejan-velimirovic-calendly Feb 6, 2026
edfdd25
Preparing for automated pubishes. This one beta will be done by hand …
techiejd Feb 6, 2026
ce35542
Bumps version since we added deleteEmbeddings. Also runs tsc so that …
techiejd Feb 7, 2026
c1db547
Adds the type check to ci
techiejd Feb 7, 2026
d79cc0f
fixes type check
techiejd Feb 7, 2026
4a0ee51
removes silly double checking on split_db_adapter for push
techiejd Feb 7, 2026
d737cbe
Adds root pnpm workspace
techiejd Feb 7, 2026
79f686e
feat(cf-adapter): update query parameters and method for deleting emb…
dejan-velimirovic-calendly Feb 8, 2026
b1fc554
Bumps version to release
techiejd Feb 10, 2026
2a141dc
Better typings (#34)
techiejd Feb 14, 2026
227947a
Adds better id tracking for deletion and does only one search instead…
techiejd Feb 17, 2026
2751d10
Deduplicate shared logic across plugin and adapter packages (#36)
techiejd Feb 18, 2026
f83a8c9
Removes dead code (#37)
techiejd Feb 18, 2026
11280c7
Bumps version for rollout
techiejd Feb 18, 2026
303c939
Merge main (#40)
techiejd Feb 20, 2026
c959bcf
Merge main into split_db_adapter (beta.5) (#42)
techiejd Feb 26, 2026
53d289c
chore: update beta version
techiejd Feb 26, 2026
d11d4fe
Remove Cloudflare adapter to unblock main branch merge
techiejd Mar 5, 2026
c64bec5
docs: call for help adding more database adapters
techiejd Mar 5, 2026
ab898d4
chore: bump version to 0.7.0
techiejd Mar 5, 2026
c9e8844
Merge main into db-adapter-pg-only
techiejd Mar 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in the readme](https://github.com/changesets/changesets/blob/main/README.md)

## Usage

### Adding a changeset

Run `pnpm changeset` to create a new changeset. You'll be prompted to:
1. Select which packages have changed
2. Choose a bump type (major/minor/patch)
3. Write a summary of the changes

### Versioning

Run `pnpm changeset:version` to consume all pending changesets, bump versions, and update changelogs.

### Publishing

Run `pnpm release` to build and publish all packages to npm.
15 changes: 15 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "techiejd/payloadcms-vectorize" }
],
"commit": false,
"fixed": [
["payloadcms-vectorize", "@payloadcms-vectorize/pg"]
],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
89 changes: 85 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ on:
branches: [main]

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Type check all packages
run: pnpm build:types:all

test_int:
runs-on: ubuntu-latest

Expand All @@ -33,8 +53,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
node-version: '20'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
Expand All @@ -53,6 +73,52 @@ jobs:
IVFFLATLISTS: 1
TEST_ENV: 1

test_adapters_pg:
runs-on: ubuntu-latest

services:
postgres:
image: pgvector/pgvector:pg15
env:
POSTGRES_PASSWORD: password
POSTGRES_DB: payload_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5433:5432

steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Install pgvector extension
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client
PGPASSWORD=password psql -h localhost -p 5433 -U postgres -d payload_test -c "CREATE EXTENSION IF NOT EXISTS vector;"

- name: Run pg adapter tests
run: pnpm test:adapters:pg
env:
PAYLOAD_SECRET: test-secret-key
DIMS: 8
IVFFLATLISTS: 1
TEST_ENV: 1

test_e2e:
runs-on: ubuntu-latest

Expand All @@ -79,8 +145,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
node-version: '20'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
Expand All @@ -101,3 +167,18 @@ jobs:
DIMS: 8
IVFFLATLISTS: 1
TEST_ENV: 1

test:
runs-on: ubuntu-latest
needs: [typecheck, test_int, test_adapters_pg, test_e2e]
if: always()
steps:
- name: Check required jobs
run: |
if [ "${{ needs.typecheck.result }}" != "success" ] || \
[ "${{ needs.test_int.result }}" != "success" ] || \
[ "${{ needs.test_adapters_pg.result }}" != "success" ] || \
[ "${{ needs.test_e2e.result }}" != "success" ]; then
echo "One or more required jobs failed"
exit 1
fi
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
version: pnpm changeset:version
title: 'chore: version packages'
commit: 'chore: version packages'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
node_modules/
/.pnp
.pnp.js
.yarn/install-state.gz
Expand All @@ -20,6 +20,7 @@
# production
/build
/dist
/adapters/pg/dist

# misc
.DS_Store
Expand Down
102 changes: 102 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,108 @@

All notable changes to this project will be documented in this file.

## 0.7.0

### Breaking Changes

- **Database Adapter Architecture**: The plugin now uses a pluggable database adapter system. You must install a database adapter package (e.g., `@payloadcms-vectorize/pg`) separately from the core plugin.
- **`dbAdapter` option required**: The `payloadcmsVectorize()` plugin now requires a `dbAdapter` option pointing to your adapter's implementation.
- **`similarity` renamed to `score`**: The `VectorSearchResult.similarity` field has been renamed to `score` to be more generic across different distance metrics.

### Added

- **`@payloadcms-vectorize/pg` package**: PostgreSQL adapter for pgvector, extracted from the core plugin.
- **`DbAdapter` interface**: New interface for implementing custom database adapters. See `adapters/README.md`.
- **`deleteEmbeddings` on `DbAdapter`**: Adapters can now delete vectors when a document is deleted or re-indexed.

## 0.6.0-beta.5 - 2026-02-25

- Merges main into split_db_adapter (per-batch polling, coordinator/worker architecture, destroyPayload cleanup).

## 0.6.0-beta.4 - 2026-02-20

- Merges main with should embed changes.

## 0.6.0-beta - 2026-02-01

### Breaking Changes

- **Database Adapter Architecture**: The plugin now uses a pluggable database adapter system. You must install a database adapter package (e.g., `@payloadcms-vectorize/pg`) separately from the core plugin.
- **`createVectorizeIntegration` removed from core**: Use the adapter-specific integration factory instead (e.g., `createPostgresVectorIntegration` from `@payloadcms-vectorize/pg`).
- **`dbAdapter` option required**: The `payloadcmsVectorize()` plugin now requires a `dbAdapter` option pointing to your adapter's implementation.
- **`similarity` renamed to `score`**: The `VectorSearchResult.similarity` field has been renamed to `score` to be more generic across different distance metrics.

### Added

- **`@payloadcms-vectorize/pg` package**: PostgreSQL adapter for pgvector, extracted from the core plugin.
- **`DbAdapter` interface**: New interface for implementing custom database adapters. See `adapters/README.md`.
- **`deleteEmbeddings` on `DbAdapter`**: Adapters can now delete vectors when a document is deleted or re-indexed.
- **Adapter documentation**: Added `adapters/README.md` explaining how to create custom adapters.

### Migration

**Before (0.5.x)**

```typescript
import { createVectorizeIntegration } from 'payloadcms-vectorize'

const { afterSchemaInitHook, payloadcmsVectorize } = createVectorizeIntegration({
main: { dims: 1536, ivfflatLists: 100 },
})

export default buildConfig({
db: postgresAdapter({
afterSchemaInit: [afterSchemaInitHook],
}),
plugins: [
payloadcmsVectorize({
knowledgePools: {
main: {
/* ... */
},
},
}),
],
})
```

**After (0.6.0+)**

```typescript
import { createPostgresVectorIntegration } from '@payloadcms-vectorize/pg'
import payloadcmsVectorize from 'payloadcms-vectorize'

const integration = createPostgresVectorIntegration({
main: { dims: 1536, ivfflatLists: 100 },
})

export default buildConfig({
db: postgresAdapter({
afterSchemaInit: [integration.afterSchemaInitHook],
}),
plugins: [
payloadcmsVectorize({
dbAdapter: integration.adapter,
knowledgePools: {
main: {
/* ... */
},
},
}),
],
})
```

**Updating search result handling:**

```typescript
// Before
const score = result.similarity

// After
const score = result.score
```

## 0.5.5 - 2026-02-24

### Added
Expand Down
Loading
Loading