dify icon indicating copy to clipboard operation
dify copied to clipboard

feat: support tidb vector

Open Weaxs opened this issue 1 year ago • 2 comments

Description

https://github.com/langgenius/dify/issues/4381

Support TiDB Vector for knowledge.

  • add pymysql, pymysql 1.1.1 and tidb-vector 0.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: image

Tidb Cloud Chat2Qery screenshot: image

  • [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) and cd web && npx lint-staged(frontend) to appease the lint gods
  • [ ] optional I have made corresponding changes to the documentation
  • [ ] optional I have added tests that prove my fix is effective or that my feature works
  • [ ] optional New and existing unit tests pass locally with my changes

Weaxs avatar May 22 '24 11:05 Weaxs

pls add the TIDB deploy docker-compose file and the unit test for TIDB, thanks @Weaxs

JohnJyong avatar May 23 '24 10:05 JohnJyong

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. 🥲

Weaxs avatar May 23 '24 10:05 Weaxs

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

JohnJyong avatar Jun 04 '24 05:06 JohnJyong

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

Weaxs avatar Jun 04 '24 06:06 Weaxs