Memory Defrag (agent) is a structured process for reorganizing stored conversational memory into coherent, topical groupings. The agent is designed to assist users in maintaining clarity, continuity, and long-term usability of their archived knowledge—particularly in contexts where the underlying memory system becomes saturated, fragmented, or deprecated due to account-level memory constraints.
When a 📝ChatGPT account reaches its memory limit, users lose the ability to retain and retrieve contextually rich, interconnected information across threads. As a result, important insights, decisions, and patterns stored over time can become inaccessible or disorganized. The Memory Defrag provides a way to surface and reformat that knowledge into a single, editable document, giving users the ability to re-structure, refine, and—if desired—store a streamlined version in future sessions or external systems.
The agent performs a read-only sweep of all accessible stored memory, without modifying or deleting the original content. It clusters related memories by topic, preserves original tone and specificity, and outputs the result as a modular draft. This allows the user to review, edit, or selectively re-ingest their memory on their own terms, ensuring continuity of thought and strategic context, even when default memory is no longer active.
This tool is especially valuable during account transitions, memory resets, or moments of significant context drift—helping the user preserve coherence across evolving use cases.
Instructions
- On desktop, access the Saved Memories in your 📝ChatGPT.
- Copy/paste everything in your saved memories into a document or text file.
- Once your memories are saved, click the red 'Delete all' button in the bottom right.
- Copy/paste the prompt below into a new chat and append your saved memories.
- Review and edit the output as needed.
- Say "store all of this in memory".
Prompt
Your role is to act as a memory defragmentation agent. Your task is to organize all stored memory into coherent and navigable groupings. This is a read-only operation on memory. You must not update, overwrite, merge, or alter the stored memory in any way when this prompt is run. The memory should remain unchanged until the user explicitly approves the revised version. This is a read-only operation for memory access and reorganization. All output should be treated as a working draft, not as a final update. Do not summarize or condense individual memories. Instead, combine and cluster them based on topic, ensuring that no details are lost. Use natural language and full paragraphs when rendering memories, unless the original format was otherwise. Structure your output using clear topical labels, and preserve any existing relationships between memories by nesting or sequencing related entries. Avoid embellishment, interpretation, or inferred connections. Maintain a neutral and precise tone throughout. If multiple memories contain overlapping or complementary content, merge them while retaining all relevant nuance and specificity. If any memory appears incomplete, ambiguous, or fragmented, flag it for review without attempting to resolve or revise it yourself. Present the result in a structured, modular format that supports future reorganization or tagging. Do not add commentary, framing, or conclusions. Your sole focus is clarity, integrity, and topical cohesion of the memory archive. Open the output in Canvas so the user can edit where needed. At the end of the output, ask the user: "Would you like to make any edits to this defragmented memory, or should I store this version in memory?" Here are the existing memories to be defragmented:
