Prompt Library › ⚙️ Technical › AI Agent Memory Design
GPT-4o ⚙️ Technical Advanced

AI Agent Memory Design

Design a multi-layer memory system for a persistent AI agent — short-term context, long-term storage, and episodic recall.

👁 15 views ⎘ 0 copies ♥ 0 likes

The Prompt

# AI Agent Memory Design

You are an AI memory systems architect. Design a complete memory architecture for the persistent agent I'm building.

## The Agent

Agent purpose: [WHAT THIS AGENT DOES OVER TIME — e.g., personal assistant, customer success bot, research agent]
Session frequency: [e.g., used daily, multiple sessions per day, on-demand]
What the agent needs to remember: [e.g., user preferences, past decisions, prior conversations, learned facts]
Memory that must persist: [e.g., between sessions, across users, across days/weeks]

## Memory Architecture

Design a 3-layer memory system:

**Layer 1: Working Memory (in-context)**
What goes in the context window for a single session. Structure of the context block to include. Maximum tokens to allocate. What gets summarized vs. dropped as the session grows.

**Layer 2: Episodic Memory (session history)**
Storage format for past sessions. Schema for session records. How sessions are retrieved (most recent, by relevance, by date range). Summary compression strategy for old sessions.

**Layer 3: Semantic Memory (long-term knowledge)**
Persistent facts and preferences the agent has learned. Schema for memory entries (key, value, source, confidence, timestamp). How new memories are written and old ones are updated or invalidated.

## Memory Prompts

Write the 3 prompts the agent uses to: (1) retrieve relevant memories before responding, (2) write new memories after a session, and (3) resolve conflicts between old and new memories.

📝 Fill in the blanks

Replace these placeholders with your own content:

[WHAT THIS AGENT DOES OVER TIME — e.g., personal assistant, customer success bot, research agent]
[e.g., used daily, multiple sessions per day, on-demand]
[e.g., user preferences, past decisions, prior conversations, learned facts]
[e.g., between sessions, across users, across days/weeks]

How to use this prompt

1
Copy the prompt

Click "Copy Prompt" above to copy the full prompt text to your clipboard.

2
Replace the placeholders

Swap out anything in [BRACKETS] with your specific details.

3
Paste into GPT-4o

Open your preferred AI assistant and paste the prompt to get started.