Pattern · Agents
Short- and long-term memory
Keep the current conversation compact, and save durable facts about the user across sessions with source and date.
Say it in the interview
I would summarise old turns to keep the thread small, and have a background job save durable facts per user with source and date, always filtered by user id, visible and deletable by the user.
When to use it
- Assistants people return to
- Long conversations that overflow the context
How it works
- Current thread → Summary of old turns + last turns in full
- Summary of old turns + last turns in full → Model call
- Finished task → background job extracts facts → Long-term store (per user, with source and date)
- Long-term store (per user, with source and date) → read relevant facts → Model call
Trade-offs
- Personal and consistent
- Privacy duties: users must see and delete what is stored
Pitfalls interviewers probe
- Saving everything
- Facts with no date, so stale ones never expire
- Reading memory across users