Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4f9ad92
feat(hindsight): add retain metadata and transcript labels
Abnertheforeman Apr 8, 2026
eec5155
feat(hindsight): add session-scoped auto-retain windows
Abnertheforeman Apr 8, 2026
7853ed0
feat(hindsight): thread gateway context into retain metadata
Abnertheforeman Apr 8, 2026
01a25c0
fix(agent): honor session user id env fallback
Abnertheforeman Apr 8, 2026
38988f4
Merge upstream/main into feat/hindsight-retain-metadata
Abnertheforeman Apr 9, 2026
8d433fc
fix(hindsight): make retain_tags the canonical config key
Abnertheforeman Apr 9, 2026
5d54f54
fix(hindsight): honor retain knobs in auto-retain
Abnertheforeman Apr 9, 2026
b08b695
fix(hindsight): drop retain chunk overlap config
Abnertheforeman Apr 9, 2026
35a3069
fix(hindsight): drop unsupported retain_async kwarg
Abnertheforeman Apr 9, 2026
807ac62
fix(hindsight): resume retain numbering from session history
Abnertheforeman Apr 9, 2026
0d50672
fix(hindsight): restore retain_async control
Abnertheforeman Apr 9, 2026
a14d7a0
fix(hindsight): restore session-scoped retain topology
Abnertheforeman Apr 10, 2026
ffc62a4
Merge remote-tracking branch 'upstream/main' into pr-6290
Abnertheforeman Apr 10, 2026
0e22c0a
fix(hindsight): drop dead transcript label knobs
Abnertheforeman Apr 10, 2026
66a2084
fix(hindsight): honor transcript label knobs
Abnertheforeman Apr 10, 2026
4a09a64
fix(hindsight): make transcript labels additive
Abnertheforeman Apr 10, 2026
57bcbb7
Merge main into feat/hindsight-retain-metadata
Abnertheforeman Apr 13, 2026
bcd4243
fix(hindsight): trim gateway scope drift
Abnertheforeman Apr 13, 2026
733bb6a
fix(hindsight): drop duplicate content field from retained turn messages
Abnertheforeman Apr 13, 2026
e054684
fix(hindsight): fold prefix into content field, drop speaker_label/re…
Abnertheforeman Apr 13, 2026
72a88a3
Merge branch 'main' into feat/hindsight-retain-metadata
Abnertheforeman Apr 13, 2026
0727016
Merge branch 'main' into feat/hindsight-retain-metadata
Abnertheforeman Apr 14, 2026
bb3bd17
Merge branch 'main' into feat/hindsight-retain-metadata
Abnertheforeman Apr 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion gateway/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4599,6 +4599,11 @@ def run_sync():
session_id=task_id,
platform=platform_key,
user_id=source.user_id,
user_name=source.user_name,
chat_id=source.chat_id,
chat_name=source.chat_name,
chat_type=source.chat_type,
thread_id=source.thread_id,
session_db=self._session_db,
fallback_model=self._fallback_model,
)
Expand Down Expand Up @@ -5937,12 +5942,18 @@ def _set_session_env(self, context: SessionContext) -> None:
os.environ["HERMES_SESSION_CHAT_ID"] = context.source.chat_id
if context.source.chat_name:
os.environ["HERMES_SESSION_CHAT_NAME"] = context.source.chat_name
if context.source.chat_type:
os.environ["HERMES_SESSION_CHAT_TYPE"] = context.source.chat_type
if context.source.user_id:
os.environ["HERMES_SESSION_USER_ID"] = context.source.user_id
if context.source.user_name:
os.environ["HERMES_SESSION_USER_NAME"] = context.source.user_name
if context.source.thread_id:
os.environ["HERMES_SESSION_THREAD_ID"] = str(context.source.thread_id)

def _clear_session_env(self) -> None:
"""Clear session environment variables."""
for var in ["HERMES_SESSION_PLATFORM", "HERMES_SESSION_CHAT_ID", "HERMES_SESSION_CHAT_NAME", "HERMES_SESSION_THREAD_ID"]:
for var in ["HERMES_SESSION_PLATFORM", "HERMES_SESSION_CHAT_ID", "HERMES_SESSION_CHAT_NAME", "HERMES_SESSION_CHAT_TYPE", "HERMES_SESSION_USER_ID", "HERMES_SESSION_USER_NAME", "HERMES_SESSION_THREAD_ID"]:
if var in os.environ:
del os.environ[var]

Expand Down Expand Up @@ -6734,6 +6745,11 @@ def run_sync():
session_id=session_id,
platform=platform_key,
user_id=source.user_id,
user_name=source.user_name,
chat_id=source.chat_id,
chat_name=source.chat_name,
chat_type=source.chat_type,
thread_id=source.thread_id,
session_db=self._session_db,
fallback_model=self._fallback_model,
)
Expand Down
11 changes: 8 additions & 3 deletions plugins/memory/hindsight/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ Config file: `~/.hermes/hindsight/config.json`
| `auto_retain` | `true` | Automatically retain conversation turns |
| `retain_async` | `true` | Process retain asynchronously on the Hindsight server |
| `retain_every_n_turns` | `1` | Retain every N turns (1 = every turn) |
| `retain_context` | `conversation between Hermes Agent and the User` | Context label for retained memories |
| `tags` | — | Tags applied when storing memories |
| `retain_context` | `conversation between Hermes Agent and the User` | Base context label for retained memories; periodic window docs use `<retain_context>_window` |
| `retain_tags` | — | Default tags applied to retained memories; merged with per-call tool tags |
| `retain_source` | — | Optional `metadata.source` attached to retained memories |
| `retain_user_prefix` | `User` | Label used before user turns in retained transcripts |
| `retain_assistant_prefix` | `Assistant` | Label used before assistant turns in retained transcripts |
| `retain_chunk_every_n_turns` | `0` | Also retain a sliding conversation window every N turns (`0` disables) |
| `retain_chunk_overlap_turns` | `0` | Extra prior turns included in chunked conversation windows |

### Integration

Expand Down Expand Up @@ -113,7 +118,7 @@ Available in `hybrid` and `tools` memory modes:

| Tool | Description |
|------|-------------|
| `hindsight_retain` | Store information with auto entity extraction |
| `hindsight_retain` | Store information with auto entity extraction; supports optional per-call `tags` |
| `hindsight_recall` | Multi-strategy search (semantic + entity graph) |
| `hindsight_reflect` | Cross-memory synthesis (LLM-powered) |

Expand Down
Loading