Skip to main content

An integration package connecting OceanBase and LangChain

Project description

langchain-oceanbase

This package contains the LangChain integration with OceanBase.

OceanBase Database is a distributed relational database. It is developed entirely by Ant Group. The OceanBase Database is built on a common server cluster. Based on the Paxos protocol and its distributed structure, the OceanBase Database provides high availability and linear scalability.

OceanBase currently has the ability to store vectors. Users can easily perform the following operations with SQL:

  • Create a table containing vector type fields;
  • Create a vector index table based on the HNSW algorithm;
  • Perform vector approximate nearest neighbor queries;
  • ...

Features

  • Vector Storage: Store embeddings from any LangChain embedding model in OceanBase with automatic table creation and index management.
  • Similarity Search: Perform efficient similarity searches on vector data with multiple distance metrics (L2, cosine, inner product).
  • Hybrid Search: Combine vector search with sparse vector search and full-text search for improved results with configurable weights.
  • Maximal Marginal Relevance: Filter for diversity in search results to avoid redundant information.
  • Multiple Index Types: Support for HNSW, IVF, FLAT and other vector index types with automatic parameter optimization.
  • Sparse Embeddings: Native support for sparse vector embeddings with BM25-like functionality.
  • Advanced Filtering: Built-in support for metadata filtering and complex query conditions.
  • Async Support: Full support for async operations and high-concurrency scenarios.

Installation

pip install -U langchain-oceanbase

Requirements

  • Python >=3.10
  • langchain-core >=1.0.0
  • pyobvector >=0.2.17

Tip: The current version supports langchain-core >=1.0.0

We recommend using Docker to deploy OceanBase:

docker run --name=oceanbase -e MODE=mini -e OB_SERVER_IP=127.0.0.1 -p 2881:2881 -d oceanbase/oceanbase-ce:latest

For AI Functions support, use OceanBase 4.4.1 or later:

docker run --name=oceanbase -e MODE=mini -e OB_SERVER_IP=127.0.0.1 -p 2881:2881 -d oceanbase/oceanbase-ce:4.4.1.0-100000032025101610

More methods to deploy OceanBase cluster

Usage

Documentation Formats

Choose your preferred format:

Additional Resources

Hybrid Search Sections:

AI Functions Sections:

Quick Start

Get started quickly with the following sections:

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_oceanbase-0.2.7.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_oceanbase-0.2.7-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

Details for the file langchain_oceanbase-0.2.7.tar.gz.

File metadata

  • Download URL: langchain_oceanbase-0.2.7.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for langchain_oceanbase-0.2.7.tar.gz
Algorithm Hash digest
SHA256 94cce86a5c93efbea19442682e5561ec28135127344bdc64a4cfa316d98aeab0
MD5 0cfa7ad7b92dd233f592805b3b82c2e6
BLAKE2b-256 9203dcff99be843054dc94d10ad3d1ad2a5513246e15f4b52f607e8269619f80

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_oceanbase-0.2.7.tar.gz:

Publisher: python-publish.yml on oceanbase/langchain-oceanbase

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_oceanbase-0.2.7-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_oceanbase-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 908845f7ff8e8c0932879ae97f08c71e6c7a869694f187e974b24c40fe198b2a
MD5 2b0e4a5287f3afb2cdacfeb7f6e711d8
BLAKE2b-256 58bead22d7f7a1f741493e590394dec6622a229b4b3b0142b150c4046689d652

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_oceanbase-0.2.7-py3-none-any.whl:

Publisher: python-publish.yml on oceanbase/langchain-oceanbase

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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