feat: support tidb vector
Description
https://github.com/langgenius/dify/issues/4381
Support TiDB Vector for knowledge.
- add pymysql,
pymysql1.1.1 andtidb-vector0.0.9
TiDB Vector doc: https://docs.google.com/document/d/15eAO0xrvEd6_tTxW_zEko4CECwnnSwQg8GGrqK1Caiw/edit
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)
- [ ] This change requires a documentation update, included: Dify Document
- [ ] Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
- [ ] Dependency upgrade
How Has This Been Tested?
VECTOR_STORE: tidb_vector
TIDB_VECTOR_HOST: xxxx.eu-central-1.xxxx.aws.tidbcloud.com
TIDB_VECTOR_PORT: 4000
TIDB_VECTOR_USER: xxxxxx.root
TIDB_VECTOR_PASSWORD: xxxxxx
TIDB_VECTOR_DATABASE: dify
Dify knowledge screenshot:
Tidb Cloud Chat2Qery screenshot:
- [x] TODO update dify document for tidb vector https://github.com/langgenius/dify-docs
Suggested Checklist:
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] My changes generate no new warnings
- [ ] I ran
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods - [ ]
optionalI have made corresponding changes to the documentation - [ ]
optionalI have added tests that prove my fix is effective or that my feature works - [ ]
optionalNew and existing unit tests pass locally with my changes
pls add the TIDB deploy docker-compose file and the unit test for TIDB, thanks @Weaxs
pls add the TIDB deploy docker-compose file and the unit test for TIDB, thanks @Weaxs
TIDB vector feature is not open source currently, it will be opened at the end of year, So it is only used by tidb cloud now and no mirrors for deploying. 🥲
hi @Weaxs , sorry for replying to you so late, you can refer to tencent vector db’s unit test , commit below : https://github.com/langgenius/dify/pull/3568/files#diff-4c59736efdfdaff3b01f2ea5fe03ff75dbb1c5d767c16898d524e3d0d53467aa
hi @Weaxs , sorry for replying to you so late, you can refer to tencent vector db’s unit test , commit below : https://github.com/langgenius/dify/pull/3568/files#diff-4c59736efdfdaff3b01f2ea5fe03ff75dbb1c5d767c16898d524e3d0d53467aa
I have submitted api/tests/integration_tests/vdb/tidb_vector/test_tidb_vector.py in this PR.
Could you please review it when you have time, thx