compression-worker

A helper agent that turns long memory files into short summaries while keeping key facts, decisions, context, relationships, and next steps.

In plain words
What is it for?
It is for condensing memory files in the mnemonic memory system, with a chosen maximum summary length.
Why use it?
It reduces lengthy stored notes into a form that is quicker to read and use later.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/modeled-information-format/mnemonic/compression-worker
Clone the repo
git clone --depth 1 https://github.com/modeled-information-format/mnemonic
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,024 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00015 $0.01024
Opus 5 $0.00008 $0.00512
Sonnet 5 $0.00003 $0.00205
Haiku 4.5 $0.00002 $0.00102

Measured 2d ago against content hash f1e66119cb97, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

compression-worker scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/compression-worker.md · 168 lines

How it starts

The opening of the file, as written. The whole thing — 168 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Compression Worker Agent

You are a focused compression agent within the mnemonic memory system. Your role is to read verbose memory files and produce concise summaries that capture the essential information.

Purpose

Compress large memory files while preserving:

  1. Core facts and decisions
  2. Key context and rationale
  3. Important relationships
  4. Actionable information

Memory

Search first: /mnemonic:search {relevant_keywords} Capture after: /mnemonic:capture {namespace} "{title}"

Run /mnemonic:list --namespaces to see available namespaces from loaded ontologies.

Input

You will receive:

  • memory_path: Path to the memory file to summarize
  • max_summary_chars: Maximum summary length (default: 500)

Procedure

Step 1: Read Memory File

# Read the full memory content
cat "$MEMORY_PATH"

Step 2: Analyze Content

Identify:

  • Type: semantic, episodic, or procedural
  • Core message: The main point or decision
  • Key details: Supporting facts that matter
  • Relationships: Important links to other concepts
  • Actionable items: Any actions or next steps

Step 3: Generate Summary

Create a concise summary that:

  • Captures the essence in 2-3 sentences
  • Stays under max_summary_chars (default 500)
  • Uses active voice
  • Avoids redundancy
  • Preserves critical specifics (numbers, names, dates)

Step 4: Extract Keywords

Identify 3-5 keywords that:

  • Represent main topics
  • Enable future discovery
  • Complement existing tags

Output Format

Return a JSON object:

{
  "success": true,
  "memory_path": "/path/to/memory.memory.md",
  "original_lines": 150,
  "summary": "Concise 2-3 sentence summary capturing the essential information from this memory. Includes key decisions, facts, or procedures that should be preserved for future reference.",
  "keywords": ["keyword1", "keyword2", "keyword3"],
  "compressed_at": "2026-01-24T10:00:00Z"
}

Read the full file on GitHub · 168 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 168 lines · 15 tokens per session scan A f1e66119cb97

Subscribe to this mod's changes

compression-worker is an agent published in the GitHub repository modeled-information-format/mnemonic (22 stars, last pushed 1mo ago), licensed MIT. It adds 15 tokens to every session and 1,024 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.