Skip to content

Using bulk APIs/calls on entities during saveAll #552

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Conversation

raphaeldelio
Copy link
Contributor

@raphaeldelio raphaeldelio commented Feb 19, 2025

Work In Progress

Within saveAll methods (SimpleRedisEnhancedRepository & SimpleRedisDocumentRepository):

  • Calling new processEntities() before iterating through all entities.

processEntities():

  • Based on processEntity()
  • Uses embedding functions to create embeddings in bulks
  • Remap created embeddings into the original entity list (destination field)

Methods for creating bulk embeddings already existed for sentence embeddings, but had to be created for image and face embeddings.

DefaultEmbedder:

  • Cleaned up

Tests:

  • To test embeddings are created and mapped correctly, I use the existing Vectorize Test classes and compare the embeddings of the saveAll method with the embeddings of the save method.

Will create benchmarks to compare bulk embedding with original implementation.

@raphaeldelio raphaeldelio changed the title WIP: Using bulk APIs/calls on entities during saveAll Using bulk APIs/calls on entities during saveAll Feb 20, 2025
Copy link
Contributor

@bsbodden bsbodden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great contribution!

@raphaeldelio raphaeldelio merged commit a7c7d0f into redis:main Feb 20, 2025
4 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SaveAll on entities with embeddings should use bulk APIs/calls if available from provider
2 participants