hermes - 💡(How to fix) Fix [Feature]: Tiered memory system (short-term, medium-term, long-term) for Hermes Agent

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

Problem or Use Case

Propose implementing a tiered memory architecture for Hermes Agent to manage context and recall more efficiently: - Short-term memory (ST-M): extremely fast, in-memory scratchpad with a short TTL (~20 seconds). Captures all recent interactions. - Medium-term memory (MT-M): cached memory with a longer TTL (~20 minutes). Stores more detailed recall and non-urgent context; items may be promoted to long-term memory based on relevance. - Long-term memory (LT-M): persistent knowledge base backed by Hermes memory backend (existing memory tool). Key facts and high-signal items are kept long-term. The goal is to reduce prompt/context bloat while preserving useful information for future sessions and tasks.

  • Motivation and use cases - Dialogue-heavy tasks where late context is important but not needed forever (e.g., ongoing research threads, coding sessions, project planning). - Scenarios where the agent should remember important facts across sessions without drowning the current context. - Better user experiences for long-running tasks by preserving high-signal information.

Proposed Solution

   - Attach a new tiered-memory module that can be enabled via config (e.g., memory.tiers.enabled: true).
   - ST-M: ephemeral in-memory store with automatic expiry (20s). “Remember everything” policy for the active session.
   - MT-M: in-memory cache with TTL 20 minutes. Includes lightweight compression/summary to fit budget.
   - LT-M: leverage existing memory tool API (memory.add/memory.replace, etc.) to persist validated items.
   - Data flow:
     - On each user input or assistant output, the system records to ST-M.
     - If an item meets promotion criteria (e.g., importance, frequency, recency), promote to MT-M.
     - If still valuable after MT-M retention, promote to LT-M via the memory tool.
     - Recall requests search ST-M, MT-M, then LT-M in order; results are ranked by tier and recency/importance.
   - Configurable knobs (example):
     - memory.tiers.enabled: true/false
     - memory.tiers.short.ttl_seconds: 20
     - memory.tiers.medium.ttl_seconds: 1200
     - memory.tiers.promotion_heuristic: [frequency, recency, explicit_user_tag]
   - API/interface (conceptual, to implement or wrap):
     - tiered_memory.remember(text, metadata, tier, ttl)
     - tiered_memory.recall(query, limit)
     - tiered_memory.promote(item_id, target_tier)
   - Implementation options:
     - Core integration: modify the agent’s memory/context pipeline to insert tiered storage and automatic promotion.
     - Extension approach: implement as a dedicated Hermes skill or memory manager wrapper that coordinates with the existing memory tool‑chain (lower risk, slower to deploy).
   - Observability:
     - Telemetry on hits/misses per tier, TTL expirations, average recall latency, memory footprint.

Alternatives Considered

   - Lightweight scratchpad per session without MT-M/LT-M promotions (simpler but less powerful).
   - Rely solely on optimized prompt compression (less invasive but may not scale for long-running tasks).

Feature Type

New bundled skill

Scope

Large (new module or significant refactor)

Contribution

  • I'd like to implement this myself and submit a PR

Debug Report (optional)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Feature]: Tiered memory system (short-term, medium-term, long-term) for Hermes Agent