Skip to content

Conversation

wulifu2hao
Copy link

issue: langchain-ai/langchain#23853

description: unlike the PGEmbedding class (which uses "pg_embedding" extension) , the PGVector class (which uses "pg_vector" extension) currently doesn't support HNSW index. Since the pg_embedding project is deprecated since 2023 https://github.com/neondatabase/pg_embedding and it is encouraged to move to pg_vector, I added the HNSW support in the PGVector class


return create_index_query

def create_hnsw_index(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anyway to move this to a classmethod, so we can create the ahead of time.

I want to create a control plane -- that allows managing the indexes without having to actually instantiate an index.

class IndexManager:
  def list_indexes(**kwargs) -> List[Dict]:
  
def get_index(id) -> VectorStore:
   pass

 def create_index(**kwargs) -> str:
    pass

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @eyurtsev thanks for the feedback. Honestly I'm not too sure how to do this as this is my first PR to the project. Feel free to commandeer the PR (or merge it and create a new one if it makes more sense)

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.

2 participants