AI Agents & RAG

Verified against Mem0 · 2026-08-01

Decide what an agent should actually remember across sessions

A prompt for designing an agent's memory architecture across three tiers — session-scoped, long-term user-specific, and long-term agent-general — plus an explicit contradiction-handling rule and a similarity-based recall trigger, instead of defaulting to storing the full transcript and searching it later.

ClaudeGPT-5.1Mem0LangGraph (memory store)4 fillable variables

The prompt

Ready to copy — highlighted parts are example details you can swap.

You are designing the memory architecture for a personal productivity assistant used daily across many sessions, deciding what actually gets persisted across sessions, what stays scoped to a single conversation, and how a stored memory gets corrected or forgotten later — not defaulting to "store the full conversation transcript and search it later" as the whole memory design.

AGENT AND USE CASE
Users ask it to schedule tasks, draft emails, and answer questions about their own notes over weeks of use

MEMORY CANDIDATES
stated communication preferences ('keep emails short'), the user's job title and team, facts extracted from meeting notes, the specific wording of past questions, corrections the user makes to the agent's mistakes

MEMORY TIER RULES
- Session-scoped: information relevant only to completing the current task, that would be noise in any future conversation — the specific phrasing of a question just asked, an intermediate reasoning step.
- Long-term, user-specific: durable facts about this specific user that should carry forward, such as a stated preference, a role, or a recurring constraint, and that would save the user from repeating themselves. State exactly what qualifies, since "remember everything the user says" is not a decision, it's the absence of one, and it makes every future retrieval noisier for no benefit if the fact was never going to matter again.
- Long-term, agent-general: things the agent learns that should apply across all users, such as a correction to a fact it got wrong. This tier needs its own review process before going live for everyone, since a wrong general memory affects every future user, not just the one conversation it came from.

For each candidate in the memory candidates list, assign it to exactly one tier and justify the assignment against the criteria above — don't leave a candidate unassigned or default it to long-term because storage is cheap; the cost of a bad tier decision isn't storage, it's retrieval noise and, for wrong memories, actively bad future behavior.

STALENESS AND CORRECTION
- State how a stored memory gets updated when it becomes wrong — is there an explicit "update this memory" action, or does a new statement just get appended alongside the old, contradictory one forever?
- State what happens when the agent retrieves two memories that contradict each other — does it surface the contradiction to the user, prefer the more recent one silently, or something else? Pick one and say why, because silent conflict resolution is itself a policy decision, not a neutral default.

RETRIEVAL AT RECALL TIME
long-term memories are retrieved via semantic similarity search against the current message, top 3 only, never bulk-injected — state what triggers pulling a memory into context, since always injecting every long-term memory into every prompt defeats the point of tiering memories in the first place by making them all equally present regardless of relevance.

OUTPUT FORMAT
1. The tier assignment for each candidate memory type, with justification.
2. The correction/staleness rule.
3. The recall trigger rule.
4. One example: a specific fact, which tier it lands in, and what happens to it three months later if it becomes false.

Customize

Optional — swap in your own details for the highlighted parts above.

Why this works

The reason 'store everything and search it later' is not actually a memory design is that the cost of an over-broad memory store isn't primarily storage — storage is cheap — it's retrieval noise at the moment memory actually gets used. A memory retrieval step that pulls back three genuinely relevant facts alongside seven irrelevant ones doesn't just waste context window space; it measurably degrades the model's ability to use the relevant three, because models are demonstrably worse at using information buried among a lot of irrelevant surrounding text than the same information presented cleanly. Every candidate memory type that gets stored without a real filter is a future contributor to that dilution, which is why the tiering decision has to happen deliberately per candidate, not as a blanket default. Requiring an explicit policy for contradictory memories addresses a failure that's specific to long-term memory systems and easy to miss until it's already caused a bad interaction: a user states one preference in March and the opposite in July, and if both statements get stored as equally valid long-term facts with no correction mechanism, a future retrieval can surface either one depending on which happens to rank higher for a given query — meaning the agent's behavior becomes inconsistent in a way that looks random to the user, who has no idea the agent is silently flip-flopping between two facts it never resolved. Deciding up front whether corrections overwrite, or whether contradictions get surfaced rather than silently resolved, is what keeps that inconsistency from shipping as a mystery bug three months later. Restricting recall to a small, similarity-ranked set rather than injecting all long-term memories into every prompt is the mechanism that actually makes the tiering worth doing at all. If every stored memory gets pulled into context regardless of relevance to the current message, tiering only changes what gets stored, not what competes for the model's attention at generation time. Limiting recall to the top few genuinely relevant memories is what turns a memory system into something that improves responses instead of one that just adds noise the model has to work around.

What you get back

Candidate: 'user's job title and team' -> long-term, user-specific (saves the user from restating context every session, low volatility). Three months later, the user changes teams and mentions it in passing; the update overwrites the stored fact rather than appending a second, contradictory one, and the agent's next reference to team context uses the new value without surfacing the change unless directly asked.

Verified against

Mem0 1.1 · 2026-08-01

Claude Sonnet 4.6 · 2026-08-01

Changelog

  • 2026-08-01 Initial publish, verified against Mem0 1.1 tiered memory store and Claude Sonnet 4.6 recall behavior.

Building this for real?

This is a free starting point. If you'd rather have AI agents & automation built and running for your business, that's Scult's day job.

EXPLORE AI AGENTS & AUTOMATION
All AI Agents & RAG prompts

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY