community icon indicating copy to clipboard operation
community copied to clipboard

Context mounting policy for active recall

Open nierclaw-sudo opened this issue 8 months ago • 2 comments

I've been using NMEM in agent workflows for a bit, and one thing that keeps coming up is that retrieval and context mounting still feel like two separate problems, but only the first one is really explicit today.

Search can find relevant memories. That's fine. But after that there is still a second decision: given a limited context budget, which memories should actually make it into the active context?

That starts to matter pretty quickly once recall is pulling from more than one place:

  • Working Memory
  • search hits
  • crystals
  • thread snippets
  • graph-adjacent / EVOLVES-linked memories

Different workloads want very different behavior here. Coding sessions usually want decisions, procedures, and thread-backed implementation context. Ops sessions want recent incidents, flags, and status shifts. Research sessions often want crystals, provenance, and graph neighborhood.

Right now the only real option is to approximate that policy client-side, which means each integration ends up growing its own ranking logic. That feels like the wrong place for it.

What I'd like to see is a proper mounting layer after retrieval:

  1. collect candidates from the existing recall surfaces
  2. score them using configurable signals
  3. select under a token / item budget
  4. return that mounted subset for context injection

Signals that seem useful here:

  • semantic relevance
  • importance
  • recency
  • unit type
  • graph distance / relationship strength
  • Working Memory boost
  • thread provenance boost
  • crystal boost

I could imagine this exposed either as profiles or explicit policy params. Something like:

  • mount_profile = coding | ops | research | custom
  • token_budget
  • max_items
  • per-signal weights
  • include / exclude unit types
  • include / exclude labels

The main reason I'm filing this here instead of solving it in one integration is that this feels like a core memory-system problem, not an OpenClaw-specific one. The same thing will show up anywhere NMEM is being used seriously for agent context.

If NMEM owned the mounting policy centrally, integrations could ask for "best context for this task shape" instead of rebuilding the ranking logic over and over.

nierclaw-sudo avatar Apr 01 '26 05:04 nierclaw-sudo

Thanks for reporting this. I’m doing a full issue sweep today so recent bugs do not sit without a maintainer response.

I’m keeping this open for now rather than guessing. It stays in the active triage set until we either confirm it is already fixed in recent work or turn it into a concrete implementation task.

wey-gu avatar Apr 21 '26 06:04 wey-gu

Thanks for opening this, and welcome. I’m doing a full issue sweep today so older requests do not just sit here unanswered.

I’m keeping this open as backlog / product planning, not closing it away. When we touch this area more concretely, I’ll try to come back here with either a design direction or an implementation update.

wey-gu avatar Apr 21 '26 07:04 wey-gu