memory-compaction

Automate LanceDB memory backup, pruning, and merging with Telegram alerts.

4|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/ybbms777/openclaw-claude-code-integration --skill memory-compaction
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: memory-compaction
Source: https://github.com/ybbms777/openclaw-claude-code-integration/tree/main/skills/memory-compaction
Command: npx skills add https://github.com/ybbms777/openclaw-claude-code-integration --skill memory-compaction

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires lancedb, and includes scripts (resource) components.

What problem does it solve?

This skill automates the maintenance of LanceDB memories by regularly backing up, pruning obsolete items, and merging related fragments to preserve critical information while controlling storage growth.

Core Features & Use Cases

  • Weekly backups: automatically copy LanceDB data to backups/YYYY-MM-DD, keeping the most recent four backups.
  • Selective pruning: delete memories with low importance and long inactivity to reduce noise and storage.
  • Smart merging: cluster and merge similar fragments using embedding similarity to preserve the most important L0摘要 while reducing redundancy.
  • Alerts & reliability: stop on errors and notify via Telegram to ensure operators are aware of issues.
  • Use Case: schedule routine memory maintenance for long-running deployments that accumulate noisy or redundant memories.

Quick Start

Run the memory_compaction.py script to execute the full backup, pruning, and merge process and deliver a Telegram alert.

Frequently Asked Questions about memory-compaction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate LanceDB memory maintenance and cleanup?▼

You can automate LanceDB memory maintenance by running a weekly cron script that backs up data, prunes low-importance entries, and merges similar fragments to control storage growth.

What is the best way to back up LanceDB memories on a schedule?▼

The best way to back up LanceDB memories is scheduling a weekly cron job that copies data to a dated backups/YYYY-MM-DD directory while retaining only the four most recent backups.

How does similarity-based merging work for LanceDB memory fragments?▼

Similarity-based merging clusters related LanceDB fragments using embedding vectors, preserving the most important L0 summaries to reduce redundancy while retaining critical information.

Can I use Telegram for error alerts during LanceDB database pruning?▼

Yes, the memory compaction process stops on errors and sends Telegram alerts to notify operators, ensuring immediate awareness of any issues during backup, pruning, or merging.

How do I prune obsolete LanceDB records based on inactivity and importance?▼

You can prune obsolete LanceDB records by applying threshold-based deletion, automatically removing memories with low importance scores and long inactivity periods to reduce noise.

Does LanceDB memory compaction require SiliconFlow for embedding generation?▼

Yes, the smart merging process utilizes SiliconFlow to generate embedding similarity scores, which cluster and merge related memory fragments to preserve the most important L0 summaries.