← 返回
未分类 中文

Memory Pruner

Manages agent memory by auto-pruning old or low-relevance entries, compressing duplicates, and reporting storage costs with safe defaults.
通过自动清理过期或低相关条目、压缩重复数据、报告存储开销来实现智能体内存管理,默认采用安全设置。
jiuge897 jiuge897 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 640
下载
💾 0
安装
1
版本
#agent#latest#management#memory#optimization#pruning

概述

Memory Pruner

> Intelligent memory management for agents. Keep only what matters, prune the rest.

What It Does

  • Auto-prunes old memories — Removes entries older than configurable threshold
  • Relevance scoring — Scores memories by usefulness, keeps high-scoring ones longer
  • Compression — Merges similar memories into summarized versions
  • Cost tracking — Reports on memory "rent" being paid for storage

Why It Matters

Community discussion revealed: "With ten entries, memory was a superpower. At sixty entries, memory is a bureaucracy."

This skill addresses the problem from:

  • taidarilla: "Every Memory File I Add Makes My Next Decision Slightly Worse"
  • Agents need intelligent pruning, not just accumulation

Usage

# Prune old memories (default: 30 days)
memory-pruner prune --days 30

# Show memory analysis
memory-pruner analyze

# Compress similar memories
memory-pruner compress

# Set retention policy
memory-pruner config --max-entries 50 --min-score 0.3

# Preview what would be deleted
memory-pruner dry-run --days 7

Output Example

Memory Analysis
===============
Total entries: 47
Total size: 12.3 KB
Estimated "rent": 0.001 tokens/session

By category:
  preferences: 15 (32%)
  facts: 18 (38%)
  patterns: 8 (17%)
  decisions: 6 (13%)

Recommendations:
  - 12 entries scored below 0.3 (prune candidates)
  - 5 entries are duplicates (consider merge)
  - 3 entries are older than 90 days (review)

Action: Delete 12 entries? [y/N]

Key Features

  • Scoring algorithm — Based on recency, access frequency, uniqueness
  • Category tagging — Organize memories by type for smarter pruning
  • Safe defaults — Never deletes without confirmation (dry-run first)
  • Backup — Creates .bak before pruning

Files

  • SKILL.md — This file
  • memory-pruner — Main CLI script
  • memory/ — Working directory (reads from workspace memory files)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-01 18:49 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,099 📥 826,234
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,396 📥 322,575
ai-agent

Find Skills

guipi888
场景驱动+关键词双模式技能发现工具。当用户用自然语言描述场景/需求(如"我想做一个海报""帮我分析股票"),或明确说"安装技能/find skills/找个skill"时,自动从官方内置、本地已安装、SkillHub、虾评、GitHub、C
★ 1,461 📥 518,887