v0.7: Memory Manager And Owner Model [PARTIAL]¶
Implementation Status¶
- [x]
MemoryStoreexists and manages markdown memory plusFACTS.md. - [x]
remember,recall, andupdate_profiletools use the current memory store. - [x]
ContextBuilderretrieves relevant memory before prompt assembly. - [x]
g_agent/memory/manager.pyexists. - [x]
MemoryManagerandMemoryProviderfirst slice exists. - [x] Provider registration/order/failure isolation implemented with tests.
- [x] Memory prefetch is formalized through a manager with fenced output.
- [ ] External memory provider selection is not implemented.
- [ ] Memory write cadence hooks are not fully wired.
Goal¶
Create durable character memory without prompt bloat.
User Outcome¶
The character can remember owner facts, preferences, people, relationships, projects, routines, environment quirks, and character reflections without stuffing every memory into every prompt.
Scope¶
- Add built-in local memory provider.
- Add context fencing so recalled memory is never treated as new user input.
- Add pre-turn recall and post-turn sync lifecycle hooks.
- Add configurable write cadence.
- Allow at most one external memory provider at a time.
- Evaluate Honcho-style user modeling as optional later.
- Evaluate local fact-store ideas before adding external dependency.
Memory Categories¶
- owner facts
- preferences
- people/relationships
- projects
- routines
- environment/tool quirks
- character reflections
Write Cadence Options¶
- immediate/manual
- async after turn
- session-end
- every N turns
Module Targets¶
backend/agent/g_agent/memory/manager.pybackend/agent/g_agent/memory/local_store.pybackend/agent/g_agent/memory/types.pybackend/agent/g_agent/context/backend/agent/tests/test_memory_manager.pybackend/agent/tests/test_memory_context_fencing.py
Acceptance Criteria¶
- [x] Memory recall is fetched before prompt assembly through
MemoryManager. - [x] Memory is placed under the runtime metadata section with provider fencing.
- [x] Owner can update facts through current memory tools.
- [x] Memory blocks use provider-level fencing.
- [ ] Memory writes can be manual or async through a manager.
- [x] Only one external provider can be active at a time.
References¶
hermes-agent-ref/agent/memory_manager.pyhermes-agent-ref/plugins/memory/honcho/README.mdhermes-agent-ref/plugins/memory/holographic/README.md
Agent Handoff¶
Current G-Agent State¶
agent/memory.pyis markdown-backed and already useful.MemoryStorecreates and reads core files:MEMORY.md,PROFILE.md,RELATIONSHIPS.md,PROJECTS.md,FACTS.md,LESSONS.md,SUMMARIES.md,INBOX.md, and daily notes.ContextBuildercallsMemoryManager.prefetch_all(query=...).- Tools
remember,recall, andupdate_profileare registered fromagent/tools/integrations.py. - Metrics can record memory recall events, but write cadence is not fully wired through the manager.
Implementation Strategy¶
Wrap the existing MemoryStore as the built-in provider. Do not rewrite memory
storage in the first step.
Recommended shape:
memory/provider.py: provider interface.memory/builtin.py: adapter around currentMemoryStore.memory/manager.py: provider orchestration.memory/context.py: context fencing helpers.
Implementation Slices¶
- Add write cadence config and hook it into post-turn lifecycle.
- Route legacy memory tools through
MemoryManagerwithout changing command UX. - Add memory feedback/update/remove actions through the manager.
- Add manager-level recall metrics.
- Add optional external provider config after the local provider is stable.
Tests¶
test_memory_manager.py- builtin provider registered
- second external rejected
- provider failure does not block builtin
- tool schema routing works
test_memory_context_fencing.py- recalled memory is fenced
- malicious fence tags are stripped
- context builder includes memory in stable place.
Guardrails¶
- Do not delete markdown memory files.
- Do not add Honcho or external memory dependency in this milestone.
- Do not auto-write memory without owner review; that belongs to v0.8.
First PR Boundary¶
MemoryProvider interface + BuiltinMemoryProvider adapter + MemoryManager
prefetch integration in ContextBuilder. Shipped with provider
registration/order/failure isolation/fenced output tests. Production-grade
Hermes parity not proven; write cadence and external provider config remain.