langchain/libs/partners/couchbase
Christophe Bornet 038c287b3a
all: Improve make lint command (#25344)
* Removed `ruff check --select I` as `I` is already selected and checked
in the main `ruff check` command
* Added checks for non-empty `PYTHON_FILES`
* Run `ruff check` only on `PYTHON_FILES`

Co-authored-by: Erick Friis <erick@langchain.dev>
2024-08-23 18:23:52 -07:00
..
langchain_couchbase [docs]: vector store integration pages (#24858) 2024-08-06 17:20:27 +00:00
scripts patch[Partners] Unified fix of incorrect variable declarations in all check_imports (#25014) 2024-08-03 13:49:41 -04:00
tests couchbase: [patch] Return chat message history in order (#24498) 2024-07-22 23:30:29 +00:00
.gitignore
LICENSE
Makefile all: Improve make lint command (#25344) 2024-08-23 18:23:52 -07:00
poetry.lock couchbase: Add chat message history (#24356) 2024-07-17 15:22:42 -07:00
pyproject.toml couchbase: [patch] Return chat message history in order (#24498) 2024-07-22 23:30:29 +00:00
README.md

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",
)