-
Notifications
You must be signed in to change notification settings - Fork 8.2k
feat: add oceanbase vector store support #10668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughAdds OceanBase support: dependency declaration, frontend icon components for the OceanBase logo, a lazy-export wrapper, a new OceanBaseVectorStoreComponent with connectivity/indexing/search logic, and unit tests covering build/search/error cases. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant OceanBaseComponent
participant pymysql
participant Embedding
participant OceanbaseVectorStore
Caller->>OceanBaseComponent: build_vector_store(args)
OceanBaseComponent->>pymysql: open/test connection
alt connection error
pymysql-->>OceanBaseComponent: error
OceanBaseComponent-->>Caller: raise ValueError
else success
OceanBaseComponent->>OceanBaseComponent: prepare documents & index params
OceanBaseComponent->>Embedding: compute embeddings (if needed)
OceanBaseComponent->>OceanbaseVectorStore: create via from_texts(...) or init(...)
OceanbaseVectorStore-->>OceanBaseComponent: store instance
OceanBaseComponent-->>Caller: return store
end
Caller->>OceanBaseComponent: search_documents(query, params)
OceanBaseComponent->>OceanbaseVectorStore: perform similarity search / retriever
OceanbaseVectorStore-->>OceanBaseComponent: docs + scores
alt similarity_score_threshold set
OceanBaseComponent->>OceanBaseComponent: filter by score
end
OceanBaseComponent-->>Caller: List[Data]
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Suggested reviewers
Pre-merge checks and finishing touchesImportant Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 2 warnings)
✅ Passed checks (6 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/lfx/src/lfx/components/oceanbase/oceanbase.py (1)
19-20: Reconsider priority and recommended settings for a new component.Setting
priority = 0andrecommended = Truemakes this component appear first and marked as recommended. For a newly added community contribution, consider using default priority values and letting the component prove itself before marking it as recommended.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
src/frontend/src/assets/oceanbase_logo.pngis excluded by!**/*.pnguv.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
pyproject.toml(1 hunks)src/backend/tests/unit/components/vectorstores/test_oceanbase.py(1 hunks)src/frontend/src/icons/OceanBase/OceanBase.jsx(1 hunks)src/frontend/src/icons/OceanBase/index.tsx(1 hunks)src/lfx/src/lfx/components/oceanbase/__init__.py(1 hunks)src/lfx/src/lfx/components/oceanbase/oceanbase.py(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-06-23T12:46:52.420Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: Export custom icon components in React using React.forwardRef to ensure proper ref forwarding and compatibility with parent components.
Applied to files:
src/frontend/src/icons/OceanBase/index.tsx
📚 Learning: 2025-06-16T11:14:04.200Z
Learnt from: dolfim-ibm
Repo: langflow-ai/langflow PR: 8394
File: src/frontend/src/icons/Docling/index.tsx:4-6
Timestamp: 2025-06-16T11:14:04.200Z
Learning: The Langflow codebase consistently uses `React.PropsWithChildren<{}>` as the prop type for all icon components using forwardRef, rather than `React.SVGProps<SVGSVGElement>`. This is an established pattern across hundreds of icon files in src/frontend/src/icons/.
Applied to files:
src/frontend/src/icons/OceanBase/index.tsxsrc/frontend/src/icons/OceanBase/OceanBase.jsx
📚 Learning: 2025-06-23T12:46:52.420Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).
Applied to files:
src/frontend/src/icons/OceanBase/index.tsx
🧬 Code graph analysis (4)
src/lfx/src/lfx/components/oceanbase/__init__.py (1)
src/lfx/src/lfx/components/oceanbase/oceanbase.py (1)
OceanBaseVectorStoreComponent(9-260)
src/lfx/src/lfx/components/oceanbase/oceanbase.py (3)
src/backend/base/langflow/helpers/data.py (1)
docs_to_data(14-23)src/lfx/src/lfx/inputs/inputs.py (7)
BoolInput(418-431)DropdownInput(470-496)FloatInput(382-415)HandleInput(74-85)IntInput(346-379)SecretStrInput(287-343)StrInput(126-182)src/lfx/src/lfx/schema/data.py (2)
Data(26-288)to_lc_document(142-152)
src/frontend/src/icons/OceanBase/index.tsx (1)
src/frontend/src/icons/OceanBase/OceanBase.jsx (2)
SvgOceanBase(3-26)SvgOceanBase(3-26)
src/backend/tests/unit/components/vectorstores/test_oceanbase.py (2)
src/lfx/src/lfx/components/oceanbase/oceanbase.py (5)
OceanBaseVectorStoreComponent(9-260)build_vector_store(93-188)_get_index_params(190-214)_get_search_params(216-227)search_documents(229-260)src/lfx/src/lfx/schema/data.py (1)
Data(26-288)
🪛 GitHub Actions: Ruff Style Check
src/backend/tests/unit/components/vectorstores/test_oceanbase.py
[error] 157-157: Ruff lint error: TRY003 Avoid specifying long messages outside the exception class.
🪛 GitHub Check: Ruff Style Check (3.13)
src/backend/tests/unit/components/vectorstores/test_oceanbase.py
[failure] 157-157: Ruff (EM101)
src/backend/tests/unit/components/vectorstores/test_oceanbase.py:157:35: EM101 Exception must not use a string literal, assign to variable first
[failure] 157-157: Ruff (TRY003)
src/backend/tests/unit/components/vectorstores/test_oceanbase.py:157:23: TRY003 Avoid specifying long messages outside the exception class
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
- GitHub Check: Test Docker Images / Test docker images
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 4
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 1
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 5
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
- GitHub Check: Run Backend Tests / LFX Tests - Python 3.10
- GitHub Check: Run Backend Tests / Integration Tests - Python 3.10
- GitHub Check: Run Frontend Unit Tests / Frontend Jest Unit Tests
- GitHub Check: Lint Backend / Run Mypy (3.13)
- GitHub Check: Lint Backend / Run Mypy (3.12)
- GitHub Check: Test Starter Templates
- GitHub Check: Update Component Index
🔇 Additional comments (10)
src/lfx/src/lfx/components/oceanbase/oceanbase.py (4)
190-214: Well-implemented index parameter logic.The method correctly handles all supported index types with appropriate parameters and provides a sensible fallback to HNSW for unknown types.
216-227: Good search parameter handling.The method correctly provides index-specific search parameters with a sensible fallback, consistent with the
_get_index_paramsapproach.
229-260: Robust search implementation.The method handles query validation, score threshold parsing with proper error handling, and correctly uses the vector store's retriever API with appropriate search parameters.
126-132: Port conversion to string is correct and matches library requirements.The
langchain-oceanbaselibrary expects the port as a string inconnection_args(e.g., "2881"), and the code correctly converts it usingstr(self.port)at line 128. This implementation aligns with the documented examples and requirements.src/lfx/src/lfx/components/oceanbase/__init__.py (1)
1-34: LGTM! Standard lazy loading pattern.The implementation follows the established lazy loading pattern in the codebase with proper error handling and caching.
src/backend/tests/unit/components/vectorstores/test_oceanbase.py (1)
1-453: Excellent test coverage.The test suite comprehensively covers building vector stores, error scenarios, parameter handling for different index types, and search functionality including edge cases like empty queries and invalid score thresholds.
src/frontend/src/icons/OceanBase/index.tsx (1)
1-10: LGTM! Follows established icon patterns.The component correctly uses
forwardRefwithReact.PropsWithChildren<{}>as the prop type, consistent with the codebase convention for icon components.Based on learnings
src/frontend/src/icons/OceanBase/OceanBase.jsx (2)
3-26: Icon component structure looks good.The SVG wrapper correctly embeds the logo image with appropriate sizing and preserveAspectRatio settings. The
filter: "none"style prevents unwanted CSS filter inheritance.
1-1: No issues found—asset exists at the expected path.The verification confirms that
oceanbase_logo.pngis present atsrc/frontend/src/assets/, matching the import path in the code. The import statement is valid.pyproject.toml (1)
93-93: No issues found.The package
langchain-oceanbaseexists on PyPI with multiple released versions including 0.2.0. The dependency constraint>=0.2.0is valid, and no security vulnerabilities were reported for this package.
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.
Close #10638
Oceanbase supports vector storage and querying, and has strong vector ecological capabilities

Summary by CodeRabbit
New Features
Improvements
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.