Skip to main content

An integration package connecting Couchbase and LangChain

Project description

langchain-couchbase

This package contains the LangChain integration with Couchbase

Installation

pip install -U langchain-couchbase

Usage

The CouchbaseVectorStore class exposes the connection to the Couchbase vector store.

from langchain_couchbase.vectorstores import CouchbaseVectorStore

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)

# Wait until the cluster is ready for use.
cluster.wait_until_ready(timedelta(seconds=5))

embeddings = OpenAIEmbeddings()

vectorstore = CouchbaseVectorStore(
    cluster=cluster,
    bucket_name="",
    scope_name="",
    collection_name="",
    embedding=embeddings,
    index_name="vector-search-index",
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_couchbase-0.0.1.tar.gz (7.1 kB view hashes)

Uploaded Source

Built Distribution

langchain_couchbase-0.0.1-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page