[GH-ISSUE #4544] [BUG]: Qdrant integration fails on document upload with more than 500 chunks #2888

Closed
opened 2026-02-22 18:31:42 -05:00 by yindo · 0 comments
Owner

Originally created by @aeromech-1 on GitHub (Oct 15, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4544

How are you running AnythingLLM?

All versions

What happened?

When uploading a large document that gets split into more than 500 chunks (the default Qdrant batch limit), the embedding process fails. The addDocumentToNamespace function in server/utils/vectorDbProviders/qdrant/index.js correctly splits the vectors into chunks but then incorrectly attempts to upsert all vectors at once, rather than iterating through the prepared chunks.

Are there known steps to reproduce?

To Reproduce

  1. Set up AnythingLLM with Qdrant as the vector database.
  2. Use an embedding model with a small chunk size (e.g., 1024).
  3. Upload a large document that will generate more than 500 vector chunks.
  4. Observe the server logs for an error during the client.upsert operation.

Expected behavior
The document should be successfully embedded by sending the vector chunks to Qdrant in multiple batches, each no larger than the batch limit.

Additional context
The issue is in the loop that processes toChunks(vectors, 500). The fix is to use the chunk variable inside the loop to create the batch for client.upsert, rather than using the full submission object.

Originally created by @aeromech-1 on GitHub (Oct 15, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4544 ### How are you running AnythingLLM? All versions ### What happened? When uploading a large document that gets split into more than 500 chunks (the default Qdrant batch limit), the embedding process fails. The `addDocumentToNamespace` function in `server/utils/vectorDbProviders/qdrant/index.js` correctly splits the vectors into chunks but then incorrectly attempts to upsert all vectors at once, rather than iterating through the prepared chunks. ### Are there known steps to reproduce? **To Reproduce** 1. Set up AnythingLLM with Qdrant as the vector database. 2. Use an embedding model with a small chunk size (e.g., 1024). 3. Upload a large document that will generate more than 500 vector chunks. 4. Observe the server logs for an error during the `client.upsert` operation. **Expected behavior** The document should be successfully embedded by sending the vector chunks to Qdrant in multiple batches, each no larger than the batch limit. **Additional context** The issue is in the loop that processes `toChunks(vectors, 500)`. The fix is to use the `chunk` variable inside the loop to create the batch for `client.upsert`, rather than using the full `submission` object.
yindo added the possible bug label 2026-02-22 18:31:42 -05:00
yindo closed this issue 2026-02-22 18:31:42 -05:00
yindo changed title from [BUG]: Qdrant integration fails on document upload with more than 500 chunks to [GH-ISSUE #4544] [BUG]: Qdrant integration fails on document upload with more than 500 chunks 2026-06-05 14:49:06 -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#2888