89f1bae5e05450997be6525ce15825b3eb6f1083
MoME — Mixture of Memory Experts for Hermes Agent
Sparse-gated personal memory with an online-learning router. Replaces monolithic memory context with expert-routed retrieval — only relevant memory experts are activated per query.
Features
- 4 Experts:
identity,knowledge,projects,preferences - Sparse Activation: Only 1–2 experts are queried per turn (determined by the router)
- Online Learning: SGD classifier router learns which expert to route to based on usage patterns
- Local-Only: 100% offline, no API keys needed
- Auto-Learning: Regex-based fact extraction from user queries
- Persistent: JSON-based storage, survives restarts
Installation
# 1. Clone the plugin into Hermes plugins directory
git clone https://github.com/emil28092005/hermes-plugin-mome.git \
~/.hermes/hermes-agent/plugins/memory/mome
# 2. Install dependencies
pip install numpy scikit-learn
# 3. Activate via Hermes memory setup
hermes memory setup
Select mome from the list of available memory providers.
Usage
Once activated, MoME provides three tools:
mome_search
Search memory across experts. The router automatically selects which experts to query.
mome_search(query="what projects am I working on?", top_k=3)
mome_search(query="Python skills", expert="knowledge", top_k=5)
mome_store
Store a fact directly into a specific expert.
mome_store(expert="identity", fact="I prefer dark mode")
mome_status
Show expert sizes and router training state.
mome_status()
Architecture
User Query
│
▼
┌─────────────┐
│ Router │ ← SGDClassifier (online learning)
│ (predict) │
└──────┬──────┘
│ top-2 experts selected
▼
┌──────┴──────┐
│ Experts │
│ identity │ ─── cosine similarity search
│ knowledge │
│ projects │
│ preferences │
└──────┬──────┘
│ relevant memories
▼
┌─────────────┐
│ Context │ → injected into system prompt
└─────────────┘
Fact Extraction (Auto-Learning)
On each turn, MoME automatically extracts facts from user queries via regex:
меня зовут X→ identityя живу в X→ identityработаю над X→ projectsу меня проект X→ projectsзнаю/использую X→ knowledgeнравится X→ preferences
The router learns over time which experts to activate for which types of queries.
Dependencies
- Python ≥ 3.10
numpy— vector operationsscikit-learn— SGD router classifier
Zero external API dependencies. Works fully offline.
Development
# Test the engine standalone
python -c "from plugins.memory.mome.engine import MomeEngine; e = MomeEngine('/tmp/test_mome'); e.store_fact('identity', 'Test fact'); print(e.query('test'))"
Author
Emil Shanaty — github.com/emil28092005
License
MIT
Languages
Python
100%