Skip to content

Conversation

christian-bromann
Copy link
Member

Previously, PrismaVectorStore only used UPDATE statements when adding vectors, which caused silent failures when used with ParentDocumentRetriever. The retriever creates new child documents that don't exist in the database, so UPDATE statements would succeed but not create any records.

Changes:

  • Add new addDocumentsWithVectors method that uses INSERT statements to create records
  • Modify addDocuments to use addDocumentsWithVectors instead of addVectors
  • Maintain backward compatibility by keeping the original addVectors method unchanged
  • Add tests to verify the new behavior and ensure no regression

This fix ensures PrismaVectorStore works correctly with ParentDocumentRetriever while maintaining compatibility with existing code.

Fixes #8833

…umentRetriever compatibility (#8833)

Previously, PrismaVectorStore only used UPDATE statements when adding vectors, which caused
silent failures when used with ParentDocumentRetriever. The retriever creates new child
documents that don't exist in the database, so UPDATE statements would succeed but not
create any records.

Changes:
- Add new `addDocumentsWithVectors` method that uses INSERT statements to create records
- Modify `addDocuments` to use `addDocumentsWithVectors` instead of `addVectors`
- Maintain backward compatibility by keeping the original `addVectors` method unchanged
- Add tests to verify the new behavior and ensure no regression

This fix ensures PrismaVectorStore works correctly with ParentDocumentRetriever while
maintaining compatibility with existing code.

Fixes #8833
Copy link

changeset-bot bot commented Sep 12, 2025

🦋 Changeset detected

Latest commit: c0b26c4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@langchain/community Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

vercel bot commented Sep 12, 2025

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

Project Deployment Preview Comments Updated (UTC)
langchainjs-docs Ready Ready Preview Comment Sep 12, 2025 8:52pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
langchainjs-api-refs Ignored Ignored Sep 12, 2025 8:52pm

Add INSERT support to PrismaVectorStore for compatibility with ParentDocumentRetriever.
@ivaaaan
Copy link

ivaaaan commented Sep 20, 2025

I've faced this issue. Basically, PrismaVectorStore is not usable if you're trying to store multiple chunks per document. Are there plans to merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not use ParentDocumentRetriever with Prisma
2 participants