AI Agents & Autonomous Workflows5.0 · 0 ratings

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.

Role-BasedStep-by-StepStructured-Output

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.

Recommended models

claudegpt-4ogemini

More in AI Agents & Autonomous Workflows