Skip to content

chore: upgrade mem0ai to 2.0.5 and adapt provider to the 2.0 search API#13

Merged
groksrc merged 1 commit into
mainfrom
chore/mem0-2.0.5
Jun 11, 2026
Merged

chore: upgrade mem0ai to 2.0.5 and adapt provider to the 2.0 search API#13
groksrc merged 1 commit into
mainfrom
chore/mem0-2.0.5

Conversation

@groksrc

@groksrc groksrc commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

The mem0-local provider was pinned to mem0ai==1.0.0 (November-era). mem0 has since shipped 2.0 (currently 2.0.5), whose Memory.search API is a breaking change:

  • entity scoping moved from a top-level user_id= kwarg to filters={"user_id": ...}
  • limit= became top_k=

The 2.0 API rejects the old call shape outright (_reject_top_level_entity_params), so the provider could not run against current mem0 at all — meaning headline comparisons were silently testing a major version behind mem0's current state.

Changes

  • Bump pin to mem0ai[nlp]==2.0.5 (the nlp extra activates mem0's spaCy lemma/keyword pipeline instead of running degraded with a warning)
  • Update the single Memory.search call in mem0_local.py to the 2.0 signature; add/delete_all are unchanged in 2.0

Fairness / reproducibility impact

  • mem0 runs at its current released version with out-of-the-box defaults (score threshold 0.1, rerank off) — no provider-specific tuning, per the fairness contract.
  • Operators need spaCy's en_core_web_sm model present; mem0 auto-downloads it where pip is available. In uv-managed venvs (no pip), preinstall with uv pip install <en_core_web_sm wheel URL>.
  • Gotcha worth knowing for run hygiene: mem0 2.0 silently disables its v3 hybrid (BM25) search if the local Qdrant collection at /tmp/qdrant was created by an earlier version — wipe /tmp/qdrant and ~/.mem0 before fresh comparison runs.

Validation

  • uv run ruff check . and uv run pytest tests pass
  • Full LoCoMo run (1,986 queries) completed with mem0-local state ok on 2.0.5

🤖 Generated with Claude Code

…arch API

mem0ai 2.0 moved entity scoping in Memory.search from a top-level
user_id= kwarg to filters={"user_id": ...} and renamed limit= to
top_k=. The 2.0 API rejects the old call shape outright, so the
provider could not run at all against current mem0.

Also installs the [nlp] extra so mem0's keyword/lemma pipeline is
active rather than degraded.

Fairness note: this keeps mem0 at its current released version with
out-of-the-box defaults (score threshold 0.1, rerank off), per the
fairness contract. Operators need spaCy's en_core_web_sm model
available; mem0 auto-downloads it where pip is present.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Drew Cain <groksrc@gmail.com>
@groksrc groksrc merged commit aa39d2e into main Jun 11, 2026
1 check passed
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.

1 participant