Skip to content
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

No HNSW index in pgvector vector store #23853

Closed
5 tasks done
holasoftware opened this issue Jul 4, 2024 · 4 comments
Closed
5 tasks done

No HNSW index in pgvector vector store #23853

holasoftware opened this issue Jul 4, 2024 · 4 comments
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature Ɑ: vector store Related to vector store module

Comments

@holasoftware
Copy link

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

Not applicable

Error Message and Stack Trace (if applicable)

No response

Description

There is no HNSW index in the pgvector vector store:

https://github.com/langchain-ai/langchain/blob/master/libs/community/langchain_community/vectorstores/pgvector.py

Unlike the pgembedding vectore store:

https://github.com/langchain-ai/langchain/blob/master/libs/community/langchain_community/vectorstores/pgembedding.py#L192

System Info

Not applicable

@dosubot dosubot bot added Ɑ: vector store Related to vector store module 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Jul 4, 2024
@wulifu2hao
Copy link
Contributor

Hi @holasoftware , I wonder why you need the hnsw index functionality to be available in pgvector.py if it is already in pgembedding.py ?

@wulifu2hao
Copy link
Contributor

@jackbravo
Copy link

jackbravo commented Jul 18, 2024

Hi @holasoftware , I wonder why you need the hnsw index functionality to be available in pgvector.py if it is already in pgembedding.py ?

pgembedding is not for pgvector, but for pg_embedding. They are different postgres extensions. And actually there is also pgvecto_rs (docs), meant for the third pg extension pgvecto.rs :-p.

So this PR is for pgvector, which is I think more widely used, since that extension is supported by AWS and GCP, for example.

@holasoftware
Copy link
Author

pg_embedding and pgvector are 2 different postgresSQL extensions. Without the HNSW index in the embedding field, the pgvector vector store is not making an efficient search. I suppose that it's making an exhaustive search.

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Oct 19, 2024
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2024
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature Ɑ: vector store Related to vector store module
Projects
None yet
Development

No branches or pull requests

3 participants