MEM-OBS-01Tier IIMemory Stratification

Retrieval Ranking & Relevance Control

Rank retrieved memories and context by relevance and freshness before presenting to the reasoner, not just top-K by cosine similarity.

Runtime: ObserveAgentOps: Operate & MonitorSee on the matrix →
RETRIEVAL RANKING & RELEVANCE Query Dense + Sparsehybrid recall Cross-Encodererank top-K Scoresim · fresh ·trust Threshold CaprelevancefloorTop-K by cosine alone returns "related" but not "relevant".
In Plain English

This page is the complete instruction page for one pattern called "Retrieval Ranking & Relevance Control." It explains the problem this pattern solves, the idea behind the solution, when you should (and should not) use it, and what happens afterward, both the good effects and the costs.

This matters because building AI agents is not just about making them clever. It is also about making them safe and predictable. Following a well-tested pattern like this one helps avoid common mistakes, and shows you exactly which safety rules and regulations it connects to, listed under "Standards Mesh" on this page.

Context

Vector similarity alone produces retrieval results that are topically close but practically irrelevant. Stale, low-quality, or off-context memories confuse reasoning.

Problem

Naive similarity retrieval returns "related" but not "relevant" content.

Forces

  • Recall vs precision
  • Freshness vs coverage

Solution

Rank retrievals by a composite score: similarity × freshness × source trust × task-relevance. Apply hybrid retrieval (dense + sparse). Use cross-encoder re-ranking for top-K refinement. Cap context by relevance threshold, not fixed K.

Placement

Where this pattern acts in the two lifecycles

Runtime Cognitive
01Perceive
02Reason / Plan
03Decide
04Act
05Observe
06Reflect / Learn
07Terminate

05 Observe. Tool result ingestion, state update. 7 of 61 catalogue patterns act at this stage.

AgentOps Lifecycle
01Design & Scope
02Build & Integrate
03Evaluate & Red-Team
04Deploy
05Operate & Monitor
06Iterate & Adapt
07Decommission

05 Operate & Monitor. Runtime telemetry, drift detection. 18 of 61 catalogue patterns act at this stage.

Stages and counts from the catalogue data. The Runtime lens is the loop the agent runs each turn; the AgentOps lens is the lifecycle the team runs the agent through. See the Matrix for every pattern at each stage.

Applicability

  • RAG agents
  • Memory-heavy agents
  • Agents with large or heterogeneous knowledge stores

Anti-Patterns

  • Fixed top-K without relevance check
  • Single-stage dense-only retrieval at scale

Consequences

  • +Higher reasoning quality
  • +Reduced context waste
  • −Ranking pipeline complexity
  • −Tuning required per corpus