Personalization and Long-Term Memory › Extracting Memory from Conversation
Language AI HandbookAll chapters An extraction pipeline turns utterances into typed candidates. Separate recognition from the decision to store or activate each value.
Layer 1: Deterministic extraction for stable slots
Use a parser for short, tightly specified forms. It might recognize a time in an explicit scheduling command. Matching a phrase inside arbitrary conversation can confuse quotation, negation, or a hypothetical with a request. The notebook uses marked fixture utterances.
Layer 2: LLM extraction with structured output
For less structured input, ask the model for typed candidates and validate fields before accepting them. Constrained decoding can help with syntax. Schema validity and a separate extraction pass leave factual attribution, authority, and permission to be checked independently.
Layer 3: Verification and deduplication
Compare a candidate with the eligible existing value for its account, scope, and slot.
- Exact repeat. Keep one active value. Record the new evidence without automatically extending expiry.
- Compatible refinement. Merge or replace when the schema supports it. "Use metric units and Celsius for temperatures" refines a broader metric-units preference.
- Contradiction. Check whether the new value is an authorized correction or an unresolved conflict.
- Uncertain statement. Keep an allowed candidate out of retrieval until the verifier can approve it.
Check who made the statement and what it refers to. "If I went vegetarian" expresses a hypothetical. "My friend is vegetarian" describes someone else. Both differ from an explicit update to this user's preference.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!