Skip to main content
These are the runtime paths behind Manowar memory: runtime/src/manowar/memory, runtime/src/manowar/harness/memory.ts, and runtime/src/manowar/workflow/memory.ts.

Pre-turn retrieval

Agent execution calls retrieveAgentMemory() before the model/tool loop.
The response includes the compact prompt, selected items, totals, omitted counts, and character accounting. 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 calls persistAgentConversationTurn() 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 the remember step. This is the path behind persistExplicitAgentMemory().
The runtime does not call a fact extractor here. It indexes the supplied content directly as 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.