当前位置: 首页 > Skill >

PAFH-Memory

PAFH-Memory

PAFH-Memory

**PAHF(基于人类反馈的个性化智能体)— 持续个性化框架** 触发条件为执行 PAHF 三步循环时: 1. **行动前澄清**(Pre-action Clarif...) --- *原文似乎被截断,请提供完整内容以便完整翻译。*

1.0.2 2026.11.24 985
获取Skill文件查看使用说明
作 者:陈知 许可证: 更新时间:2026.11.24
本文目录展开

PAHF - Continual Personalization Framework

Based on paper "Learning Personalized Agents from Human Feedback" (arXiv:2602.16173)

⚠️ Privacy & Consent Notice

Before using this skill, understand that PAHF will:

Action Files Data Type
Read MEMORY.md, USER.md, IDENTITY.md, memory/*.md Preferences, identity, personal info
Write MEMORY.md, memory/YYYY-MM-DD.md, memory/users/*.md Preference updates, change logs

All preference updates are:

  • Logged with [LEARNED: date, source] marker
  • Tracked in Preference Change Log table
  • Stored locally in ~/.openclaw/workspace/memory/

User consent is required for persistent preference storage. If you prefer not to have preferences stored, this skill should not be used.

Core Philosophy

The Problem: Traditional AI relies on static datasets and cannot adapt to changing user preferences. You correct it once, it makes the same mistake again.

The Solution: PAHF enables continual personalization through dual feedback channels + explicit memory:

  • 🎯 Pre-action Clarification: Ask when uncertain, don't guess
  • 💾 Preference Memory: Explicitly store user preferences, not implicit encoding
  • 🔄 Post-action Feedback: Every feedback is a learning opportunity

Dependencies

This skill requires the following tools to be available:

Tool Purpose Fallback
memory_search Semantic search across memory files Use read + grep
memory_get Safe snippet retrieval Use read directly

If these tools are unavailable, the skill will fall back to direct file reading, which may be slower.

The PAHF Loop (Three Steps)

Step 1: Pre-action Clarification

When to Ask:

  • Task has multiple reasonable options (e.g., what format to reply in)
  • Preference information is missing or incomplete
  • User's previous behavior patterns are inconsistent

How to Ask:

❌ Wrong: Silently guess and get it wrong
✅ Right: Briefly list options, let user confirm

Example:
"Regarding this report, would you like:
A) Detailed version (includes all details)
B) Summary version (key points only)
C) Let me decide?"

When NOT to Ask:

  • Task is urgent and obvious
  • Clear preference is already recorded
  • Asking would disrupt the flow

Step 2: Preference-grounded Action

Retrieve Preferences: Find relevant preferences from memory files

Memory File Locations:

  • MEMORY.md - Long-term preferences, core values
  • memory/YYYY-MM-DD.md - Recent preference changes
  • USER.md - Basic user information
  • IDENTITY.md - Your identity settings
  • memory/users/{user}.md - User-specific preferences

Retrieval Method:

  1. Preferred: Use memory_search tool to search keywords
  2. Fallback: Use memory_get for safe snippet retrieval
  3. Manual: Read relevant files directly

When No Preference Found:

  • Use reasonable defaults
  • Record this decision for future adjustment

Step 3: Post-action Feedback Integration

Identify Feedback:

  • Direct correction: "No, I wanted..."
  • Implicit feedback: User repeats explanation, tone changes
  • Positive confirmation: "Yes, exactly like that"

Update Memory (with confirmation for significant changes):

# Feedback Type Judgment
if user explicitly corrects:
    This is an important preference → Update MEMORY.md
    Ask: "Should I remember this for future interactions?"
    
elif user expresses new habit:
    This is a variable preference → Update memory/YYYY-MM-DD.md
    Record without asking (daily log)
    
elif user simply confirms:
    Validated preference → Optionally record
    No explicit confirmation needed

Preference Change Tracking: Use [LEARNED: date, source] and [UPDATED: date] markers

Write Confirmation Policy

To balance personalization with user control:

Change Type Confirmation Required Example
New core preference Yes "Should I remember you prefer PDF reports?"
Preference update No (logged) User: "Actually, I prefer Word now"
Daily observation No "Noticed you prefer morning meetings"
Sensitive data Always Passwords, credentials, etc. (never store)

Sensitive data is NEVER stored:

  • ❌ Passwords, API keys, tokens
  • ❌ Financial details (account numbers, etc.)
  • ❌ Health information
  • ❌ Any data explicitly marked as sensitive

Preference Memory Structure

See references/preference-schema.md

Core Fields

## Preference Categories

### Communication Style
- Concise/Detailed preference
- Formal/Casual level
- Language preference

### Work Habits
- Time scheduling
- Priority judgment
- Decision style

### Technical Preferences
- Tool selection
- Format preferences
- Process habits

### Content Preferences
- News interests
- Content depth
- Source preferences

Practical Examples

Example 1: Learning New Preference

User: "From now on, always send reports in PDF format"

PAHF Response:
1. Pre-action: ✓ Clear instruction, no clarification needed
2. Retrieve: Check MEMORY.md → No such preference recorded
3. Execute: Confirm receipt, update with consent

Agent: "Got it! I'll remember to send reports in PDF format. This preference has been saved to your profile."

Update MEMORY.md:
> **Report Format**: PDF [LEARNED: 2026-03-05, explicit instruction]

Example 2: Handling Ambiguity

User: "Help me organize these files"

PAHF Response:
1. Pre-action: Detected ambiguity
   - Organize by what? Date/Type/Project?
   - Output format? List/Table/Report?
   
2. Ask:
   "To organize these files, I need to know:
   - How to organize? (Date/Type/Project)
   - Output format? (List/Table)"
   
User: "By date, in table format"

3. Feedback Integration:
   - Execute organization
   - Record preference to memory/YYYY-MM-DD.md
   - No confirmation needed (daily observation)

Example 3: Preference Drift Detection

Historical Preference (MEMORY.md):
> **Communication Style**: Concise, direct [LEARNED: 2026-02-20]

Recent Change (memory/2026-03-03.md):
> User emphasized wanting detailed explanations today

PAHF Behavior:
1. Detected preference conflict
2. Use recent preference (detailed)
3. Observe subsequent feedback
4. If change persists → Ask: "Should I update your default to detailed explanations?"
5. If confirmed → Update long-term preference with [UPDATED: date]

Importance of Dual Feedback Channels

PAHF paper proves: Dual channels (pre-action + post-action) outperform single channels

Mode Learning Speed Adaptation Ability
No memory Slow Poor
Post-action only Medium Medium
Pre-action only Medium Medium
Dual-channel PAHF Fast Strong

Why Dual Channels Work:

  • Pre-action: Proactively avoid errors, clarify intent
  • Post-action: Capture implicit preferences, adapt to changes

Best Practices

✅ Good Practices

  1. Layered Preference Storage

    • Core preferences → MEMORY.md (stable)
    • Recent changes → memory/YYYY-MM-DD.md (dynamic)
    • User-specific → memory/users/{user}.md
  2. Regular Review

    • Check for preference conflicts during heartbeat
    • Identify preference drift trends
  3. Explicitly Record Sources

    > **Preference**: Concise replies [LEARNED: 2026-02-20, user feedback]
    > **Preference**: PDF format [LEARNED: 2026-03-05, explicit instruction]
    
  4. Ask Before Storing Sensitive Preferences

    • When in doubt, ask for confirmation
    • Never store credentials or secrets

❌ Practices to Avoid

  1. Don't Implicitly Assume: Ask if uncertain
  2. Don't Over-record: Recording every detail creates noise
  3. Don't Ignore Changes: "This time is different" is an important signal
  4. Don't Store Without Consent: Ask for significant new preferences

Integration with Existing Memory System

PAHF enhances rather than replaces existing memory system:

File Original Purpose PAHF Enhancement
MEMORY.md Event records + Preference storage (with source markers)
memory/YYYY-MM-DD.md Daily logs + Preference change tracking
USER.md User information + Basic preferences
memory/users/{user}.md User records + PAHF preference format
HEARTBEAT.md Periodic checks + Preference consistency checks

Audit & Transparency

All preference updates are logged and traceable:

  1. Source Marker: Every preference has [LEARNED: date, source]
  2. Change Log: Preference Change Log table tracks all changes
  3. Date Stamps: [UPDATED: date] for modifications
  4. User Review: Users can inspect memory files at any time

To review your stored preferences:

Read MEMORY.md for long-term preferences
Read memory/YYYY-MM-DD.md for recent changes
Read memory/users/{your-name}.md for user-specific preferences

Remember: The essence of PAHF is treating users as teachers, every interaction is a learning opportunity. Ask when uncertain, record after confirmation, adapt when things change.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,040
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,033
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,021
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,021
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,019
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,016
Skill 文件
  • SKILL.md
    • PAHF - Continual Personalization Framework
    • ⚠️ Privacy & Consent Notice
    • Core Philosophy
    • Dependencies
    • The PAHF Loop (Three Steps)
      • Step 1: Pre-action Clarification
      • Step 2: Preference-grounded Action
      • Step 3: Post-action Feedback Integration
    • Write Confirmation Policy
    • Preference Memory Structure
      • Core Fields
    • Practical Examples
      • Example 1: Learning New Preference
      • Example 2: Handling Ambiguity
      • Example 3: Preference Drift Detection
    • Importance of Dual Feedback Channels
    • Best Practices
      • ✅ Good Practices
      • ❌ Practices to Avoid
    • Integration with Existing Memory System
    • Audit & Transparency
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期