From 5311426d92b75eaed23e10cdd6ef4a63c91b76a0 Mon Sep 17 00:00:00 2001 From: techiejd <62455039+techiejd@users.noreply.github.com> Date: Mon, 22 Jun 2026 15:03:14 +0700 Subject: [PATCH] chore: add changeset for unreleased read primitives (1.1.0) Consolidates the unreleased changes since 1.0.1 into one minor changeset: findByIds (#62), searchByEmbedding (#68), populateEmbedding (#70), and the mongodb search field-parity fix (#63). Also sets onlyUpdatePeerDependentsWhenOutOfRange so the fixed package group resolves to a minor (1.1.0) instead of a major peer-dependency cascade. --- .changeset/config.json | 3 +++ .../read-primitives-and-populate-embedding.md | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 .changeset/read-primitives-and-populate-embedding.md diff --git a/.changeset/config.json b/.changeset/config.json index d2c86a0..30fd434 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -11,5 +11,8 @@ "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", + "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { + "onlyUpdatePeerDependentsWhenOutOfRange": true + }, "ignore": [] } diff --git a/.changeset/read-primitives-and-populate-embedding.md b/.changeset/read-primitives-and-populate-embedding.md new file mode 100644 index 0000000..2ca556c --- /dev/null +++ b/.changeset/read-primitives-and-populate-embedding.md @@ -0,0 +1,16 @@ +--- +"payloadcms-vectorize": minor +"@payloadcms-vectorize/pg": minor +"@payloadcms-vectorize/cf": minor +"@payloadcms-vectorize/mongodb": minor +--- + +Add vector read primitives and the ability to retrieve stored embedding vectors. + +- **`vectorizedPayload.findByIds({ knowledgePool, ids, populateEmbedding })`** — batch-fetch embedding records by id, returning `Record` (misses map to `undefined`). Implemented across the pg, cf, and mongodb adapters. +- **`vectorizedPayload.searchByEmbedding({ knowledgePool, embedding, where, limit, populateEmbedding })`** — run a vector search directly from a raw embedding vector, skipping the query-embedding step. This is the "more like this" primitive: feed it the `embedding` returned by `findByIds({ populateEmbedding: true })` to find similar content. Result shape and `where` filtering match `search()`. Unlike `search()`, it does not run reranking even on a pool configured with `rerank`, since rerankers operate on the original query text. Local API only. +- **`populateEmbedding?: boolean`** option (default `false`) on `search()` and `searchByEmbedding()` — when `true`, each result includes its stored embedding vector. `VectorSearchResult` and `EmbeddingRecord` now expose `embedding?: number[]`. + +Fix: + +- **mongodb adapter** `search()` now returns all stored fields (including extension fields) on each result, matching the pg and cf adapters for cross-adapter parity.