-
Notifications
You must be signed in to change notification settings - Fork 20.2k
feat: Add Apache Doris vector store support #30476
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
Summary of ChangesHello @dataroaring, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates Apache Doris as a new vector database option within the Dify RAG system. This enhancement provides Dify users with an additional robust and scalable solution for managing and querying document embeddings, supporting advanced search functionalities like vector similarity, full-text, and hybrid search. The implementation focuses on performance and ease of configuration, leveraging Doris's native capabilities for efficient data handling. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces support for Apache Doris as a vector store, which is a significant feature addition. The implementation is well-structured, covering vector search, full-text search, and efficient data loading via StreamLoad. I've provided several suggestions to improve configurability, documentation clarity, and the robustness of the implementation, particularly around Doris-specific settings and the StreamLoad process. Addressing these points will make the integration more flexible and reliable for users with different Doris setups.
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.
Pull request overview
This PR adds Apache Doris as a new vector database option for Dify's RAG system, enabling vector similarity search, full-text search with BM25 scoring, and hybrid search capabilities. The implementation uses StreamLoad for high-performance bulk data loading and includes connection pooling for efficient resource management.
Key Changes:
- New DorisVector implementation with vector and full-text search capabilities
- Configuration model with connection pooling support
- Integration with existing vector factory pattern and database configuration system
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
api/core/rag/datasource/vdb/vector_type.py |
Added DORIS enum value to VectorType |
api/core/rag/datasource/vdb/vector_factory.py |
Added case for DORIS in vector factory switch statement |
api/core/rag/datasource/vdb/doris/doris_vector.py |
Main implementation including DorisVector class, DorisConfig, DorisConnectionPool, and DorisVectorFactory |
api/core/rag/datasource/vdb/doris/__init__.py |
Module exports for Doris vector database components |
api/configs/middleware/vdb/doris_config.py |
Pydantic configuration settings for Doris connection parameters |
api/configs/middleware/__init__.py |
Integrated DorisVectorConfig into middleware and added 'doris' as DB_TYPE option |
DORIS_SETUP.md |
Comprehensive setup guide with configuration examples and troubleshooting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
crazywoola
left a 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.
Please fix the errors in the lint and add the tests for this PR accordingly :)
1bd8c3a to
0640462
Compare
|
Please click Resolve if you think those comments are not necessary. |
86f2187 to
4042584
Compare
This commit adds Apache Doris as a new vector database option for Dify's RAG system. Features: - Vector similarity search using cosine distance - Full-text search with BM25 scoring and inverted indexes - Hybrid search combining vector and text search - High-performance bulk data loading via StreamLoad - Connection pooling for efficient resource management - Support for multi-tenant isolation Components added: - DorisVector: Main vector database implementation with cleaned code - DorisConfig: Configuration model with validation - DorisConnectionPool: Thread-safe connection management - DorisVectorFactory: Factory for creating Doris instances - DORIS_SETUP.md: Complete setup guide in English
- Add type annotations to fix mypy errors (pool config dict, params lists) - Add USE database statement in _get_cursor to ensure database context - Add _wait_for_table_normal_state method to wait for schema changes before creating text index (fixes index creation race condition) - Extend Redis lock timeout to accommodate schema change waiting - Update unit tests to account for new USE database statement
4042584 to
e111491
Compare
done |
This commit adds Apache Doris as a new vector database option for Dify's RAG system.
Features:
Components added:
Important
Fixes #<issue number>.Summary
Screenshots
Checklist
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods