Pure helpers that weave a memory provider into an agent turn.
The provider is the normalized form {module, opts} (or nil when memory is
disabled). enrich_messages/3 prefetches memories relevant to the current
query and injects them as a system message, kept after any leading static
system messages so a cacheable system prefix is undisturbed. Memory failures
degrade to a no-op so a backend issue never fails an agent turn.
Writes are explicit (the memory_remember action). Automatic post-turn
capture is a documented future extension, not wired here.
Summary
Functions
Inject relevant memories into messages for the given query.
Append a provider's build_user_context/1 block to the LAST user message.
Types
Functions
Inject relevant memories into messages for the given query.
Append a provider's build_user_context/1 block to the LAST user message.
Unlike enrich_messages/3, which injects into the system prefix, this injects
into the user message so a per-turn refresh leaves the cacheable system prefix
untouched. A nil provider, an absent callback, or a failure is a no-op.