Skip to content

feat(mem0): self-hosted dashboard backend + recall tuning (salvage #55614) - #762

Open
hashbender wants to merge 1 commit into
mainfrom
mirror/pr-56943
Open

feat(mem0): self-hosted dashboard backend + recall tuning (salvage #55614)#762
hashbender wants to merge 1 commit into
mainfrom
mirror/pr-56943

Conversation

@hashbender

Copy link
Copy Markdown
Owner

Summary

The mem0 plugin can now connect to a self-hosted Mem0 dashboard server (the Dockerized FastAPI server), closing the gap between OSS (in-process SDK) and Platform (cloud) modes.

Changes

  • _backend.py: new SelfHostedBackend — direct httpx client for a self-hosted Mem0 server (X-API-Key auth, POST /search, GET/POST /memories, PUT/DELETE /memories/{id}), reusing the shared _unwrap_results. get_all reports the true stored total, not the page size (SelfHostedBackend.get_all() returns incorrect count when memories exceed server page limit NousResearch/hermes-agent#52921).
  • __init__.py: route to SelfHostedBackend when host is set (MEM0_HOST / mem0.json); precedence is oss > host > platform. Config schema + is_available() accept host-only (AUTH_DISABLED servers).
  • Recall tuning (mem0 research-team feedback, applies to all modes): rerank defaults to false (opt-in via rerank=true, platform only); the mem0_list tool is removed (5→4 tools); search guidance is de-shouted.
  • plugin.yaml: 1.2.01.3.0; mem0ai>=2.0.10,<3.

Maintainer follow-ups on top of the salvage

Two sibling surfaces didn't mirror the new oss > host > platform routing precedence added to _create_backend:

  • system_prompt_block() checked host before oss, so an oss+host config ran OSS but told the model it was self-hosted HTTP. Reordered to match routing.
  • hermes memory setup mem0 --mode platform left a stale host in mem0.json; since host beats platform, the user kept routing to the self-hosted server. save_config merges (no key deletion), so host is now cleared to "" (overwrites on merge, reads falsy) rather than popped.
  • Added regression tests for both; fixed a garbled Authorization: *** docstring artifact.

Validation

Result
mem0 backend + v3 + setup suites 111 passed
New guard tests (prompt-label precedence, platform host-clear) mutation-checked load-bearing
ruff / py_compile clean
Core files touched none (plugin dir + tests + docs only)

Salvage of NousResearch#55614 by @kartik-mem0 (mem0 maintainer) — cherry-picked to preserve authorship, with the sibling-surface follow-ups above. Also supersedes the self-hosted portion of NousResearch#52487 by @liuhao1024 (first-submitted independent implementation of the same SelfHostedBackend) — credited.

Closes NousResearch#52478
Fixes NousResearch#52921


Mirror-of: NousResearch#56943
NousResearch#56943

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

Labels

None yet

Projects

None yet

1 participant