एजेंट फ़्लीट्स के लिए साझा मेमोरी: hermes-memory-pgvector
जब आप एक से अधिक AI agent चलाते हैं — एक marketing minion, एक trading minion, एक incident-response minion — तो हर एक को memory चाहिए। built-in memory tool हर agent को उसकी अपनी memory देता है। यह तब तक ठीक है जब तक आप उन्हें share नहीं करना चाहते, या तब तक जब तक आप यह याद नहीं करना चाहते कि agent ने छह हफ़्ते पहले क्या सीखा था, सिर्फ़ उसे देखने के लिए LLM round-trip की कीमत चुकाए बिना।
hermes-memory-pgvector एक छोटा Postgres + pgvector प्लगइन है जो agent memory writes को एक shared, embedded, queryable store में mirror करता है। v0.4.2 पर PyPI में प्रकाशित।
v0.4.2 में नया — pip-native install
hermes-agent plugin directories (plugins/memory/<name>/ bundled, $HERMES_HOME/plugins/<name>/ user) को scan करके memory providers खोजता है — यह कभी site-packages में नहीं देखता, इसलिए सिर्फ़ pip install करने से plugin सही तरह से install तो हो जाता था, लेकिन पूरी तरह invisible रह जाता था। v0.4.2 उस gap को बंद करता है: pip install code को machine पर डाल देता है, और एक hermes-pgvector install command वह discovery shim generate करता है जिसे framework वास्तव में पढ़ता है।
v0.4.1 में नया — hybrid recall (vector + full-text)
recall_memory और recall_conversation अब HNSW cosine ranking को PostgreSQL full-text ranking के साथ Reciprocal Rank Fusion (k=60) का उपयोग करके fuse करते हैं। कोई row तब surface होती है अगर दोनों में से कोई भी ranker उसे पसंद करे, जो pure vector search के दो blind spots ठीक करता है: exact-lexical hits जिन्हें cosine smooth कर देता है (error codes, hostnames, flags, rare identifiers), और text-only rows जिनमें NULL embedding होती है — embed endpoint बंद होने के दौरान लिखी गईं — जिन्हें vector index बिल्कुल देख ही नहीं सकता। Hybrid recall अगली backfill run तक उन rows के लिए best-effort recovery के रूप में भी काम करता है।
v0.4.0 ने क्या जोड़ा
उस release ने "no LLM in the hot path" rule बनाए रखा और storage-layer की चार capabilities जोड़ीं:
- Identity governance. Direct-message session keys एक ही privacy-safe bucket में collapse हो जाते हैं — कोई per-contact theme sprawl नहीं, कोई PII नहीं — benchmark traffic quarantine किया जाता है, और एक वैकल्पिक allow-list typo हुई theme names को चुपचाप नई mint करने के बजाय एक safe default पर route करती है।
- Agent attribution & delegation. एक नया registry और provenance edges यह रिकॉर्ड करते हैं कि किस agent ने क्या किसको delegate किया, जिसे database view के ज़रिए query किया जा सकता है। केवल who/when provenance — कभी fact store नहीं।
- Embedding backfill. Embedding-endpoint outage के दौरान text-only लिखी गईं rows अब stranded नहीं रहतीं: एक idempotent command उन्हें फिर से embed करता है ताकि वे फिर से searchable बन जाएँ।
- Conversation TTL & cost controls. Operator-run prune पुराने chat turns को trim करता है (durable memories को कभी छुआ नहीं जाता), और एक embed policy embedding cost को ऊपर या नीचे dial करती है।
यह सब एक maintenance CLI (hermes-pgvector) के पीछे ship होता है, जिसके destructive commands default रूप से dry-run होते हैं। 0.4.x line v0.3.x से एक drop-in upgrade है — additive migrations apply करें और नए hooks activate हो जाते हैं; उन्हें छोड़ दें और बाकी सब unchanged चलता रहता है।
यह वास्तव में क्या करता है
एक लाइन में: "एक storage layer जो built-in memory model को durable, multi-tenant, semantically-searchable backing देता है, बिना hot path में LLM के."
दो tables, दोनों में HNSW vector indexes के साथ। memory_entries agent की MEMORY.md/USER.md files में हुई writes को mirror करता है। conversations substantive chat turns (≥40 chars, boilerplate filtered out) store करता है। Embeddings 768-dim हैं, जिन्हें एक external endpoint द्वारा compute किया जाता है — Ollama, OpenAI-compatible, आपकी पसंद। Agent कभी इस पर block नहीं होता: writes microseconds में return हो जाती हैं और embedding worker बाकी काम background queue पर संभालता है।
डिफ़ॉल्ट रूप से per-agent themes
हर request के साथ एक X-Hermes-Session-Key header होता है जो agent_identity के अनुसार data को scope करता है। Marketing के notes trading के recall को pollute नहीं करते। जब आप वास्तव में cross-theme search चाहते हैं, तब scope='all' को explicitly pass करें। Default सुरक्षित वाला है।
standalone क्यों, fork क्यों नहीं
hermes-agent ने policy के तहत अपनी built-in memory provider list बंद कर दी थी, इसलिए यह upstream fork के बजाय एक अलग /plugins directory scan के रूप में रहता है। इसे agent के पास रखें, कुछ config keys सेट करें, restart करें। Rollback symmetric है: provider disable करें, चाहें तो tables drop करें। Migrate करने के लिए कोई long-lived state नहीं, maintain करने के लिए कोई kernel patches नहीं।
यह क्या नहीं है
Honcho replacement नहीं। Knowledge graph नहीं। RAG framework नहीं। यह जानबूझकर एक पतली layer है जो एक ही काम करती है — built-in memory tool को एक shared, durable, vector-searchable store में बदलना — और फिर रास्ते से हट जाती है। कोई LLM deriver नहीं, कोई dialectic loop नहीं, इस पर कोई राय नहीं कि आपको कैसे chunk या rerank करना चाहिए। बस vector math।
इसे लें
pip install hermes-memory-pgvector
hermes-pgvector install
Source, migration, और config GitHub पर:
