Skip to content

docs: fix the copy recipe that drops vectors, and document the limits the code already has - #59

Merged
PunGrumpy merged 5 commits into
mainfrom
docs/copy-recipe-and-limits
Oct 18, 2026
Merged

PunGrumpy merged 5 commits into
mainfrom
docs/copy-recipe-and-limits

Conversation

@PunGrumpy

Copy link
Copy Markdown
Owner

Stacked on #58 (and the stack under it: #57, #55, #54). Review the last five commits, from docs: fetch vectors when copying records between providers.

Background

The migration guide's "Copy the data" recipe didn't work. It said to fetch the records and upsert them into the new index, and that ids, vectors and metadata round-trip unchanged. fetch leaves vectors out unless you pass { includeVector: true }, so every copied record had vector: []; on PGlite the upsert returned invalid_argument "vector must have at least 1 dimension". Vectors also don't round-trip exactly: pgvector stores 32-bit floats, and Qdrant normalizes vectors in a cosine collection.

A few other statements were missing or contradicted the code:

  • Nothing mentioned pgvector's 2,000-dimension cap on HNSW indexes. createIndex with dimension: 2001 returns provider and creates nothing, on pgvector and Supabase, which rules out 3,072-dimension models like text-embedding-3-large.
  • Two pages said Vectorize reserves _namespace; it only reserves _id. They now also list the Upstash namespace rule from fix(upstash): keep namespaces apart on fetch and reject names the adapter cannot use #54.
  • The testing guide said the Upstash adapter creates a namespace; Upstash creates it on the first write.
  • The Upstash page and the README said to "page with a second query", but query has no offset or cursor.
  • The iterative-scan setting was described as lasting one statement; set_config(…, true) scopes it to the transaction.
  • Nothing said that Qdrant, Upstash and Vectorize read a . in a filter field as nesting, so a flat key like file.name can't be filtered there.

Summary

  • Migration guide: includeVector: true in the recipe, a short copy example, and an accurate precision note. The Qdrant page says cosine collections return normalized vectors.
  • The 2,000-dimension limit on the pgvector and Supabase pages and in the README.
  • Reserved keys, the Upstash namespace rule, the testing guide's Upstash sentence, and the paging advice corrected.
  • The iterative-scan duration on the pgvector page and in the README.
  • A "Metadata keys that contain a dot" section on the provider differences page, and one sentence in the README.

Docs only; no code change.

Verification

  • bun run check and bun run typecheck are clean, and an uncached turbo run build --filter=web compiles and generates all 64 pages.
  • The copy failure without includeVector, the 2,000-dimension error, and the transaction scope of the setting were observed on PGlite before writing the sentences.
  • The dot-in-field-name section rests on the providers' filter documentation and on what our compilers emit, not on a live run.

Checklist

  • Tests have been added or updated (docs only)
  • Documentation has been added or updated
  • A changeset has been added for vecstore-sdk (docs only; the site deploys with the next publish)
  • I have reviewed this pull request myself

@PunGrumpy PunGrumpy added the documentation Improvements or additions to documentation label Oct 18, 2026
@vercel

vercel Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
vecstore-sdk Ready Ready Preview Oct 18, 2026 9:48am UTC

@changeset-bot

changeset-bot Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1c74f03

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3e085d30-639b-4ee8-958a-89976366f6b5
📥 Commits

Reviewing files that changed from the base of the PR and between a4daf39 and 1c74f03.

📒 Files selected for processing: 9
  • apps/web/content/docs/core/store.mdx
  • apps/web/content/docs/guides/migration.mdx
  • apps/web/content/docs/guides/testing.mdx
  • apps/web/content/docs/providers/differences.mdx
  • apps/web/content/docs/providers/pgvector.mdx
  • apps/web/content/docs/providers/qdrant.mdx
  • apps/web/content/docs/providers/supabase.mdx
  • apps/web/content/docs/providers/upstash.mdx
  • packages/vecstore-sdk/README.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/vecstore-sdk@59

commit: 1c74f03

The copy recipe fetched records and upserted them, but fetch leaves
vectors out unless includeVector is set. Each fetched record then had an
empty vector, and upsert rejected it with invalid_argument. The recipe
now passes includeVector, shows the call, and no longer says vectors
round-trip unchanged. Vector databases generally store 32-bit floats,
and a Qdrant collection with the cosine metric stores unit-length
vectors, so the Qdrant page says so too.
pgvector's HNSW index holds at most 2,000 dimensions. createIndex with a
larger dimension returns a provider error and creates nothing, on both
the pgvector and Supabase adapters. That rules out 3,072-dimension
models such as text-embedding-3-large, and the error kind is provider,
not the invalid_argument a reader would expect for a dimension problem.
The pgvector and Supabase pages and the README now say so.
Vectorize reserves only the _id metadata key, not _namespace, and the
pages grouped it with Qdrant and Upstash. Upstash in metadata mode also
rejects a namespace holding a backslash or both quote characters, so the
sentence now says that.

The testing guide said the Upstash adapter creates a namespace, but
Upstash creates it on the first write. The Upstash page and the README
told readers to page with a second query, and query has no offset or
cursor, so a second query returns the same records. Both now say to ask
for a larger topK or loosen the filter.
The adapter sets hnsw.iterative_scan with set_config(..., true), which
scopes the setting to the current transaction. Under autocommit that is
the query's own statement, but a caller who passes a client inside an
explicit transaction keeps strict_order on until the transaction ends.
The pgvector page and the README said the setting lasted one statement.
Qdrant, Upstash, and Vectorize read a dot in a filter field name as a
step into a nested object, and the adapters store metadata flat. A
filter on a key such as file.name never sees the value there. The
differences page and the README now say to keep dots out of keys you
filter on. This rests on the providers' filter documentation and the
compilers, not on a live run.
@PunGrumpy
PunGrumpy force-pushed the docs/copy-recipe-and-limits branch from bde46cf to 1c74f03 Compare October 18, 2026 09:48
@PunGrumpy
PunGrumpy merged commit 833c05c into main Oct 18, 2026
13 of 14 checks passed

This branch was successfully deployed

1 active deployment
Preview — 1c74f03d Deployed Oct 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant