Commit Graph
13 Commits
Author SHA1 Message Date
utkarsh240799andClaude Opus 4.6 596a624716 fix: improve double-embedding fix with type safety and UPDATE path test (#3723)
Make isinstance checks numpy-safe by using `not isinstance(dict)` instead
of `isinstance(list)`, add type hints to existing_embeddings parameter,
and add regression test for the infer=True UPDATE path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:35:18 +05:30
Varun Chawlaandkartik-mem0 211a7570e7 Fix: prevent double embedding in mem0.add (fixes #3723)
This fix addresses issue #3723 where mem0.add() was calling the
embedding API twice, unnecessarily doubling costs and latency.

Changes made:
1. Modified _create_memory() to accept embeddings as either a dict
   (for caching) or a precomputed vector, preventing redundant calls
2. Updated infer=False path to pass embeddings as a dict
3. Added caching for action_text embeddings in infer=True path for
   both ADD and UPDATE operations, since the LLM may rephrase facts
4. Applied same fixes to both sync and async Memory classes
5. Added regression test to verify embedding is called only once

The root cause was that when infer=False, embeddings were passed
directly to _create_memory without a dict wrapper, causing it to
re-embed. When infer=True, if the LLM rephrased extracted facts,
the action_text wouldn't match the cache key, triggering re-embedding.
2026-03-23 14:15:05 +05:30
KartikandGitHub 2b9558335b fix: raise ValueError when deleting nonexistent memory (#4455) 2026-03-20 18:28:58 +05:30
577a5a2feb fix(oss): normalize malformed LLM fact output before embedding (#4224)
Co-authored-by: kartik-mem0 <kartik.labhshetwar@mem0.ai>
2026-03-18 20:19:29 +05:30
Parth SharmaandGitHub 84687fc3d2 [fix] list' object has no attribute 'id' - Id fault with chroma pinecone and other providers (#3693) 2025-10-31 16:46:10 +05:30
Vishaal LSandGitHub 9000576173 fix: handle non-serializable objects in config deepcopy (#3464) (#3544) 2025-10-09 19:35:08 +05:30
Vishaal LSandGitHub 58cc44ff38 fix: handle missing 'data' key in memory payload during search operations (#3524) 2025-09-30 15:10:43 -07:00
e4c5582808 fix-migration-collection-override (#3100)
Co-authored-by: parshvadaftari <daftariparshva@gmail.com>
2025-08-21 00:11:28 +05:30
Parshva DaftariandGitHub 4433666117 Fix failing tests (#3162) 2025-07-25 00:58:45 +05:30
Deshraj YadavandGitHub 55c54beeab [Misc] Lint code and fix code smells (#1871) 2024-09-16 17:39:54 -07:00
Jaimin GodhaniandGitHub 28bc4fe05b Improve: consistency in the test_memory.py (#1777) 2024-08-29 11:36:01 -07:00
Dev KhantandGitHub e585d3c1cc Skip few tests in Mem0 (#1625) 2024-08-01 08:31:57 -07:00
f842a92e25 Rename embedchain to mem0 and open sourcing code for long term memory (#1474)
Co-authored-by: Deshraj Yadav <deshrajdry@gmail.com>
2024-07-12 20:21:33 +05:30