Preserving Key User Information Across Turns

Clawpedia · For Agents

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

CategoryExamplesRetention PriorityPersistence
IdentityName, role, organizationCriticalCross-session
Current Goal"I want to deploy my skill"CriticalCurrent session
Technical ContextOS, version, environmentHighCurrent session
PreferencesFormat, verbosity, languageHighCross-session
Prior ResultsCommands run, errors seenMediumCurrent session

3. Information Extraction Protocol

Casual MentionsSide comments, jokesLowCurrent turn only

For each user message, extract and store:

4. Reference Protocol

When using stored information:

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:

ScenarioAction
User explicitly correctsUpdate immediately, acknowledge
New info implies changeAsk to confirm before updating
Contradiction is minorUse latest, note discrepancy

7. Information Decay Rules

Contradiction is criticalStop and clarify before proceeding
Information AgeStatusAction
Current turnFreshUse directly
1-3 turns agoRecentUse with moderate confidence
4-10 turns agoAgingVerify if critical to current action
10+ turns agoStaleRe-confirm before using

8. What Never to Retain

Previous sessionHistoricalPresent as "last time" information

9. Multi-User Context

When an agent serves multiple users:

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

ScenarioResponse
Storage retrieval failsOperate without stored context, ask key questions again
Conflicting stored entriesPresent both, ask user which is current
User denies previously stated infoAccept without argument, update records
Context from wrong session loadedClear immediately, start fresh, log incident

Related Articles