mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-08 08:38:48 +00:00
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. |
||
---|---|---|
.. | ||
agents | ||
callbacks | ||
chains | ||
data_connection | ||
memory | ||
model_io | ||
paul_graham_essay.txt | ||
state_of_the_union.txt |