Prompt Library ⚙️ Technical Agent Memory and State Management System
GPT-4o ⚙️ Technical Advanced

Agent Memory and State Management System

Design a persistent memory and state management architecture for AI agents that need to maintain context across sessions and coordinate shared knowledge.

👁 7 views ⎘ 0 copies ♥ 0 likes

The Prompt

# Agent Memory and State Management System

You are an AI systems architect. Design a complete memory and state management system for [AGENT_SYSTEM_NAME].

## System Context

- Agent system: [AGENT_SYSTEM_NAME]
- Number of agents: [AGENT_COUNT]
- Session length: [SESSION_DURATION]
- Cross-session persistence required: [YES_OR_NO]
- Multi-user or single-user: [USER_TYPE]

## Memory Taxonomy

**Working Memory** (current session only)
- What it stores: active task context, intermediate results, current user intent
- Capacity limit: [WORKING_MEMORY_LIMIT]
- Eviction policy: [EVICTION_STRATEGY]

**Episodic Memory** (past interactions)
- What it stores: conversation history, decisions made, outcomes observed
- Retention period: [RETENTION_PERIOD]
- Structure: [EPISODIC_SCHEMA]

**Semantic Memory** (learned knowledge)
- What it stores: facts, user preferences, domain knowledge
- Update trigger: [UPDATE_CONDITIONS]
- Confidence scoring: how certainty is tracked per fact

**Procedural Memory** (how-to knowledge)
- What it stores: successful workflows, proven prompt patterns
- When to apply: [RETRIEVAL_CONDITIONS]

## Retrieval Architecture

Define how agents query memory:
- Similarity search for relevant past episodes
- Keyword retrieval for specific facts
- Recency weighting formula
- Confidence threshold for using vs. ignoring a memory

## Conflict Resolution

When two agents write conflicting information to shared memory:
1. Detection: how the conflict is identified
2. Resolution strategy: [RESOLUTION_RULES]
3. Audit: how conflicts are logged for review

## Persistence Layer

Specify the storage backend, serialization format, and backup strategy for production deployment.

📝 Fill in the blanks

Replace these placeholders with your own content:

[AGENT_SYSTEM_NAME]
[AGENT_COUNT]
[SESSION_DURATION]
[YES_OR_NO]
[USER_TYPE]
[WORKING_MEMORY_LIMIT]
[EVICTION_STRATEGY]
[RETENTION_PERIOD]
[EPISODIC_SCHEMA]
[UPDATE_CONDITIONS]
[RETRIEVAL_CONDITIONS]
[RESOLUTION_RULES]

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.