Agent Memory Architecture And Summarization Policy
Designs short-term, long-term, and episodic memory plus a summarization policy to keep an agent coherent across long sessions.
Prompt
ROLE: You are a context-engineering specialist designing memory for long-running agents. CONTEXT: My agent runs sessions of [SESSION_LENGTH] and must remember [WHAT_TO_REMEMBER] across turns and across sessions. Context window budget is [TOKEN_BUDGET]. Stale or wrong memory has caused [MEMORY_PROBLEM]. TASK: Design the memory system. 1. Define memory tiers: working (current task), episodic (this session), and long-term (across sessions). State what belongs in each. 2. Define a write policy: what gets committed to long-term memory and what is discarded. 3. Define a retrieval policy: how relevant memories are recalled into context for a new turn. 4. Define a summarization/compaction policy that triggers at [TRIGGER] and preserves decisions, open threads, and constraints while dropping noise. 5. Define a conflict/staleness rule when new info contradicts a stored memory. OUTPUT FORMAT: A tier table (Tier | Stores | Write Rule | Retention | Retrieval Trigger), the compaction prompt template, and the staleness-resolution rule. CONSTRAINTS: Never let memory exceed [TOKEN_BUDGET]; compaction must be deterministic about what it keeps. Preserve every unresolved obligation; losing a commitment is unacceptable.
How to use this prompt
- 1
Copy the prompt above and paste it into ChatGPT, Claude, or Gemini — or open it in the visual Studio to edit each part on a canvas and run it with your own key.
- 2
Replace any bracketed placeholders with your specifics. The more concrete your context and constraints, the sharper the result — see the 5-part prompt structure.
- 3
Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.
Techniques in this prompt
Assigns the model an expert persona so it adopts the right vocabulary, depth, and standards for the task.
Learn this techniqueForces explicit intermediate reasoning instead of jumping to a conclusion, which improves accuracy on hard tasks.
Learn this techniquePins the response to a defined structure so it drops straight into your workflow.
Learn this techniqueRecommended models
Build on this prompt
Open it in the visual Studio to wire it into a full workflow with your own API key — or learn the craft behind prompts like this.
More in AI Agents & Autonomous Workflows
Autonomous Agent System Prompt Architect
Designs a complete, production-grade system prompt for an autonomous agent including persona, tool contracts, guardrails, and stop conditions.
ReAct Loop Reasoning Trace Designer
Builds a strict ReAct-style Thought/Action/Observation loop with explicit formatting and self-correction rules for tool-using agents.
Multi-Agent Orchestration Blueprint
Plans a coordinated multi-agent team with roles, hand-off contracts, shared memory, and conflict resolution for a complex objective.
Agent Tool Definition And Schema Writer
Writes precise tool/function definitions with JSON schemas, descriptions, and usage hints that minimize wrong-tool and bad-argument errors.