crate-workbench / langchain

⚡ Building applications with LLMs through composability ⚡
https://python.langchain.com
MIT License
0 stars 0 forks source link

CrateDB vector: Add `CrateDBVectorSearchMultiCollection` #15

Closed amotl closed 10 months ago

amotl commented 10 months ago

About

It is a special adapter which provides similarity search across multiple collections. It can not be used for indexing documents.

Synopsis

from langchain.vectorstores.cratedb import CrateDBVectorSearchMultiCollection

multisearch = CrateDBVectorSearchMultiCollection(
    collection_names=["test_collection_1", "test_collection_2"],
    embedding_function=embeddings,
    connection_string=CONNECTION_STRING,
)
docs_with_score = multisearch.similarity_search_with_score(query)

References

This patch has been conceived based on a feature request by @thunderbug1. Thanks!