Couchbase Vector Store vector store.
To use it, you need
couchbase libraryExample:
.. code-block:: python
from langchain_community.vectorstores import CouchbaseVectorStore from langchain_openai import OpenAIEmbeddings
from couchbase.cluster import Cluster from couchbase.auth import PasswordAuthenticator from couchbase.options import ClusterOptions from datetime import timedelta
auth = PasswordAuthenticator(username, password) options = ClusterOptions(auth) connect_string = "couchbases://localhost" cluster = Cluster(connect_string, options)
cluster.wait_until_ready(timedelta(seconds=5))
embeddings = OpenAIEmbeddings()
vectorstore = CouchbaseVectorStore( cluster=cluster, bucket_name="", scope_name="", collection_name="", embedding=embeddings, index_name="vector-index", )
vectorstore.add_texts(["hello", "world"]) results = vectorstore.similarity_search("ola", k=1)