feat: add Mem0 memory integration CLI commands and client support#2933
Closed
kartik-mem0 wants to merge 6 commits into
Closed
feat: add Mem0 memory integration CLI commands and client support#2933kartik-mem0 wants to merge 6 commits into
kartik-mem0 wants to merge 6 commits into
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds comprehensive user-facing docs for the Mem0 integration, following the same structure as the Honcho Memory docs. Covers setup, configuration, tools, CLI commands, troubleshooting, warnings, and a Mem0 vs Honcho comparison table. Adds mem0 to the sidebar under Integrations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…n context injection
teknium1
added a commit
that referenced
this pull request
Mar 29, 2026
Introduces MemoryProvider ABC, MemoryManager orchestrator, and BuiltinMemoryProvider for the existing MEMORY.md/USER.md system. Key design decisions: - Built-in memory is ALWAYS active, never disabled by external providers - Multiple providers can be active simultaneously - Prefetch results from all providers are merged per-turn - Sync fans out to all providers after each turn - Each provider can expose its own tools Three registration paths: 1. Built-in (BuiltinMemoryProvider) — always first, not removable 2. First-party (Honcho stays as-is for now, migration in follow-up) 3. Plugin — ctx.register_memory_provider() in plugin system Files: - agent/memory_provider.py — ABC with core + optional lifecycle hooks - agent/memory_manager.py — orchestrator, single integration point - agent/builtin_memory_provider.py — wraps existing MemoryStore - hermes_cli/plugins.py — register_memory_provider() + accessor - run_agent.py — MemoryManager wired alongside existing Honcho code - tests/agent/test_memory_provider.py — 37 tests This establishes the interface for all pending memory backend PRs (#1811 Hindsight, #2732 RetainDB, #2933 Mem0, #3499 Byterover, #3369 OpenViking, #2351 Holographic, #727 Cognitive) to implement as plugins rather than one-off integrations.
teknium1
added a commit
that referenced
this pull request
Mar 30, 2026
Adapts PR #1811 (Hindsight by benfrank241) and PR #2933 (Mem0 by kartik-mem0) to the MemoryProvider interface as drop-in plugins. Hindsight plugin (plugins/hindsight-memory/): - 3 tools: hindsight_retain, hindsight_recall, hindsight_reflect - Cloud (API key) or local (embedded PostgreSQL) modes - Background prefetch with thread isolation for aiohttp - Auto-sync turns to knowledge graph Mem0 plugin (plugins/mem0-memory/): - 4 tools: mem0_profile, mem0_search, mem0_context, mem0_conclude - Server-side LLM fact extraction and deduplication - Semantic search with optional reranking - Verbatim fact storage via conclude (infer=False) Both require API keys (HINDSIGHT_API_KEY / MEM0_API_KEY) and the respective SDK packages (hindsight-client / mem0ai). is_available() gates on credentials so installing the plugin without a key is safe.
Contributor
|
Closing as superseded — your Mem0 integration has been reimplemented as a native MemoryProvider plugin at Your contribution established the foundation for Mem0 support in Hermes. Thank you for the work on this! |
1 task
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 28, 2026
Introduces MemoryProvider ABC, MemoryManager orchestrator, and BuiltinMemoryProvider for the existing MEMORY.md/USER.md system. Key design decisions: - Built-in memory is ALWAYS active, never disabled by external providers - Multiple providers can be active simultaneously - Prefetch results from all providers are merged per-turn - Sync fans out to all providers after each turn - Each provider can expose its own tools Three registration paths: 1. Built-in (BuiltinMemoryProvider) — always first, not removable 2. First-party (Honcho stays as-is for now, migration in follow-up) 3. Plugin — ctx.register_memory_provider() in plugin system Files: - agent/memory_provider.py — ABC with core + optional lifecycle hooks - agent/memory_manager.py — orchestrator, single integration point - agent/builtin_memory_provider.py — wraps existing MemoryStore - hermes_cli/plugins.py — register_memory_provider() + accessor - run_agent.py — MemoryManager wired alongside existing Honcho code - tests/agent/test_memory_provider.py — 37 tests This establishes the interface for all pending memory backend PRs (NousResearch#1811 Hindsight, NousResearch#2732 RetainDB, NousResearch#2933 Mem0, NousResearch#3499 Byterover, NousResearch#3369 OpenViking, NousResearch#2351 Holographic, NousResearch#727 Cognitive) to implement as plugins rather than one-off integrations.
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 28, 2026
Adapts PR NousResearch#1811 (Hindsight by benfrank241) and PR NousResearch#2933 (Mem0 by kartik-mem0) to the MemoryProvider interface as drop-in plugins. Hindsight plugin (plugins/hindsight-memory/): - 3 tools: hindsight_retain, hindsight_recall, hindsight_reflect - Cloud (API key) or local (embedded PostgreSQL) modes - Background prefetch with thread isolation for aiohttp - Auto-sync turns to knowledge graph Mem0 plugin (plugins/mem0-memory/): - 4 tools: mem0_profile, mem0_search, mem0_context, mem0_conclude - Server-side LLM fact extraction and deduplication - Semantic search with optional reranking - Verbatim fact storage via conclude (infer=False) Both require API keys (HINDSIGHT_API_KEY / MEM0_API_KEY) and the respective SDK packages (hindsight-client / mem0ai). is_available() gates on credentials so installing the plugin without a key is safe.
CumulusService
pushed a commit
to Cumulus-Service-GmbH/hermes-agent
that referenced
this pull request
May 30, 2026
Introduces MemoryProvider ABC, MemoryManager orchestrator, and BuiltinMemoryProvider for the existing MEMORY.md/USER.md system. Key design decisions: - Built-in memory is ALWAYS active, never disabled by external providers - Multiple providers can be active simultaneously - Prefetch results from all providers are merged per-turn - Sync fans out to all providers after each turn - Each provider can expose its own tools Three registration paths: 1. Built-in (BuiltinMemoryProvider) — always first, not removable 2. First-party (Honcho stays as-is for now, migration in follow-up) 3. Plugin — ctx.register_memory_provider() in plugin system Files: - agent/memory_provider.py — ABC with core + optional lifecycle hooks - agent/memory_manager.py — orchestrator, single integration point - agent/builtin_memory_provider.py — wraps existing MemoryStore - hermes_cli/plugins.py — register_memory_provider() + accessor - run_agent.py — MemoryManager wired alongside existing Honcho code - tests/agent/test_memory_provider.py — 37 tests This establishes the interface for all pending memory backend PRs (NousResearch#1811 Hindsight, NousResearch#2732 RetainDB, NousResearch#2933 Mem0, NousResearch#3499 Byterover, NousResearch#3369 OpenViking, NousResearch#2351 Holographic, NousResearch#727 Cognitive) to implement as plugins rather than one-off integrations.
CumulusService
pushed a commit
to Cumulus-Service-GmbH/hermes-agent
that referenced
this pull request
May 30, 2026
Adapts PR NousResearch#1811 (Hindsight by benfrank241) and PR NousResearch#2933 (Mem0 by kartik-mem0) to the MemoryProvider interface as drop-in plugins. Hindsight plugin (plugins/hindsight-memory/): - 3 tools: hindsight_retain, hindsight_recall, hindsight_reflect - Cloud (API key) or local (embedded PostgreSQL) modes - Background prefetch with thread isolation for aiohttp - Auto-sync turns to knowledge graph Mem0 plugin (plugins/mem0-memory/): - 4 tools: mem0_profile, mem0_search, mem0_context, mem0_conclude - Server-side LLM fact extraction and deduplication - Semantic search with optional reranking - Verbatim fact storage via conclude (infer=False) Both require API keys (HINDSIGHT_API_KEY / MEM0_API_KEY) and the respective SDK packages (hindsight-client / mem0ai). is_available() gates on credentials so installing the plugin without a key is safe.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds Mem0 Platform integration to Hermes, enabling persistent cross-session memory. The agent extracts facts from conversations, stores them via Mem0's API, and recalls relevant context in future
sessions through semantic search and system prompt injection.
All search and retrieval uses the Mem0 v2 filter API with proper entity scoping. Memories stored with a run_id (from session strategies) are correctly retrieved using OR filters that combine bare
user_id matching with a run_id: "*" wildcard branch — without this, session-scoped memories are invisible to search. The rerank and keyword_search config settings are respected across all search
paths (manager, prefetch, tools, CLI). Mem0 is a fully independent plugin with its own turn context injection (_inject_mem0_turn_context), separate from Honcho.
Related Issue
Fixes #2942
Type of Change
Changes Made
mem0_integration/client.py— Config dataclass (Mem0ClientConfig) with resolution from$HERMES_HOME/mem0.json→~/.hermes/mem0.json→ env vars. SingletonMemoryClientfactory.mem0_integration/manager.py—Mem0MemoryManagerwithadd(),search(),get_profile(),store_fact(), and backgroundprefetch()for system prompt injection.mem0_integration/cli.py—hermes mem0 {setup|status|search|memories|clear}subcommands for interactive setup, connection health check, and memory management from the terminal.tools/mem0_tools.py— Four agent tools:mem0_search,mem0_context,mem0_profile,mem0_conclude. Visible only when Mem0 is enabled.run_agent.py— Mem0 lifecycle hooks: config loading, prefetch on session start, memory ingestion on conversation end, tool registration.hermes_cli/main.py— Registeredmem0subcommand in the CLI argument parser.hermes_cli/doctor.py— Added Mem0 connection health check tohermes doctor.pyproject.toml— Addedmem0aias optional dependency.tests/mem0_integration/test_client.py— 13 tests for config resolution, env fallback, singleton behavior.tests/mem0_integration/test_cli.py— 5 tests for CLI status/search/memories commands.tests/mem0_integration/test_manager.py— 14 tests for add, search, get_profile, store_fact, prefetch, shutdown.tests/tools/test_mem0_tools.py— 15 tests for tool availability, search, context, profile, conclude handlers.How to Test
uv pip install mem0aihermes mem0 setup— enter API key from app.mem0.aihermes mem0 statushermes, mention some personal facts, then end the sessionhermes mem0 search "programming languages"hermes mem0 memoriespytest tests/mem0_integration/ tests/tools/test_mem0_tools.py -v(47 tests, all passing)Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/Aor N/A
Screenshots / Logs