[GH-ISSUE #2156] [BUG]: Default Vector Database LanceDB not compatible with text-embedding-ada-002 #1405

Closed
opened 2026-02-22 18:24:38 -05:00 by yindo · 11 comments
Owner

Originally created by @davadev on GitHub (Aug 21, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2156

How are you running AnythingLLM?

Docker (local)

What happened?

I got this error when trying to chat in my workspace.

Could not respond to message.
Failed to execute query stream: Invalid input, No vector column found to match with the query vector dimension: 1536

I found this article pointing that this issue is likely caused by the vector database expecting different dimensions.

If this can be configured, it would be useful to know where, or add the configuration option in anythingllm

Are there known steps to reproduce?

Set LLM to openai GPT-4o-mini and the embedding modell to text-embedding-ada-002 while keeping the default database LanceDB.

Originally created by @davadev on GitHub (Aug 21, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2156 ### How are you running AnythingLLM? Docker (local) ### What happened? I got this error when trying to chat in my workspace. > Could not respond to message. > Failed to execute query stream: Invalid input, No vector column found to match with the query vector dimension: 1536 I found this [article](https://medium.com/@epappas/dealing-with-vector-dimension-mismatch-my-experience-with-openai-embeddings-and-qdrant-vector-20a6e13b6d9f) pointing that this issue is likely caused by the vector database expecting different dimensions. If this can be configured, it would be useful to know where, or add the configuration option in anythingllm ### Are there known steps to reproduce? Set LLM to openai **GPT-4o-mini** and the embedding modell to **text-embedding-ada-002** while keeping the default database LanceDB.
yindo added the possible bug label 2026-02-22 18:24:38 -05:00
yindo closed this issue 2026-02-22 18:24:38 -05:00
Author
Owner

@timothycarambat commented on GitHub (Aug 21, 2024):

It is compatible, what you did was you embedded something into the workspace using the (likely) default embedder which is 386 dimensions.

  • You then removed that document from the workspace, swapped embedders to text-embedding-ada-002
  • Probably did not see the warning telling you that this error would occur!
  • then embed a new doc into the same workspace which now expects 386 dimension vectors.
    -Embedded the text worked, but failed to upsert because the table schema was already set.

Solution:
Open workspace settings > Vector database > Reset Vector Database
Now you can insert you new document. You should also delete the previously embed document or else you will get an error when you try to insert it into the 1536-dimension table.

Workspace vector tables infer their dimensionality on the first embedding. Afterward, this property is immutable until the db is reset or the workspace deleted.

Did you not get an error when swapping models? You should have seen a popup alerting you that this would need to be done.

https://docs.anythingllm.com/setup/embedder-configuration/overview#supported-embedding-model-providers

@timothycarambat commented on GitHub (Aug 21, 2024): It is compatible, what you did was you embedded something into the workspace using the (likely) default embedder which is 386 dimensions. - You then removed that document from the workspace, swapped embedders to text-embedding-ada-002 - Probably did not see the warning telling you that this error would occur! - then embed a new doc into the same workspace which now expects 386 dimension vectors. -Embedded the text worked, but failed to upsert because the table schema was already set. Solution: Open workspace settings > Vector database > Reset Vector Database Now you can insert you new document. You should also delete the previously embed document or else you will get an error when you try to insert it into the 1536-dimension table. Workspace vector tables infer their dimensionality on the first embedding. Afterward, this property is immutable until the db is reset or the workspace deleted. Did you not get an error when swapping models? You should have seen a popup alerting you that this would need to be done. https://docs.anythingllm.com/setup/embedder-configuration/overview#supported-embedding-model-providers
Author
Owner

@davadev commented on GitHub (Aug 21, 2024):

Sorry, apparently my steps to reproduce were not complete. I did see the warning, and did reset the workspace several times and then reimport the documents again. I even deleted the workspace and created new one where I only used openai LLM and embedder. Could it be the reset is not working properly?

@davadev commented on GitHub (Aug 21, 2024): Sorry, apparently my steps to reproduce were not complete. I did see the warning, and did reset the workspace several times and then reimport the documents again. I even deleted the workspace and created new one where I only used openai LLM and embedder. Could it be the reset is not working properly?
Author
Owner

@pm7y commented on GitHub (Sep 2, 2024):

I am also seeing the same issue. It seems you not only have to remove the document from the workspace (the right had side), but also delete the document altogether from "My documents" on the left.

@pm7y commented on GitHub (Sep 2, 2024): I am also seeing the same issue. It seems you not only have to remove the document from the workspace (the right had side), but also delete the document altogether from "My documents" on the left.
Author
Owner

@davadev commented on GitHub (Sep 2, 2024):

Good to know, I only got rid of it after Reinstalling…

@davadev commented on GitHub (Sep 2, 2024): Good to know, I only got rid of it after Reinstalling…
Author
Owner

@timothycarambat commented on GitHub (Sep 3, 2024):

You could have just reset the workspaces vector DB or deleted the workspace and/or previously embedded documents

@timothycarambat commented on GitHub (Sep 3, 2024): You could have just reset the workspaces vector DB or deleted the workspace and/or previously embedded documents
Author
Owner

@pm7y commented on GitHub (Sep 3, 2024):

Mate, we're both saying we tried that but it didn't work.

@pm7y commented on GitHub (Sep 3, 2024): Mate, we're both saying we tried that but it didn't work.
Author
Owner

@DangerousBerries commented on GitHub (Oct 31, 2024):

I deleted all documents from "My documents" on the left before changing the embedding model and re-uploaded all documents once the model was changed, also got this error.

@DangerousBerries commented on GitHub (Oct 31, 2024): I deleted all documents from "My documents" on the left before changing the embedding model and re-uploaded all documents once the model was changed, also got this error.
Author
Owner

@timothycarambat commented on GitHub (Oct 31, 2024):

@DangerousBerries you need to delete the workspace (this deletes the table). Or you can open the workspace's settings >Vector database > Reset vector database. This does the same.

The lanceDB table schema is set on the first seen vector, removing all the documents just results in no documents in the table, not modification of its schema

@timothycarambat commented on GitHub (Oct 31, 2024): @DangerousBerries you need to delete the workspace (this deletes the table). Or you can open the workspace's settings >Vector database > Reset vector database. This does the same. The lanceDB _table_ schema is set on the first seen vector, removing all the documents just results in no documents in the table, not modification of its schema
Author
Owner

@DangerousBerries commented on GitHub (Nov 1, 2024):

@DangerousBerries you need to delete the workspace (this deletes the table). Or you can open the workspace's settings >Vector database > Reset vector database. This does the same.

The lanceDB table schema is set on the first seen vector, removing all the documents just results in no documents in the table, not modification of its schema

Yeah reset vector database worked thank you.

@DangerousBerries commented on GitHub (Nov 1, 2024): > @DangerousBerries you need to delete the workspace (this deletes the table). Or you can open the workspace's settings >Vector database > Reset vector database. This does the same. > > The lanceDB _table_ schema is set on the first seen vector, removing all the documents just results in no documents in the table, not modification of its schema Yeah reset vector database worked thank you.
Author
Owner

@kabaluyot commented on GitHub (Dec 13, 2024):

Re-uploading the files after resetting vector database works

@kabaluyot commented on GitHub (Dec 13, 2024): Re-uploading the files after resetting vector database works
Author
Owner

@teury commented on GitHub (May 19, 2025):

It was super difficult but I solved it like this.
.env (File)

Motor de embedding (native, openai, gemini, ollama, localai, voyage…)

EMBEDDING_ENGINE=openai
EMBEDDING_MODEL_PREF=text-embedding-ada-002
GENERIC_OPEN_AI_EMBEDDING_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxx
...... gemini .....
EMBEDDING_ENGINE=gemini
EMBEDDING_MODEL_PREF=text-embedding-004
GEMINI_EMBEDDING_API_KEY="tu_api_key"
You put this in your docker-compose.
Wow, what a scare! I had a database with hundreds of thousands of pages.
DOC: https://github.com/Mintplex-Labs/anything-llm/blob/master/docker/.env.example

@teury commented on GitHub (May 19, 2025): It was super difficult but I solved it like this. .env (File) # Motor de embedding (native, openai, gemini, ollama, localai, voyage…) EMBEDDING_ENGINE=openai EMBEDDING_MODEL_PREF=text-embedding-ada-002 GENERIC_OPEN_AI_EMBEDDING_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxx ...... gemini ..... EMBEDDING_ENGINE=gemini EMBEDDING_MODEL_PREF=text-embedding-004 GEMINI_EMBEDDING_API_KEY="tu_api_key" You put this in your docker-compose. Wow, what a scare! I had a database with hundreds of thousands of pages. DOC: https://github.com/Mintplex-Labs/anything-llm/blob/master/docker/.env.example
yindo changed title from [BUG]: Default Vector Database LanceDB not compatible with text-embedding-ada-002 to [GH-ISSUE #2156] [BUG]: Default Vector Database LanceDB not compatible with text-embedding-ada-002 2026-06-05 14:40:36 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1405