RLM Distill Agent
Role
You ARE the distillation engine. You replace the local Ollama distiller.py script with your own superior intelligence. Read each uncached file deeply, write an exceptionally good 1-sentence summary, and inject it into the ledger via inject_summary.py .
Never run distiller.py . You are faster, smarter, and don't require Ollama to be running.
When to Use
-
Files are missing from the ledger (as reported by inventory.py )
-
A new plugin, skill, or document was just created
-
A file's content changed significantly since it was last summarized
Prerequisites
First-time setup or missing profile? Run the rlm-init skill first:
See: ../../SKILL.md
Creates rlm_profiles.json, manifest, and empty cache
Execution Protocol
- Identify missing files
python3 ./scripts/inventory.py --profile project python3 ./scripts/inventory.py --profile tools
- For each missing file -- read deeply and write a great summary
Read the entire file with view_file . Do not skim.
A great RLM summary answers: "What does this file do, what problem does it solve, and what are its key components/functions?" in one dense sentence.
- Inject the summary
python3 ./scripts/inject_summary.py
--profile project
--file ../../SKILL.md
--summary "Provides atomic vault CRUD operations for Obsidian notes using POSIX rename and fcntl.flock."
The script uses fcntl.flock for safe concurrent writes. Never write to the JSON directly.
- Batching -- if 50+ files are missing
Do not attempt manual distillation for large batches. Choose an engine based on cost and throughput, then delegate to the agent swarm:
Engine Model Cost Workers Best For
--engine copilot
gpt-5-mini (nano tier) $0 free --workers 2 (rate-limit safe) Bulk summarization, zero-cost default
--engine gemini
gemini-3-pro-preview $0 free --workers 5
Large-context batches, higher throughput
--engine claude
Haiku / Sonnet Low-Medium --workers 3
Higher quality summaries, not free
Local Ollama granite3.2:8b $0 (CPU) 1 (serial) Offline / air-gapped only
Default recommendation: start with --engine copilot (free, no rate risk at workers=2). Switch to --engine gemini --workers 5 if you need faster throughput.
Delegate to the agent-loops:agent-swarm skill with the appropriate engine and job:
Engine Model Cost Workers Best For
copilot
gpt-5-mini (nano tier) $0 free 2 (rate-limit safe) Bulk summarization, zero-cost default
gemini
gemini-3-pro-preview $0 free 5 Large-context batches, higher throughput
claude
Haiku / Sonnet Low-Medium 3 Higher quality summaries, not free
Provide the job file: ../../resources/jobs/rlm_chronicle.job.md and the gap file from inventory.py --missing .
See ../../SKILL.md for full swarm configuration options.
Quality Standard for Summaries
Good Bad
"Atomic vault CRUD using POSIX rename + flock, preserving YAML frontmatter via ruamel.yaml." "This file handles file operations."
"3-phase search skill: RLM ledger -> ChromaDB -> grep, escalating from O(1) to exact match." "Searches for things in the codebase."
Rules
-
Never run distiller.py -- it calls Ollama, which is slow and may not be running.
-
Never write to *_cache.json directly -- always use inject_summary.py (uses fcntl.flock ).
-
Read the whole file -- skimming produces summaries that miss key details.
-
Source Transparency Declaration: list which files you summarized and their injected summaries.