hermes - ✅(Solved) Fix [Bug]: hermes memory setup does not verify mem0ai is importable before configuring Mem0 [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#25086Fetched 2026-05-14 03:49:04
View on GitHub
Comments
0
Participants
1
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
labeled ×4cross-referenced ×2referenced ×1

Error Message

  1. Start a session, try to use memory — opaque traceback
  • On n or failure, abort with a clear error and do not write any config

Fix Action

Fixed

PR fix notes

PR #25110: fix(memory): verify dependencies are importable before configuring memory provider

Description (problem / solution / changelog)

Summary

hermes memory setup previously configured providers (e.g. Mem0) without verifying that their pip dependencies were actually importable. If uv pip install failed silently (network issues, permission errors, missing uv), the wizard reported success but the plugin crashed at runtime with ModuleNotFoundError.

Root cause

_install_dependencies() in hermes_cli/memory_setup.py always returned None regardless of whether installation succeeded or failed. Both cmd_setup() and cmd_setup_provider() called it but never checked the result — the wizard continued unconditionally.

Fix

Changed _install_dependencies() to return a bool:

  • True when all dependencies are importable (already installed or successfully installed)
  • False when any dependency is still missing after the install attempt

Both cmd_setup() and cmd_setup_provider() now check this return value and abort with a clear error message if dependencies are still missing:

⚠ Cannot configure 'mem0' — required dependencies are missing.
Install manually and re-run: hermes memory setup

Code Intelligence

  • Analyzed: _install_dependencies (callers: 2, callees: 1, flows: 1)
  • Blast radius: LOW — both callers (cmd_setup, cmd_setup_provider) are in the same file
  • Related patterns: find_provider_dir in plugins/memory/__init__.py (read-only dependency)

Regression coverage

9 new tests in tests/hermes_cli/test_memory_setup_dependency_check.py:

  • TestInstallDependenciesReturn (6 tests): True for no plugin dir, no yaml, no deps, all importable; False for missing uv, failed install
  • TestCmdSetupAbortOnMissingDeps (3 tests): abort on failed install, abort on missing deps for provider-specific setup, proceed when deps OK

All 18 tests pass (9 new + 9 existing test_memory_reset.py).

Testing

python -m pytest tests/hermes_cli/test_memory_setup_dependency_check.py tests/hermes_cli/test_memory_reset.py -v
# 18 passed

Fixes [Bug]: hermes memory setup does not verify mem0ai is importable before configuring Mem0 #25086

Changed files

  • hermes_cli/memory_setup.py (modified, +35/-10)
  • tests/hermes_cli/test_memory_setup_dependency_check.py (added, +160/-0)

PR #25117: fix(cli): abort memory setup when provider deps are not importable

Description (problem / solution / changelog)

Summary

  • _install_dependencies() now returns boolTrue when all provider dependencies are importable (already present or successfully installed), False when installation fails or is impossible (e.g. uv not found)
  • Both callers (cmd_setup, cmd_setup_provider) check the return value and abort early with a clear error message instead of silently proceeding to write config that will fail at runtime with ModuleNotFoundError

Before

$ hermes memory setup → select mem0 → enter API key → ✓ success!
$ hermes chat → use memory → 💥 ModuleNotFoundError: No module named 'mem0'

After

$ hermes memory setup → select mem0 → try install mem0ai → ⚠ install failed
  ⚠ Setup aborted — required dependencies for 'mem0' are not importable.
  Install them manually and re-run this command.

No config is written until dependencies are confirmed importable.

Testing

  • 9 new unit tests covering all return paths of _install_dependencies():
    • True: no plugin dir, no plugin.yaml, no pip_deps, already importable, successful install
    • False: uv not found, install failure (CalledProcessError)
  • 2 integration tests for cmd_setup_provider abort behavior
  • 740 existing tests passing (0 regressions)

Files changed

FileChange
hermes_cli/memory_setup.py_install_dependencies()bool, callers check + abort
tests/cli/test_memory_setup_deps.pyNew: 9 unit + 2 integration tests

Closes #25086

Changed files

  • hermes_cli/memory_setup.py (modified, +25/-10)
  • tests/cli/test_memory_setup_deps.py (added, +152/-0)

Code Example

uv pip install --python ~/.hermes/hermes-agent/venv/bin/python mem0ai
RAW_BUFFERClick to expand / collapse

Problem

When running hermes memory setup and selecting Mem0, the wizard does not verify that mem0ai is importable in the Hermes venv before proceeding. If the SDK isn't installed, the wizard happily collects the API key, writes mem0.json and .env, and reports success — but the plugin then fails opaquely at runtime with ModuleNotFoundError: No module named 'mem0'.

hermes doctor correctly reports pip install mem0ai as the fix — but only after a session has tried (and failed) to use Mem0. The wizard never invokes the doctor and never warns the user during setup.

Repro

  1. Fresh Hermes install (no manual pip install mem0ai step)
  2. Run hermes memory setup
  3. Select mem0
  4. Wizard prompts for API key, user_id, agent_id — all succeed
  5. Wizard reports ✓ Memory provider configured: mem0
  6. Start a session, try to use memory — opaque traceback

Proposed solution

In hermes memory setup, before the first config prompt for a selected provider:

  1. Attempt import of the provider's required module(s) in the agent's venv
  2. If missing:
    • Print the exact install command, including the venv-specific Python path: uv pip install --python ~/.hermes/hermes-agent/venv/bin/python mem0ai
    • Offer to run it interactively (y/N prompt)
    • On n or failure, abort with a clear error and do not write any config
  3. Only proceed to config prompts after import succeeds

Pattern generalizes

Every memory provider has a requirements: list in plugin.yaml (Mem0's: requirements: - mem0ai). The wizard can validate generically against that list before configuration — applies to honcho, supermemory, byterover, etc.

hermes doctor should run the same check post-setup

Today the doctor reports pip install mem0ai as a remediation but doesn't itself offer to run it. Adding hermes doctor --fix (or --install-missing) that bridges the gap would close the loop.

Severity

UX bug. Costs every new Mem0 user 15–60 minutes of debugging on first install. The information is already in the codebase (doctor.py literally prints the install command); the wizard just doesn't consult it.

My install path that triggered this

~/.hermes/hermes-agent/venv/ was created via uv venv without --seed, so it has no pip binary — the standard pip install mem0ai doesn't work without further explanation. The correct command for this install layout is:

uv pip install --python ~/.hermes/hermes-agent/venv/bin/python mem0ai

If the wizard surfaces both this command and the simpler pip install mem0ai (for installs that have pip in the venv), it covers both layouts.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING