Error: inconsistent dimensions in the vector table, When changing the embedding model of the empty knowledge base and uploading documents. #7585

Closed
opened 2026-02-21 18:21:21 -05:00 by yindo · 6 comments
Owner

Originally created by @liyan36 on GitHub (Jan 8, 2025).

Originally assigned to: @JohnJyong on GitHub.

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. chang the embedding model of the empty knowledge base
  2. uploading documents to knowledge base

✔️ Expected Behavior

Document indexing failed, retrying do not work.

Actual Behavior

vector dimension conflict!

Originally created by @liyan36 on GitHub (Jan 8, 2025). Originally assigned to: @JohnJyong on GitHub. ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.15.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. chang the embedding model of the empty knowledge base 2. uploading documents to knowledge base ### ✔️ Expected Behavior Document indexing failed, retrying do not work. ### ❌ Actual Behavior vector dimension conflict!
yindo added the 👻 feat:rag label 2026-02-21 18:21:21 -05:00
yindo closed this issue 2026-02-21 18:21:21 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 8, 2025):

Hello @liyan36! I'm here to help you with any bugs, questions, or contributions you have for the Dify project. Let's work together to resolve the issue you're experiencing.

To resolve the "inconsistent dimensions in the vector table" error in Dify version 0.15.0, you can follow these steps:

  1. Ensure that the embedding model is set to 'text-embedding-ada-002' in the general dataset settings, as this model uses the expected embedding dimension of 1536.
  2. Check the settings of each document in your dataset to identify any that are using different embedding models, which may cause dimension mismatches (e.g., 1536 vs 3072).
  3. Reindex the documents using the same embedding model to ensure consistent dimensions across all documents. This will resolve the shape alignment error between different vector dimensions [1].

These steps should help resolve the error by ensuring all documents have consistent embedding dimensions.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot[bot] commented on GitHub (Jan 8, 2025): <!-- Greeting --> Hello @liyan36! I'm here to help you with any bugs, questions, or contributions you have for the Dify project. Let's work together to resolve the issue you're experiencing. <!-- Answer --> To resolve the "inconsistent dimensions in the vector table" error in Dify version 0.15.0, you can follow these steps: 1. Ensure that the embedding model is set to 'text-embedding-ada-002' in the general dataset settings, as this model uses the expected embedding dimension of 1536. 2. Check the settings of each document in your dataset to identify any that are using different embedding models, which may cause dimension mismatches (e.g., 1536 vs 3072). 3. Reindex the documents using the same embedding model to ensure consistent dimensions across all documents. This will resolve the shape alignment error between different vector dimensions <sup>[[1]](https://github.com/langgenius/dify/issues/11598)</sup>. These steps should help resolve the error by ensuring all documents have consistent embedding dimensions. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/36929325-1f90-4364-adfd-bf29b85fc178?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/36929325-1f90-4364-adfd-bf29b85fc178?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/36929325-1f90-4364-adfd-bf29b85fc178?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/36929325-1f90-4364-adfd-bf29b85fc178?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/36929325-1f90-4364-adfd-bf29b85fc178?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/36929325-1f90-4364-adfd-bf29b85fc178?feedback_type=other)</sup>
Author
Owner

@liyan36 commented on GitHub (Jan 8, 2025):

@jyong @dosu 申请成功开发者解决该问题

@liyan36 commented on GitHub (Jan 8, 2025): @jyong @dosu 申请成功开发者解决该问题
Author
Owner

@dosubot[bot] commented on GitHub (Jan 8, 2025):

This is a tough nut to crack, could really use your help on this, @takatost.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot[bot] commented on GitHub (Jan 8, 2025): <!-- Answer --> This is a tough nut to crack, could really use your help on this, @takatost. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/32340fd6-7f55-4024-9d18-8ed39657f899?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/32340fd6-7f55-4024-9d18-8ed39657f899?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/32340fd6-7f55-4024-9d18-8ed39657f899?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/32340fd6-7f55-4024-9d18-8ed39657f899?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/32340fd6-7f55-4024-9d18-8ed39657f899?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/32340fd6-7f55-4024-9d18-8ed39657f899?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Jan 8, 2025):

For empty datasets you can not change the embedding models, see image's below.
image

@crazywoola commented on GitHub (Jan 8, 2025): For empty datasets you can not change the embedding models, see image's below. <img width="865" alt="image" src="https://github.com/user-attachments/assets/b61b28d6-e3f1-4034-9f73-2f80424b332f" />
Author
Owner

@liyan36 commented on GitHub (Jan 8, 2025):

@crazywoola
Reproduction steps:

  1. Upload a document to the knowledge base and select a specific embedding model.
  2. Delete the document in the knowledge base but do not delete the knowledge base itself, resulting in an empty knowledge base.
  3. Change the embedding model of the knowledge base.
  4. Upload a new document.
@liyan36 commented on GitHub (Jan 8, 2025): @crazywoola Reproduction steps: 1. Upload a document to the knowledge base and select a specific embedding model. 2. Delete the document in the knowledge base but do not delete the knowledge base itself, resulting in an empty knowledge base. 3. Change the embedding model of the knowledge base. 4. Upload a new document.
Author
Owner

@crazywoola commented on GitHub (Jan 8, 2025):

  1. Change the embedding model of the knowledge base.
  2. Upload a new document.

The embedding model in step 3 should be the same as step 4.
I reproduced this.

@crazywoola commented on GitHub (Jan 8, 2025): > 3. Change the embedding model of the knowledge base. > 4. Upload a new document. The embedding model in step 3 should be the same as step 4. I reproduced this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7585