hermes-memory-pgvector एक open-source plugin है जो hermes-agent agents के एक fleet को PostgreSQL और pgvector पर shared, durable memory देता है। Version 0.5.3 PyPI पर उपलब्ध है, और यह plugin में आखिरी hard-coded assumption को हटा देता है: कौन-सा embedding model आपकी memories को searchable vectors में बदलता है।
यह release क्यों मौजूद है
अब तक embedding model practically fixed था। Plugin हर vector को literal 768 dimensions, यानी default nomic-embed-text model के size, के खिलाफ check करता था, और API key भेजने का कोई तरीका नहीं था, इसलिए hosted embedding services पहुँच से बाहर थे।
यह हमारे अपने deployment के लिए एक वास्तविक सीमा बन गया। हमने memory database को OpenAI के text-embedding-3-small पर move किया, जिसे OpenRouter के through serve किया गया, क्योंकि hosted endpoint हमेशा warm रहता है जबकि self-hosted model को wake up होने में कई seconds लग सकते हैं। Database columns 1536 dimensions में बदल गए, और plugin में ऐसा कोई setting नहीं था जो उनके साथ follow कर सके। v0.5.3 वे settings जोड़ता है।
तीन नए settings
embed_dimवह vector length है जो आपका model लौटाता है। Default768है, इसलिए existing setups अप्रभावित रहते हैं। हर embedding अब भी check की जाती है, अब इसी value के against, इसलिए mismatch database तक पहुँचने से पहले ही fast fail कर देता है।embed_api_key_envएक environment variable का नाम है जिसमें bearer token होता है, जैसेOPENROUTER_API_KEY। Key कभी config file में नहीं जाती; इसे call time पर पढ़ा जाता है और कभी log नहीं किया जाता।embed_protocolopenai,ollamaयाautoहै। Default,auto, OpenAI-compatible path को try करता है और Ollama के native API पर fall back करता है। Hosted service के लिएopenaiचुनने का मतलब है कि authentication या model error जैसा है वैसा report होगा, बजाय इसके कि fallback से आने वाले 404 के पीछे छिप जाए।
Plugin को OpenRouter के through text-embedding-3-small पर point करना अब ऐसा दिखता है:
plugins:
pgvector:
embed_url: "https://openrouter.ai/api"
embed_model: "openai/text-embedding-3-small"
embed_dim: 1536
embed_api_key_env: "OPENROUTER_API_KEY"
embed_protocol: "openai"
दो fixes जो तब भी महत्वपूर्ण हैं जब आप कुछ भी न बदलें
- hermes-agent plugin loader के तहत embeddings। Plugin load करने के बाद, host का loader package के हर submodule को फिर से attach कर देता है, जिसमें
embedनाम का एक module भी शामिल है। इससे वह function replace हो गया जिसे plugin call करता था, इसलिए embeddingTypeError: 'module' object is not callableके साथ fail हो रही थी और memory writes store होने के बजाय drop हो रही थीं। अब plugin एक private alias call करता है जिसे loader कभी touch नहीं करता। - Slow endpoints। एक server जिसने connection accept कर लिया लेकिन timeout के बाद जवाब दिया, उसने bare
TimeoutErrorraise किया, जो plugin की error handling से निकल गया: कोई fallback नहीं, कोई retries नहीं, और एक lost write। अब इसे हर दूसरे endpoint failure की तरह handle किया जाता है।
अपग्रेड करना
Defaults नहीं बदले: 768 dimensions, no auth header, auto protocol, और कोई नया database migration नहीं। Upgrade करें:
pip install -U hermes-memory-pgvector
अलग vector size वाले model पर switch करना database migration है, सिर्फ config edit नहीं, क्योंकि दो अलग models के vectors आपस में comparable नहीं होते। README इसमें मार्गदर्शन करती है: column type बदलें, hermes-pgvector backfill के साथ existing rows को फिर से re-embed करें, फिर HNSW indexes rebuild करें।
Source और full configuration reference GitHub पर हैं:
