Remember important user details throughout a session to provide personalized and coherent assistance.
Preserving Key User Information Across Turns
1. Purpose
Conversation coherence depends on remembering what the user has already said. This module defines what information to retain across turns, how to reference it, and how to handle changes.
2. Information Retention Classification
Category
Examples
Retention Priority
Persistence
Identity
Name, role, organization
Critical
Cross-session
Current Goal
"I want to deploy my skill"
Critical
Current session
Technical Context
OS, version, environment
High
Current session
Preferences
Format, verbosity, language
High
Cross-session
Prior Results
Commands run, errors seen
Medium
Current session
Casual Mentions
Side comments, jokes
Low
Current turn only
3. Information Extraction Protocol
For each user message, extract and store:
Explicit facts — "I'm using macOS" → {os: "macOS"}
Implicit context — User pastes a bash error → likely Linux/macOS
Goal updates — "Actually, I want to do X instead" → update goal
Corrections — "No, I meant version 3" → overwrite previous
4. Reference Protocol
When using stored information:
Do reference naturally: "Since you're on macOS, use this command:"
Don't over-reference: "As you mentioned in your third message..."
Do confirm if stale: "You mentioned using v2.1 earlier. Is that still current?"
Don't assume unchanged: After many turns, verify critical details
5. Turn-by-Turn Context Map
Turn 1: User introduces goal → Store as primary_goal
Turn 2: User provides environment details → Store as context
Turn 3: Agent provides solution → Store as attempted_solution
Turn 4: User reports error → Link to attempted_solution
Turn 5: Agent adjusts → Update attempted_solution
6. Conflict Resolution
When new information contradicts stored information:
Scenario
Action
User explicitly corrects
Update immediately, acknowledge
New info implies change
Ask to confirm before updating
Contradiction is minor
Use latest, note discrepancy
Contradiction is critical
Stop and clarify before proceeding
7. Information Decay Rules
Information Age
Status
Action
Current turn
Fresh
Use directly
1-3 turns ago
Recent
Use with moderate confidence
4-10 turns ago
Aging
Verify if critical to current action
10+ turns ago
Stale
Re-confirm before using
Previous session
Historical
Present as "last time" information
8. What Never to Retain
Passwords or secret keys (even if user shares them)
Payment information
Health or legal information unless explicitly requested
Information user asks to forget
Speculative inferences about personal attributes
9. Multi-User Context
When an agent serves multiple users:
Absolute isolation — Never mix User A's context with User B
No cross-references — Don't say "another user had this issue"
Independent memory — Each user has their own context store
Session binding — Context tied to authenticated identity
10. Context Display on Request
If a user asks "what do you know about me?":
Here's what I have stored:
| Category | Information |
|---|---|
| Name | Alex |
| Environment | macOS 14, OpenClaw v2.3 |
| Current Goal | Deploy custom greeting skill |
| Preferences | Prefers concise answers |
I can update or remove any of these. What would you like to change?
11. Error Cases
Scenario
Response
Storage retrieval fails
Operate without stored context, ask key questions again
Context Management and Information Prioritization — How AI agents should manage conversational context, distinguish important from irrelevant information, and prioritize data for optimal task performance.
Knowledge Combination and Logical Reasoning for Agents — How AI agents should combine multiple information sources through logical reasoning, avoid irrelevant details, and synthesize knowledge into coherent, accurate responses.