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.
npx -y skills add Mickos79/aria-skills --skill retention-skillAssembled 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
- Messages older than 7 days → create daily_summary → delete messages
- Daily summaries older than 30 days → create monthly_summary → delete daily
- 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)
);
Gives 0 of the 12 instructions most analytics metrics skills give in 386 tokens
Counted across 368 of the 369 authors here whose files we hold, read 2026-08-06
- read product marketing context before asking questionsin 18 of 368, across 12 files
- use lowercase with underscores for event namesin 16 of 368, across 6 files
- track events for decisions not vanity metricsin 15 of 368, across 5 files
- use object-action format for event namesin 15 of 368, across 8 files
- produce a tracking plan documentin 14 of 368, across 4 files
- Call RUBE_SEARCH_TOOLS first to get current schemasin 13 of 368, across 2 files
- establish consistent event naming conventions before implementingin 10 of 368, across 4 files
- Verify dimension and metric compatibility before reportingin 9 of 368, across 2 files
- Encrypt data at rest and in transitin 9 of 368, across 3 files
- use snake_case for event namesin 9 of 368, across 5 files
- monitor technical health during the testin 9 of 368, across 5 files
- use consistent property namesin 8 of 368, across 4 files
Said here and by no other author read
- summarize messages older than seven days
- delete messages after creating daily summaries
- summarize daily summaries older than thirty days
- never delete monthly summaries
- always summarize before deleting
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.