mem0ai / mem0

The Memory layer for your AI apps
https://mem0.ai
Apache License 2.0
22.94k stars 2.11k forks source link

Add vector store integration of OceanBase for EmbedChain #1993

Open GITHUBear opened 3 weeks ago

GITHUBear commented 3 weeks ago

Description

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. Here we introduce OceanBase as an alternative vector store.

You can deploy a standalone OceanBase server by following steps:

  1. Start a docker container via the following command:

    docker run --name=ob433 -e MODE=slim -p 2881:2881 -d oceanbase/oceanbase-ce:4.3.3.0-100000142024101215
  2. Donwload the partner package:

    pip install --upgrade --quiet pyobvector
  3. Check the connection to OceanBase and set the memory usage ratio for vector data:

    
    from pyobvector import ObVecClient

tmp_client = ObVecClient() tmp_client.perform_raw_text_sql( "ALTER SYSTEM ob_vector_memory_limit_percentage = 30" )



Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Refactor (does not change functionality, e.g. code style improvements, linting)
- [ ] Documentation update

## How Has This Been Tested?

unittest in `embedchain/tests/vectordb/test_oceanbase.py`

Please delete options that are not relevant.

- [x] Unit Test
- [ ] Test Script (please provide)

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules
- [x] I have checked my code and corrected any misspellings

## Maintainer Checklist

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] Made sure Checks passed
CLAassistant commented 3 weeks ago

CLA assistant check
All committers have signed the CLA.

GITHUBear commented 2 weeks ago

Hi @Dev-Khant , could you please review my PR? Any feedback will be valuable. Thank you!

HanMxSJ commented 2 weeks ago

Oceanbase is an important database of Alibaba Group, and OB's capabilities can help improve the adaptation of embedchain. The relevant code is very important to me, I need this feature, can you merge it ASAP.