Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.compose.market/llms.txt

Use this file to discover all available pages before exploring further.

These are the runtime paths behind Manowar memory: runtime/src/manowar/memory, runtime/src/manowar/agent/memory.ts, and runtime/src/manowar/workflow/memory.ts.

Pre-turn retrieval

Agent execution calls retrieveAgentMemory() before the model/tool loop.
{
  "step": "pre_turn",
  "query": "Continue the deployment checklist",
  "agentWallet": "0x1234567890abcdef1234567890abcdef12345678",
  "userAddress": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd",
  "threadId": "run:deploy-42",
  "layers": ["working", "scene", "graph", "patterns", "archives", "vectors"],
  "limit": 12,
  "maxItems": 6,
  "maxItemChars": 120,
  "budget": {
    "maxCharacters": 900
  }
}
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:
ArtifactFunctionTiming
TranscriptstoreTranscript()In-band.
Working memoryrememberSessionMessages()In-band.
Session vectorindexMemoryContent(source: "session")In-band.
Graph factsindexAgentMemoryFacts()Queued with queueMicrotask().
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().
{
  "step": "remember",
  "agentWallet": "0x1234567890abcdef1234567890abcdef12345678",
  "userAddress": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd",
  "threadId": "run:deploy-42",
  "content": "The user prefers Terraform examples over console instructions.",
  "type": "preference",
  "retention": "pinned",
  "confidence": 1
}
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:
SettingDefault
Modelgemini-3.1-flash-lite-preview
API path${API_URL}/v1/chat/completions
Timeout8000 ms
Max facts per turn5
Min confidence0.6
Max fact length240 characters
Response formatJSON object
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.
FunctionBehavior
addMemoryWithGraph()Stores a workflow turn, checkpoint, or evaluation as a source: "session" vector and queues fact extraction.
searchMemoryWithGraph()Recalls workflow memory with vector search, decay, rerank, and MMR.
getAgentReliability()Aggregates quality and success metadata for a workflow agent.
performSafeWipe()Stores a compact context-window summary as a session vector.
getAllMemories()Lists recent workflow memories for admin/debug use.
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.
SourcePathBehavior
Genesis knowledgeruntime/src/manowar/knowledge/genesis.tsReads agent-card knowledge URIs through Pinata, parses PDF/JSON/text, chunks around 1400 characters with 180 overlap.
Workspace knowledgeruntime/src/manowar/knowledge/workspace.tsAccepts files, URLs, or pasted text per agent/user. Callers can provide embeddings or let memory index content.
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:
Route familyUse
/api/memory/add, /api/memory/search, /api/memory/{agentWallet}Fact-style graph memory compatibility.
/api/memory/vector-search, /api/memory/vector-indexDirect vector search/index operations.
/api/memory/transcript-store, /api/memory/transcript-get/{id}Direct transcript storage and lookup.
/api/memory/rerankDirect document reranking.
/api/memory/layers/searchDirect six-layer search.
These routes call the same underlying modules as the canonical loop routes.