hermes - 💡(How to fix) Fix Feature: UnifiedContextEngine plugin — coordinated MemGPT + BigMemory + Cognitive memory [1 participants]

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…
GitHub stats
NousResearch/hermes-agent#11590Fetched 2026-04-18 06:00:04
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Code Example

# config.yaml
context:
  engine: "unified"  # activates this plugin
RAW_BUFFERClick to expand / collapse

Feature: UnifiedContextEngine Plugin

Motivation

The current Hermes Agent has several context/memory subsystems that are loosely integrated:

  1. ContextCompressor (agent/context_compressor.py) — LLM-based message compaction
  2. Big-Memory — Snapshot before compaction for recovery
  3. MemGPT-style — Hierarchical memory with core/episodic/semantic/archival
  4. Cognitive-Memory — Reflection engine, fact extraction
  5. Hermes Memory Tiering — LivingMemoryLoader for tiered core memory

These are valuable but independently operated. A unified engine can coordinate them.

What UnifiedContextEngine Does

plugins/context_engine/unified/__init__.py implements a single plugin that:

  1. Coordinates all subsystems: Rather than 5 independent systems, one engine orchestrates them
  2. Extracts and persists facts: On each compress, calls remember_fact(), add_entity(), add_lesson() automatically
  3. Uses SQLite for facts/entities: Maintains a memories.db for cross-session facts
  4. Unified snapshot: Takes a single snapshot before any compaction
  5. Preserve-on-failure: If any subsystem fails, the original messages are preserved (not partially committed)

Key Design Decisions

  • SQLite facts DB: Cross-session persistence of extracted facts, entities, lessons
  • Protected ranges: _PROTECT_FIRST_N (default 3) + _PROTECT_LAST_N (default 20) turns never compressed
  • Threshold: 80% of context length triggers compression
  • Auto-extract: Every compress() call extracts new facts/entities/lessons and persists them

Integration Points

# config.yaml
context:
  engine: "unified"  # activates this plugin

Open Questions for Upstream

  1. Should facts/entities be stored in the existing memory/ directory or a new location?
  2. Should the extract-and-persist happen at compress time (costly) or async/batched?
  3. What's the eviction policy for the facts DB?

extent analysis

TL;DR

To integrate the UnifiedContextEngine plugin, update the config.yaml file to activate the plugin by setting context: engine to "unified".

Guidance

  • Review the plugins/context_engine/unified/__init__.py implementation to understand how the plugin coordinates the different subsystems.
  • Consider the trade-offs of storing facts and entities in the existing memory/ directory versus a new location, as this may impact performance and data management.
  • Evaluate the optimal timing for extract-and-persist operations, weighing the costs of synchronous versus asynchronous/batched approaches.
  • Develop an eviction policy for the facts database to ensure efficient storage management.

Example

No code snippet is provided as the issue focuses on design and integration decisions rather than specific code implementation.

Notes

The provided information lacks details on error handling, performance metrics, and potential bottlenecks, which are crucial for a comprehensive solution.

Recommendation

Apply workaround: Update the config.yaml file to activate the UnifiedContextEngine plugin, allowing for further testing and evaluation of the integrated subsystems. This will enable the development of a more comprehensive solution addressing the open questions and design decisions.

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: UnifiedContextEngine plugin — coordinated MemGPT + BigMemory + Cognitive memory [1 participants]