0
Design a two-tier memory architecture for a long-running assistant agent
⁂auto-checked, 3 days oldAauraNovice
The prompt
Design a memory system for an agent that runs {{deployment_context, e.g. a persistent assistant across many sessions with the same user}}. I need a concrete design, not general advice. Cover:
1. What goes in short-term (working/session) memory versus long-term (persisted) memory, with specific examples relevant to this agent's task, and the rule for when something graduates from one to the other.
2. Write format for long-term memories: structured fields (not raw transcript dumps) so they're retrievable and don't bloat the context window, give me the actual schema.
3. Retrieval strategy: how the agent decides what to pull into context for a given turn (recency, relevance search, explicit user reference), and how to avoid retrieving stale or contradicted memories.
4. Conflict resolution: what happens when a new fact contradicts a stored memory (e.g. user says their preference changed) - should it overwrite, version, or flag for confirmation.
5. A concrete forgetting/pruning policy so memory doesn't grow unbounded, with a specific trigger (age, low retrieval frequency, explicit user request) rather than 'periodically clean up'.
Agent context: deployment_context
Expected memory volume/session frequency: volume_context
Where it has been run
| Model | Version | People | Broke | Auto | Last |
|---|---|---|---|---|---|
| Claude | Haiku 4.5 | 0 | 0 | 1/1 | 3 days ago |
Example output
Short-term: full transcript of current session, cleared on session end. Long-term: only facts that would change how the agent should behave in a future session (stated preferences, recurring context like project names, explicit corrections). A fact graduates to long-term only if the user references it again in a later message or explicitly says 'remember this'.
Schema: `{ fact: string, category: 'preference'|'project_context'|'correction', confidence: 'stated'|'inferred', created_at, last_confirmed_at, source_turn_id }`. No raw transcript stored, only the distilled fact.
Retrieval: at session start, pull all memories with `last_confirmed_at` within 90 days, ranked by category (corrections first, since those override defaults), then embed a max of 15 into the system context, dropping lowest-confidence 'inferred' ones first if over budget.
Conflict resolution: if a new statement contradicts a stored 'stated' fact, don't silently overwrite, the agent should say 'I previously had X noted, should I update it to Y' unless the user's new statement is unambiguous ('actually I use Python now, not Java'), in which case overwrite and update `last_confirmed_at`.
Pruning: any 'inferred' memory not confirmed or retrieved in 120 days is dropped automatically; 'stated' memories persist until explicitly contradicted or the user asks to forget.
0 comments
Sign in to comment or report what this prompt did for you.
Sign inNo comments yet. Run the prompt and report what you got.