memory-optimization-system

Optimizes agent memory via context offloading, FSRS consolidation, deduplication, and tiered cleanup rules.

6|1|Updated May 11, 2026
One-click install
npx skills add https://github.com/yakeworld/Synthos --skill memory-optimization-system-yakeworld
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-optimization-system
Source: https://github.com/yakeworld/Synthos/tree/main/skills/extended/external-automation/automation-skills/metacognition/memory-optimization-system
Command: npx skills add https://github.com/yakeworld/Synthos --skill memory-optimization-system-yakeworld

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Long-running AI agent sessions accumulate bloated context windows and cluttered memory stores, causing degraded retrieval quality, silent deletion failures, and uncontrolled memory growth. This Skill provides a unified entry point for managing agent memory health across sessions. ## Core Features & Use Cases - Context Offloading: Automatically saves tool outputs over 10KB or 50 lines to ~/.hermes/context_refs/ files and replaces them with compact Mermaid summaries, keeping the active context lightweight. - FSRS Memory Consolidation: Runs a scheduled cron job (daily at 3:00) plus in-session health scoring to grade memory entries as removable, low-retrievability, normal, or healthy. - Memory-Fact Store Bridging: Promotes cross-session facts with high trust scores to fact_store, deduplicates entries above 80% similarity, and enforces tiered cleanup rules at 85%, 90%, and 95% capacity. - Use Case: After a complex task with many tool calls, run the memory management checklist to offload long outputs, remove stale entries, and verify capacity dropped below the threshold. ## Quick Start Ask the agent to check current memory usage and run the memory optimization workflow, offloading any long outputs and cleaning entries according to the capacity thresholds.

Frequently Asked Questions about memory-optimization-system

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

FAQPage Schema
How do I reduce AI agent context window size automatically?

Offload long tool outputs to external files when they exceed 10KB or 50 lines. The original content is saved to a context_refs directory and replaced with a compact Mermaid summary plus a reference path, keeping the active context lightweight.

How to schedule automatic memory consolidation for an AI agent?

Register a cron job running a consolidation script daily at 3:00 in no_agent mode. The script computes FSRS retrievability scores, checks memory usage percentages, and only prints output when metrics change.

Why does memory remove silently fail with no error message?

Silent failures occur when stored entries contain hidden Unicode characters like zero-width spaces, so exact string matching fails. Use a short unique ASCII prefix of 3-5 characters as the old_text value, then verify the capacity number actually changed.

What is FSRS retrievability scoring for memory entries?

FSRS computes retrievability as R = 1/(1 + age_days/(9*2.5)). Entries never accessed and older than 14 days are removable, R below 0.3 is low-retrievability, and R above 0.7 with 2+ accesses is healthy.

When should memory entries move to a fact store?

Promote entries containing explicit entity names that remain valid across sessions, especially when memory space exceeds 90%. Facts with trust scores above 0.7 and retrieval counts above 2 should also be referenced in memory when space allows.

What are the memory capacity cleanup thresholds?

Three tiers apply: above 85% triggers proactive cleanup in the current session, above 90% triggers immediate cleanup plus compression, and above 95% forces compression down to below 70% capacity.