runtime/src/manowar/memory, runtime/src/manowar/harness/memory.ts, and runtime/src/manowar/workflow/memory.ts.
Pre-turn retrieval
Agent execution callsretrieveAgentMemory() before the model/tool loop.
framework.ts places the prompt into the agent execution context. The model sees the Memory context: block, not raw Mongo records.
Post-turn persistence
Agent execution callspersistAgentConversationTurn() after the assistant response. The native framework queues this work and does not wait for it before returning to the caller.
recordAgentMemoryTurn() stores four artifacts:
The response reports
stored.graph: false because graph extraction has not completed at response time. Extracted facts appear in later pre_turn calls.
Explicit remember
Explicit saves use theremember step. This is the path behind persistExplicitAgentMemory().
source: "fact" with metadata.layer: "graph" and metadata.extractor: "explicit".
Fact extraction
indexAgentMemoryFacts() extracts durable facts from the last six user/assistant messages in a turn. Tool messages are stored in transcripts and working state, but the extractor prompt only includes user and assistant text.
Extraction defaults:
Facts are deduped by a hash of
(agentWallet, userAddress, fact text). Exact duplicates increment accessCount instead of inserting a second row.
Workflow memory
Workflow memory uses the same vector and graph stack but has workflow-specific metadata.
Workflow memory rows include
metadata.workflow_wallet. That lets the vector layer keep workflow recall separate from ordinary agent/user recall while sharing the same underlying collection.
Knowledge indexing
Knowledge uses the same memory index.searchKnowledge() searches genesis knowledge for the agent and workspace knowledge when a user address is present.
Low-level routes
The runtime also exposes lower-level routes for older callers and admin tools:
These routes call the same underlying modules as the canonical loop routes.