langchain/docs/extras/modules/data_connection
Raouf Chebri 6fc24743b7
Add pg_hnsw vectorstore integration (#6893)
Hi @rlancemartin, @eyurtsev!

- Description: Adding HNSW extension support for Postgres. Similar to
pgvector vectorstore, with 3 differences
      1. it uses HNSW extension for exact and ANN searches, 
      2. Vectors are of type array of real
      3. Only supports L2
      
- Dependencies: [HNSW](https://github.com/knizhnik/hnsw) extension for
Postgres
  
  - Example:
  ```python
    db = HNSWVectoreStore.from_documents(
      embedding=embeddings,
      documents=docs,
      collection_name=collection_name,
      connection_string=connection_string
  )
  
  query = "What did the president say about Ketanji Brown Jackson"
docs_with_score: List[Tuple[Document, float]] =
db.similarity_search_with_score(query)
  ```

The example notebook is in the PR too.
2023-07-05 08:10:10 -07:00
..
document_loaders/integrations added Brave Search document_loader (#6989) 2023-07-02 19:01:24 -07:00
document_transformers/text_splitters MD header text splitter returns Documents (#6571) 2023-06-22 09:25:38 -07:00
retrievers Minor updates to notebook for MultiQueryRetriever (#7102) 2023-07-03 17:32:50 -07:00
text_embedding/integrations Add SpacyEmbeddings class (#6967) 2023-07-03 09:38:31 -06:00
vectorstores/integrations Add pg_hnsw vectorstore integration (#6893) 2023-07-05 08:10:10 -07:00