Skip to content

Conversation

@Sbboss
Copy link

@Sbboss Sbboss commented Dec 21, 2025

Description

  • Reuse precomputed embeddings when infer=False (sync/async) so mem0.add no longer calls the embedder twice.
  • Allow _create_memory to accept provided embeddings; avoids redundant API calls.
  • Update Azure AI Search vector query to use k (current SDK) and adjust the test accordingly.
  • Add regression test to ensure infer=False embeds once and uses the main vector store.

Fixes #3723

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

MEM0_DIR=$PWD/.mem0 pytest -p no:rerunfailures tests/

Please delete options that are not relevant.

  • Unit Test

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Made sure Checks passed

@CLAassistant
Copy link

CLAassistant commented Dec 21, 2025

CLA assistant check
All committers have signed the CLA.

@Sbboss
Copy link
Author

Sbboss commented Dec 26, 2025

@parthshr370 pls review this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mem0.add will call API twice

2 participants