feat: add MemPalace memory provider plugin - #12203
Conversation
- add modular MemPalace provider implementation and tool bindings - add plugin tests for foundation, loader, module layout, and e2e flows - deduplicate overlapping memory prefetch lines across providers - document setup and reviewer quick start in plugin README
|
I’ve been working on a parallel MemPalace integration in my fork and wanted to share the main architectural difference here before opening a duplicate PR. This PR appears to take a Hermes-owned provider approach, while my branch takes a lower-coupling approach:
The main reason for that design is maintenance. Hermes can rely on MemPalace’s public runtime surfaces instead of depending as much on MemPalace’s internal Python implementation. In practice that should make upstream MemPalace changes easier to absorb over time, as long as the CLI/MCP contracts stay stable. I’m not saying that makes this PR wrong. The tradeoff seems more like:
A few concrete things I ended up solving in that branch:
Branch for reference: https://github.com/eugeneyvt/hermes-agent/tree/integrate/mempalace-20260418 |
|
Bug report: embedding dimension mismatch on existing MemPalace collections (cross-posted from #5671 per @alt-glitch's triage) Hi @Jessica-lol — I cherry-picked this PR locally to integrate Hermes with my existing MemPalace install and hit a blocker worth reporting. TL;DR: the plugin opens the Chroma collection without specifying an Symptom (every conversational turn): Result: Root cause — self._chroma_client = chromadb.PersistentClient(path=str(self._palace_path))
self._chroma_collection = self._chroma_client.get_or_create_collection(
"mempalace_drawers" # no embedding_function → Chroma default = MiniLM 384
)Compare with the upstream MemPalace package ( from mempalace.ollama_embedding import OllamaEmbeddingFunction
ef = OllamaEmbeddingFunction(model="bge-m3")
col = client.get_or_create_collection("mempalace_drawers", embedding_function=ef)Fix — 3-line patch: from mempalace.ollama_embedding import OllamaEmbeddingFunction
ef = OllamaEmbeddingFunction(model="bge-m3")
self._chroma_client = chromadb.PersistentClient(path=str(self._palace_path))
self._chroma_collection = self._chroma_client.get_or_create_collection(
"mempalace_drawers",
embedding_function=ef,
)Tested locally (Hermes gateway + MemPalace 1024-dim collection, ~68k drawers). After patch + gateway restart, a Telegram turn produced the expected log: Sync now works as designed. Same bug exists in #9761. Open design question — should the plugin fall back gracefully if |
|
Quick follow-up after 5+ hours in prod (Telegram Précepteur, Hermes gateway on macOS launchd): Stability: zero Volume validated:
On the open design question (graceful fallback if try:
import chromadb
try:
from mempalace.ollama_embedding import OllamaEmbeddingFunction
ef = OllamaEmbeddingFunction(model="bge-m3")
except (ImportError, Exception) as ef_exc:
logger.warning(
"MemPalace: OllamaEmbeddingFunction unavailable (%s) — palace writes disabled "
"(install upstream `mempalace` package and ensure Ollama is running with bge-m3 pulled)",
ef_exc,
)
ef = None
self._chroma_client = chromadb.PersistentClient(path=str(self._palace_path))
if ef is not None:
self._chroma_collection = self._chroma_client.get_or_create_collection(
"mempalace_drawers", embedding_function=ef,
)
else:
self._chroma_collection = None
except Exception as e:
...This way |
|
@Jessica-lol heads up — Bartok9 picked this up and has a working salvage at #21017 with the import guard and test skip markers applied. might be worth coordinating there since that one's past review and just blocked on pre-existing CI noise |
…alace package - Wrap top-level mempalace imports in try/except at module level so the plugin loads gracefully when mempalace is not installed - Add _MEMPALACE_AVAILABLE guard; initialize() raises RuntimeError with clear install instructions when mempalace is absent - Add @_requires_mempalace skip markers on tests that need the actual mempalace package (test_initialize_*) — CI passes without mempalace installed, tests run when it is available Salvage of NousResearch#12203 by @Jessica-lol — rebased onto current main.
|
Thanks for the contribution! Per the updated CONTRIBUTING.md, new memory providers are no longer accepted as in-tree additions to
Closing this in line with that policy. The path forward is to publish it as a standalone plugin so users can install it directly without touching the Hermes source tree. Once it's published, a small docs PR adding it to the Community plugins section of the README is welcome. Sorry for the bump — appreciate the time you put into this. |
Summary
Testing
Notes
Jessica-lol/hermes-agentscripts/whatsapp-bridge/package-lock.jsonfrom this PR