hermes-memory-pgvector 0.3.0__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/PKG-INFO +1 -1
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/hermes_memory_pgvector.egg-info/PKG-INFO +1 -1
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/pgvector/__init__.py +13 -0
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/pgvector/plugin.yaml +1 -1
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/pgvector/store.py +22 -7
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/pyproject.toml +1 -1
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/LICENSE +0 -0
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/README.md +0 -0
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/hermes_memory_pgvector.egg-info/SOURCES.txt +0 -0
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/hermes_memory_pgvector.egg-info/dependency_links.txt +0 -0
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/hermes_memory_pgvector.egg-info/requires.txt +0 -0
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/hermes_memory_pgvector.egg-info/top_level.txt +0 -0
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/pgvector/embed.py +0 -0
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/pgvector/migrations/001_schema.sql +0 -0
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/pgvector/writer.py +0 -0
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/setup.cfg +0 -0
- {hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/tests/test_smoke.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hermes-memory-pgvector
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Postgres + pgvector memory provider plugin for hermes-agent. Multi-agent storage layer with per-minion themes, async writer, no LLM in the memory hot path.
|
|
5
5
|
Author: Andrea Borghi
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hermes-memory-pgvector
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Postgres + pgvector memory provider plugin for hermes-agent. Multi-agent storage layer with per-minion themes, async writer, no LLM in the memory hot path.
|
|
5
5
|
Author: Andrea Borghi
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -239,6 +239,19 @@ class PgvectorMemoryProvider(MemoryProvider):
|
|
|
239
239
|
or kwargs.get("agent_identity") # accept 'default' if nothing else set
|
|
240
240
|
or "default"
|
|
241
241
|
)
|
|
242
|
+
|
|
243
|
+
# Re-initialization guard (v0.3.1): one registered provider instance
|
|
244
|
+
# can have initialize() called again for a new session — the gateway
|
|
245
|
+
# reuses the registered provider rather than constructing a fresh one
|
|
246
|
+
# per session. Without tearing down the previous session's writer +
|
|
247
|
+
# pool first, each re-init abandoned a ConnectionPool whose warm
|
|
248
|
+
# connection lingered in Postgres until idle_session_timeout — the
|
|
249
|
+
# v0.3.0 connection leak that saturated the server's slots under a
|
|
250
|
+
# burst of concurrent sessions. shutdown() is idempotent and drains
|
|
251
|
+
# in-flight writes, so calling it unconditionally here is safe.
|
|
252
|
+
if self._store is not None or self._writer is not None:
|
|
253
|
+
self.shutdown()
|
|
254
|
+
|
|
242
255
|
self._store = MemoryStore(self._config["dsn"])
|
|
243
256
|
try:
|
|
244
257
|
# Schema is verify-only at runtime — admin applies the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: pgvector
|
|
2
|
-
version: 0.3.
|
|
2
|
+
version: 0.3.1
|
|
3
3
|
description: "Postgres + pgvector storage layer for hermes-agent. Mirrors built-in MEMORY.md / USER.md + captures every substantive (user, assistant) chat turn into a conversations table. Per-agent themes (marketing/sales/trading/incident/morning-report/…) via X-Hermes-Session-Key header — every systemd-run minion gets its own scope. 768-dim semantic recall. Async writer + connection pool. No LLM mediation."
|
|
4
4
|
pip_dependencies:
|
|
5
5
|
- "psycopg[binary]>=3.3.4"
|
|
@@ -38,16 +38,27 @@ class MemoryStore:
|
|
|
38
38
|
self,
|
|
39
39
|
dsn: str,
|
|
40
40
|
*,
|
|
41
|
-
min_size: int =
|
|
41
|
+
min_size: int = 0,
|
|
42
42
|
max_size: int = 4,
|
|
43
43
|
timeout: float = 5.0,
|
|
44
|
+
max_idle: float = 30.0,
|
|
45
|
+
max_lifetime: float = 300.0,
|
|
44
46
|
):
|
|
45
|
-
"""Open a lazily-initialized ConnectionPool.
|
|
46
|
-
|
|
47
|
-
min_size=
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
"""Open a lazily-initialized, self-draining ConnectionPool.
|
|
48
|
+
|
|
49
|
+
min_size=0 means an idle pool holds ZERO connections — critical so
|
|
50
|
+
a pool that gets abandoned (a re-initialized provider, or a session
|
|
51
|
+
the gateway never explicitly shuts down) cannot strand a warm
|
|
52
|
+
backend in Postgres until the server's idle_session_timeout reaps
|
|
53
|
+
it. Under load the pool still grows to max_size=4 so the agent
|
|
54
|
+
thread and the async-writer drain thread can overlap.
|
|
55
|
+
|
|
56
|
+
max_idle (30s) closes connections returned to the pool that then sit
|
|
57
|
+
unused, shrinking back toward min_size. max_lifetime (300s) caps the
|
|
58
|
+
absolute age of any pooled connection. Together these keep the
|
|
59
|
+
connections "short-lived when idle, pooled under load" and bound the
|
|
60
|
+
plugin's Postgres footprint to actual concurrent demand rather than
|
|
61
|
+
to the number of sessions ever opened.
|
|
51
62
|
"""
|
|
52
63
|
self._dsn = dsn
|
|
53
64
|
self._lock = threading.Lock()
|
|
@@ -55,6 +66,8 @@ class MemoryStore:
|
|
|
55
66
|
self._min_size = min_size
|
|
56
67
|
self._max_size = max_size
|
|
57
68
|
self._timeout = timeout
|
|
69
|
+
self._max_idle = max_idle
|
|
70
|
+
self._max_lifetime = max_lifetime
|
|
58
71
|
|
|
59
72
|
# -- Pool lifecycle ------------------------------------------------------
|
|
60
73
|
|
|
@@ -69,6 +82,8 @@ class MemoryStore:
|
|
|
69
82
|
min_size=self._min_size,
|
|
70
83
|
max_size=self._max_size,
|
|
71
84
|
timeout=self._timeout,
|
|
85
|
+
max_idle=self._max_idle,
|
|
86
|
+
max_lifetime=self._max_lifetime,
|
|
72
87
|
open=True,
|
|
73
88
|
name="pgvector-memory",
|
|
74
89
|
)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "hermes-memory-pgvector"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.1"
|
|
8
8
|
description = "Postgres + pgvector memory provider plugin for hermes-agent. Multi-agent storage layer with per-minion themes, async writer, no LLM in the memory hot path."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hermes_memory_pgvector-0.3.0 → hermes_memory_pgvector-0.3.1}/pgvector/migrations/001_schema.sql
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|