Memory awareness for LLM agents — enabling Hermes Agent to automatically recall relevant context at the start of every session, transforming passive retrieval into proactive memory emergence.
Built on ADR-0001 (v1→v6,评审迭代). Integrates with Hermes Agent as a non-invasive subprocess module.
Session Start
↓
perceive-memory.py (perception pipeline)
↓
Retrieves from 5 memory layers → assembles structured summary (≤1500 chars)
↓
Injects into system prompt memory block
↓
Agent naturally recalls relevant context
Current MVP: L0 (MEMORY.md) + L1 (Palace SessionDB). L2 (Obsidian wiki) and L3 (gbrain graph) expansion planned.
Even with a 5-layer memory infrastructure in place:
- Memory layers are siloed — searching L1 finds nothing in L2; searching L2 ignores L3 graph connections
- Passive retrieval only — the agent only knows what it explicitly retrieves; it doesn't naturally recall context during conversation
- No session-to-session continuity — every new session starts blank unless context is manually written to MEMORY.md
| Feature | Detail |
|---|---|
| Non-invasive | Subprocess call + file write; injection logic stays outside agent core |
| Cross-platform | Windows + Linux developed separately, merged with one sys.executable fix |
| ADR-driven iteration | v1→v6, each review round surfaced previously unconsidered edge cases |
| Graceful degradation | Timeout/failure silently skipped; agent starts normally regardless |
| Fast | ~630ms per run, built-in cache, 3s timeout fallback |
| Idempotent | .injected marker + content deduplication prevents double injection |
Automatic (no user action required): Every new session (/new or first Feishu message) triggers the pipeline automatically.
Manual trigger:
python ~/.hermes/scripts/perceive-memory.py <session_id> summaryView cache:
ls ~/.hermes/perception_cache/
# {session_id}.summary # perception summary
# {session_id}.injected # idempotency markerForce regeneration (debug):
rm ~/.hermes/perception_cache/{session_id}.summary
rm ~/.hermes/perception_cache/{session_id}.injected
# then start a new sessionRun integration tests:
cd ~/.hermes/hermes-agent
python -m pytest tests/run_agent/test_perceive_memory_integration.py -vhermes-perception/
├── README.md # This file — English version
├── README_CN.md # 中文版
├── SKILL.md # Hermes skill format (for agent loading)
└── ADR-0001.md # Full architecture decision record
- L2 wiki/Sources retrieval — connect so the agent can recall conclusions organized in the wiki
- L3 gbrain graph retrieval — connect so the agent knows the full association chain
- Golden Set test cases — end-to-end recall quality validation
- Recall quality annotation —
[high/medium/low]reliability labels
Hermes Agent — the perception pipeline is a memory-enhancement module for Hermes Agent.
Topics: hermes-agent ai-agent memory-awareness llm-memory context-injection perception-system agent-framework conversation-memory session-management retrieval-augmented