fix: relax pgvector upper bound to <0.5#308
Open
paulflew wants to merge 1 commit into
Open
Conversation
The pgvector constraint ">=0.2.5,<0.4" prevents installing langchain-postgres alongside packages that require pgvector >=0.4.2 (e.g. lightrag-hku). The only pgvector API used is `pgvector.sqlalchemy.Vector`, which is unchanged across 0.2.x-0.4.x, so the upper bound can safely be relaxed to allow the 0.4 series. Fixes langchain-ai#307 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
|
Verified locally against the version this change unblocks:
The only pgvector API used is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
pgvectordependency is pinned to>=0.2.5,<0.4. This upper bound prevents installinglangchain-postgresalongside packages that requirepgvector>=0.4.2(e.g.lightrag-hku), causing unresolvable dependency conflicts.Fixes #307.
Change
Relax the upper bound to
>=0.2.5,<0.5, allowing the pgvector 0.4.x series while staying conservative (does not open up to an untested 0.5+).Why this is safe
The only pgvector API surface used by this package is
pgvector.sqlalchemy.Vector(langchain_postgres/vectorstores.py), which is unchanged across the 0.2.x–0.4.x line.Verification
uv lockresolves cleanly topgvector==0.4.2under the new constraint.uv sync --group testinstalls against 0.4.2, andfrom pgvector.sqlalchemy import Vector,import langchain_postgres, andfrom langchain_postgres import PGVector, PGVectorStoreall import successfully.uv.lockis regenerated and committed to stay in sync.