Skip to content

Add initial support for PGVector #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

AbirFaisal
Copy link

@AbirFaisal AbirFaisal commented Feb 24, 2025

Changes:
Fix NODE_MODULE_VERSION error from "better-sqlite3"

Refactor get_vectorstore() into separate functions:
get_embeddings()
get_chromaDB_vectorstore(), this is the original but separated into a function of it's own.
get_PGVector_vectorstore(), this provides support for PGVector as the vectorstore

Add which_vectorstore to the function signature of get_vectorstore() to specify if ChromaDB or PGVector should be used.

Create config.py where various parameters for the backend can be set instead of being hardcoded.

Abir Faisal added 9 commits February 24, 2025 07:39
Fix NODE_MODULE_VERSION error from "better-sqlite3"
Add support for PGVector
langchain-postgres
psycopg[binary,pool]
Refactor:
embedding into get_embedding()

vectorstore to
get_vectorstore_chromaDB(), this maintains the original behavior
and
get_vectorstore_PGVector(), this returns a vectorstore that uses Postgres as the backend.
A unified configuration file for the backend.
Add missing requirements.
Improve PGVector support.
Missing pgvector package
Add initial support for PGVector as vectorstore backing.
@AbirFaisal AbirFaisal changed the title Update package.json Add initial support for PGVector Feb 25, 2025
@AbirFaisal
Copy link
Author

AbirFaisal commented Feb 25, 2025

To get it working you need to:

In config.py you need to:

  • set the host and port for postgres
  • set the username and password
  • set postgresVectorDatabase to the name of the database you created earlier, I've just called it "embeddings"

Also you'll have to set the which_vectorstore parameter to PGVector in get_vectorstore() in vectorstore.py to force it to use PGVector since this setting does not exist on the frontend.

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.

1 participant