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
More methods to deploy OceanBase cluster
Usage
Documentation Formats
Choose your preferred format:
- Jupyter Notebook - Interactive notebook with executable code cells
- Markdown - Static documentation for easy reading
Additional Resources
- Hybrid Search Guide - Interactive notebook for hybrid search features
- Hybrid Search Guide (Markdown) - Static documentation for hybrid search
Hybrid Search Sections:
- Setup - Deploy OceanBase and install packages
- Vector Search - Semantic similarity matching
- Sparse Vector Search - Keyword-based exact matching
- Full-text Search - Content-based text search
- Multi-modal Search - Combined search strategies
Quick Start
Get started quickly with the following sections:
- Setup - Deploy OceanBase and install dependencies
- Initialization - Configure and create vector store
- Manage vector store - Add, update, and delete vectors
- Query vector store - Search and retrieve vectors
- Build RAG(Retrieval Augmented Generation) - Build powerful RAG applications
- Full-text Search - Implement full-text search capabilities
- Hybrid Search - Combine vector and text search for better results
- Advanced Filtering - Metadata filtering and complex query conditions
- Maximal Marginal Relevance - Filter for diversity in search results
- Multiple Index Types - Different vector index types (HNSW, IVF, FLAT)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_oceanbase-0.2.6.tar.gz.
File metadata
- Download URL: langchain_oceanbase-0.2.6.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bae52d0e6c8b5ef4439d4a2b691045c461d60ad48136a95b8adfd475c4361be5
|
|
| MD5 |
a409ba19d8dc7a95d176a61cab8adef3
|
|
| BLAKE2b-256 |
89a20fb49d3bd818b0382276ce5588cff877ca1a5c0468d8e4821fb71ffcfa9d
|
Provenance
The following attestation bundles were made for langchain_oceanbase-0.2.6.tar.gz:
Publisher:
python-publish.yml on oceanbase/langchain-oceanbase
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_oceanbase-0.2.6.tar.gz -
Subject digest:
bae52d0e6c8b5ef4439d4a2b691045c461d60ad48136a95b8adfd475c4361be5 - Sigstore transparency entry: 705191197
- Sigstore integration time:
-
Permalink:
oceanbase/langchain-oceanbase@a02d739e0640a507b112ee9136428900de246e3a -
Branch / Tag:
refs/tags/release-v0.2.6 - Owner: https://github.com/oceanbase
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@a02d739e0640a507b112ee9136428900de246e3a -
Trigger Event:
release
-
Statement type:
File details
Details for the file langchain_oceanbase-0.2.6-py3-none-any.whl.
File metadata
- Download URL: langchain_oceanbase-0.2.6-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb1d189ed393a571c22d221640cf0ccb3dcfdf09a4bf9b90682fe958a74c4c8d
|
|
| MD5 |
89bab5a76baffbdb1df54a7a4c9302b6
|
|
| BLAKE2b-256 |
20667acd2d9466b611cd256b2fc1279df2b0c12da8a2850b43b76eae6e2f052f
|
Provenance
The following attestation bundles were made for langchain_oceanbase-0.2.6-py3-none-any.whl:
Publisher:
python-publish.yml on oceanbase/langchain-oceanbase
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_oceanbase-0.2.6-py3-none-any.whl -
Subject digest:
bb1d189ed393a571c22d221640cf0ccb3dcfdf09a4bf9b90682fe958a74c4c8d - Sigstore transparency entry: 705191199
- Sigstore integration time:
-
Permalink:
oceanbase/langchain-oceanbase@a02d739e0640a507b112ee9136428900de246e3a -
Branch / Tag:
refs/tags/release-v0.2.6 - Owner: https://github.com/oceanbase
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@a02d739e0640a507b112ee9136428900de246e3a -
Trigger Event:
release
-
Statement type: