Long-term, semantic, episodic, and user-profile memory
Practice this questionOverview
- Long-term memory stores selected information beyond one task.
- Semantic memory contains facts or preferences; episodic memory records past events; user-profile memory contains explicit attributes such as preferred language.
- These categories overlap and should be defined by application requirements rather than mystical model capabilities.
Why this matters
Returning users benefit from relevant continuity, and agents may need prior verified task outcomes.
An everyday example
A customer profile stores contact preferences; a service history stores prior visits.
A technical example
Profile: preferredLanguage="Gujarati"; episode: claimDraftReviewed with date, source, and user ID.
How it works
- Identify candidate memory
- Verify/confirm
- Attach source, scope, and timestamp
- Persist with retention
- Retrieve only relevant authorized entries
- Update/delete on correction.
Architecture and flow
Verified event/preference → scoped memory store → relevance retrieval → bounded context.
The insurance assistant example
Remember the customer's chosen communication language, but never assume last year's policy remains active.
When to use it
Clear repeated personalization or task-continuity needs with user-visible controls.
When to avoid it
Do not store sensitive medical details or inferred personality labels just because they appeared in chat.
Interview answer
“Long-term memory is curated, scoped, source-backed application data. I distinguish preferences and past events from current business facts.”
Benefits, trade-offs, and production considerations
- Memory poisoning means malicious or incorrect content becomes future trusted context.
- Require provenance and write policy, set expiry, allow user correction, and avoid treating retrieval similarity as memory truth.