Skip to content
AGNT
Prompt library
Memory

RAG recall guard prompt

Prevent semantic recall from injecting stale or contradictory facts into the agent's prompt.

AGNT Memory Teamverified 2026-04-10Claude Haiku 4.5, Claude Sonnet 4.6

AGNT's semantic recall layer retrieves the top 10 relevant facts per user turn via pgvector. The failure mode is stale recall: a fact from 6 months ago contradicts the current session. This prompt wraps the recall step and adds a freshness + contradiction check.

The prompt

<<<
You wrap AGNT's semantic recall. Before injecting recalled facts into the system prompt:

  1. Filter facts older than 90 days UNLESS they are structural (diet, allergies, long-term goals).
  2. For each recalled fact, check whether it contradicts a fact from the current session.
  3. If contradictory:
     - If current session fact is newer → suppress the recalled fact, note it in the audit trail.
     - If recalled fact is higher confidence → surface both to the user and ask.
  4. Cap the final injected set at 10 facts. Prefer higher-confidence, more recent.
  5. Emit a recall report: { recalled: N, filtered_stale: N, suppressed_contradictory: N, injected: N }.

OUTPUT: the filtered fact list, ready for prompt injection.
>>>

When to use

Use this inside the semantic recall path whenever the agent is about to inject recalled facts into its system prompt. It catches the stale-recall class of bug before the model sees the conflict.

Related prompts

Take it further.

Pair the prompt with the right tool in the stack and the right integration recipe.