Commit Graph

33 Commits

Author SHA1 Message Date
kartik-mem0 5e941e24c2 refactor: update search tests to use AND filter syntax and drop version param 2026-04-14 17:46:58 +05:30
kartik-mem0 c3f48d093e refactor: update MemoryClient to use entity options instead of filters 2026-04-14 17:13:52 +05:30
kartik-mem0 28cc8fcee4 refactor: update MemoryClient to use filters for entity parameters 2026-04-14 16:17:50 +05:30
Soumil Rathi c5e748b469 fix: remove all graph references from tests/test_main.py
Strip graph_memory patches, GraphStoreFactory mocks, graph_store config,
enable_graph parametrize, _add_to_graph assertions, and "relations"
assertions from all test fixtures and test functions. Graph store has
been removed from the codebase.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 13:14:40 -07:00
Soumil Rathi 66446bd118 fix: address reviewer bugs — metadata mutation, test args, embedding dict, output_format
1. Fix _create_procedural_memory metadata mutation: use spread operator
   instead of in-place dict assignment (sync + async)
2. Fix test_add assertion: remove trailing None arg that doesn't match
   _add_to_vector_store(messages, metadata, filters, infer) signature
3. Restore output_format: "v1.1" in TS client search payload as fallback
4. Fix infer=False path: pass {text: embedding} dict to _create_memory
   instead of raw embedding list to avoid redundant embed() calls (sync + async)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 11:50:56 -07:00
Soumil Rathi 3402c67805 fix: address PR review feedback
- Remove deprecated custom_update_memory_prompt from MemoryConfig entirely
- Add MAX_BATCH=100 chunking guard to embed_batch in openai.py and azure_openai.py
- Move all inline imports (mem0.utils.*) to top-level in main.py
- Remove custom_update_memory_prompt from test fixture

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 09:01:07 -07:00
Soumil Rathi b9e26acf4d merge: integrate main into feat/v3-pipeline + port AsyncMemory to v3
Merge 190 commits from main including:
- limit→top_k rename across all vector store APIs
- custom_fact_extraction_prompt→custom_instructions rename
- enable_graph flag removal (use self.graph truthiness)
- US/Pacific→timezone.utc normalization
- 18 Category A bug fixes (partial updates, graph cleanup on delete,
  telemetry gating, metadata mutation prevention, filter operator
  merging, delete timestamps, actor_id preservation, etc.)

Conflict resolutions:
- openai.py: merged _pass_dimensions_to_api with embed_batch
- milvus.py: merged partial-update logic with BM25 text field
- qdrant.py: took main's enhanced _create_filter, merged BM25
  sparse vectors with partial-update endpoints
- test_main.py: adopted main's test structure, removed obsolete
  test_custom_prompts, kept hybrid search over-fetch assertion

AsyncMemory v3 port (full parity):
- Rewrote AsyncMemory._add_to_vector_store with the same 8-phase
  batch pipeline as sync Memory (single LLM call, batch embed,
  hash dedup, batch persist, batch entity linking, message saving)
- All blocking calls wrapped in await asyncio.to_thread()
- Moved _build_session_scope to module level for shared access

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 16:26:10 -07:00
Kartik 9d6b79a14e fix(sdk): removing the enable graph flag and switching from snake case to camel case for client ts sdk (#4776)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 02:40:54 +05:30
Kartik e44b46ef2e fix(sdk): removing deprecating param from our sdk and docs changes with it (#4740) 2026-04-12 00:34:58 +05:30
Soumil Rathi a33c557a25 feat(oss): port v3 pipeline with hybrid search, entity extraction, and additive scoring
Replace the 2-LLM-call add pipeline with a single-pass additive extraction
using ADDITIVE_EXTRACTION_PROMPT. Memories now accumulate (ADD-only) instead
of being updated/deleted during extraction.

Search pipeline upgraded to hybrid scoring combining three signals:
- Semantic similarity (vector search)
- BM25 keyword matching (native per vector store, 15 stores supported)
- Entity boost (spaCy NER with entity collection linking)

Combined score = (semantic + bm25 + entity_boost) / max_possible, where
max_possible adapts based on which signals are active.

Key changes:
- Add spaCy-based lemmatization for BM25 keyword search
- Add spaCy-based entity extraction (PROPER, QUOTED, COMPOUND, NOUN types)
- Add entity store as second vector collection ({collection}_entities)
- Add native keyword_search() to 15 vector store adapters
- Add batch embedding support (embed_batch) for OpenAI and Azure OpenAI
- Add message persistence in SQLite (rolling window of 10 per scope)
- Add additive scoring with adaptive normalization
- Add observation_date parameter to add()
- Add custom_instructions config field
- Default search threshold changed to 0.1

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 14:09:37 -07:00
zaid khan 5edc0cc99f fix: update parameter added to the update function which is exposed t… (#3799)
Co-authored-by: utkarsh240799 <utkarsh240799@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 20:02:33 +05:30
Utkarsh 5332741961 fix: clean up graph store data on Memory.delete() (#4505)
Co-authored-by: utkarsh240799 <utkarsh240799@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 19:27:38 +05:30
dhilip_binny 35fe30aabd fix: ensure JSON instruction in prompts for json_object response format (#3559) (#4271) 2026-03-16 21:57:57 +05:30
Kartik 82d67430dd fix: remove destructive vector_store.reset() from delete_all() (#4349) 2026-03-16 20:55:29 +05:30
Kartik 8fcf2b0b29 fix: skip telemetry vector store init when MEM0_TELEMETRY is disabled (#4351) 2026-03-16 20:55:04 +05:30
DrJsPBs 26732771eb Fix Neo4j Cypher syntax error with agent_id filtering (#3158)
Co-authored-by: parshvadaftari <daftariparshva@gmail.com>
2025-08-08 09:08:13 -07:00
Deshraj Yadav 7484eed4b2 Fix CI issues related to missing dependency (#3096) 2025-07-03 18:52:50 -07:00
John Lockwood 7c0c4a03c4 Feat/add python version test envs (#2774) 2025-06-14 17:43:16 +05:30
Dev Khant d85fcda037 Formatting (#2750) 2025-05-22 01:17:29 +05:30
Prateek Chhikara 12a268da30 Added docs for criteria based filtering (#2726) 2025-05-19 14:52:43 -07:00
Dev Khant ec1d7a45d3 Fix all lint errors (#2627) 2025-05-06 01:16:02 +05:30
Dev Khant b8e4d0980a Memory Reset (#2558) 2025-04-16 16:36:45 +05:30
Dev Khant 2004427acd tools fix and formatting (#2441) 2025-03-26 11:25:03 +05:30
Wonbin Kim 66d3f9b93c Support Custom Prompt for Memory Action Decision (#2371) 2025-03-18 10:43:01 +05:30
Dev Khant d7a26bd0c3 Add infer param and version bump (#2389)
Co-authored-by: Deshraj Yadav <deshrajdry@gmail.com>
2025-03-18 01:04:58 +05:30
Dev Khant 4318663697 Make api_version=v1.1 default and version bump -> 0.1.59 (#2278)
Co-authored-by: Deshraj Yadav <deshrajdry@gmail.com>
2025-03-01 11:36:20 +05:30
Wonbin Kim 6acb00731d Add config option for vertex embedding tasks (#2266) 2025-02-28 15:20:05 +05:30
Dev Khant 605558da9d Code formatting (#1986) 2024-10-29 11:32:07 +05:30
Mayank 3f2d5bee34 [bug]: Memory.reset() deletes collection and table without re-creating it (#1952) 2024-10-15 16:46:50 +05:30
Parshva Daftari c689f94c52 [Add] Error handling for update method in OSS & platform code. (#1939) 2024-10-08 15:04:59 +05:30
Dev Khant 68c7355f47 Add limit in get_all and search for Graph (#1920) 2024-09-28 01:51:38 +05:30
Deshraj Yadav 55c54beeab [Misc] Lint code and fix code smells (#1871) 2024-09-16 17:39:54 -07:00
Prateek Chhikara b081e43b8d Modified the return statement for ADD call | Added tests to main.py and graph_memory.py (#1812) 2024-09-09 10:04:11 -07:00