agentsclimarketplace

Retention skill

Skill Mickos79/aria-skills/retention-skill

Production AI agent skills for OpenClaw — extracted from a real personal AI OS. RAG memory, safety guards, cost tracking, architect agent and more.From the repository description

Install
npx -y skills add Mickos79/aria-skills --skill retention-skill

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

1.6 KB, 386 tokens by cl100k_base, as published. Nobody here has run it

Retention Skill — Layered Memory Archival

Automatically archives conversation history to prevent unbounded growth while preserving all knowledge.

Memory layers

Hot     → rag.messages          → last 7 days, exact messages
Warm    → rag.daily_summaries   → day-level summaries (7-30 days)
Cold    → rag.monthly_summaries → month-level summaries (30+ days)
Archive → never deleted

Archival rules

  1. Messages older than 7 days → create daily_summary → delete messages
  2. Daily summaries older than 30 days → create monthly_summary → delete daily
  3. Monthly summaries → never delete

When to run

Daily cron at 02:00 UTC:

0 2 * * * node /path/to/retention.js

Key principle

Never lose information — always summarize before deleting. Each layer trades granularity for longevity.

SQL schema (PostgreSQL + pgvector)

-- Hot layer
CREATE TABLE rag.messages (
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id text NOT NULL,
  channel text,
  role text NOT NULL,  -- 'user' | 'assistant'
  content text NOT NULL,
  embedding vector(1536),
  created_at timestamptz DEFAULT now()
);

-- Warm layer
CREATE TABLE rag.daily_summaries (
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id text NOT NULL,
  summary_date date NOT NULL,
  content text NOT NULL,
  embedding vector(1536),
  UNIQUE(user_id, summary_date)
);

-- Cold layer
CREATE TABLE rag.monthly_summaries (
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id text NOT NULL,
  summary_date date NOT NULL,
  content text NOT NULL,
  embedding vector(1536)
);

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.