feat: add OceanBase/seekdb vector and graph storage providers#2130
feat: add OceanBase/seekdb vector and graph storage providers#2130Evenss wants to merge 2 commits into
Conversation
Add optional OceanBase / seekdb backends reusing the existing BaseVecDB and BaseGraphDB contracts, without changing any default behavior. - vec_dbs/oceanbase.py: OceanBaseVecDB on top of pyseekdb's Collection API, serving General Memory; require a positive vector_dimension in config. - graph_dbs/oceanbase.py: OceanBaseGraphDB ported from the postgres backend (nodes + edges + JSON + VECTOR) over the MySQL-compatible protocol, with a thread-safe connection pool, atomic multi-step deletes, and identifier whitelisting (table_prefix / search_filter keys). - Register "oceanbase" / "seekdb" aliases in the vec/graph factories and config factories; add GraphDBError; declare the optional "ob-mem" extra. - Add contract tests for both providers.
🤖 Open Code ReviewTarget: PR #2130 🔍 OpenCodeReview found 12 issue(s) in this PR. 1.
|
…ection handling - Updated pyseekdb version constraints in pyproject.toml to restrict to <1.5.0. - Increased default embedding dimension in APIConfig from 768 to 1024. - Improved connection handling in OceanBaseGraphDB and OceanBaseVecDB to ensure better resource management and error handling. - Added validation for table prefix length in OceanBaseGraphDB to prevent identifier overflow. - Enhanced logging for empty password configurations in OceanBaseGraphDB. - Updated tests to reflect changes in search behavior and connection management.
✅ Automated Test Results: PASSEDAll tests passed (31/31 executed). memos_python_core/changed-repo-python: 31/31. Duration: 5s Branch: |
✅ Automated Test Results: PASSEDAll tests passed (31/31 executed). memos_python_core/changed-repo-python: 31/31. Duration: 6s Branch: |
Description
Add two optional storage providers for OceanBase / seekdb, reusing the existing
BaseVecDB/BaseGraphDBcontracts. No default behavior changes: unless a user selects theoceanbase/seekdbbackend, everything works exactly as before.vec_dbs/oceanbase.py): built on pyseekdb's Collection / vector API, serving General Memory. Config now enforces a positivevector_dimension.graph_dbs/oceanbase.py): ported from the PostgreSQL + pgvector backend (nodes + edges + JSON properties +VECTORcolumn) over the MySQL-compatible protocol. Includes a thread-safe connection pool (maxconnnow effective), atomic multi-step deletes, and identifier whitelisting fortable_prefix/search_filterkeys.oceanbase/seekdbaliases in the vector & graph factories and config factories; add theGraphDBErrorexception.Dependencies: adds an optional extra
ob-mem(containingpyseekdb); imports are guarded with try/except ImportError and are not added to core dependencies.Related Issue (Required): Fixes #2109
Type of change
How Has This Been Tested?
External seekdb / OceanBase drivers (pyseekdb / pymysql) are stubbed with mocks; no live server is required. A live-server smoke test is not included in this PR.
Checklist
Reviewer Checklist