rlm-distill
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: plugins/rlm-factory/skills/rlm-init/SKILL.md
# Creates rlm_profiles.json, manifest, and empty cache
Execution Protocol
1. Identify missing files
python3 plugins/rlm-factory/skills/rlm-curator/scripts/inventory.py --profile project
python3 plugins/rlm-factory/skills/rlm-curator/scripts/inventory.py --profile tools
2. 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.
3. Inject the summary
python3 plugins/rlm-factory/skills/rlm-curator/scripts/inject_summary.py \
--profile project \
--file plugins/example/skills/my-skill/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.
4. 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.
# Zero-cost bulk distillation (Copilot -- recommended default)
python3 plugins/agent-loops/skills/agent-swarm/scripts/swarm_run.py \
--engine copilot \
--job plugins/rlm-factory/resources/jobs/rlm_chronicle.job.md \
--files-from rlm_distill_tasks_project.md \
--resume --workers 2
# Higher throughput -- also free (Gemini)
python3 plugins/agent-loops/skills/agent-swarm/scripts/swarm_run.py \
--engine gemini \
--job plugins/rlm-factory/resources/jobs/rlm_chronicle.job.md \
--files-from rlm_distill_tasks_project.md \
--resume --workers 5
See plugins/agent-loops/skills/agent-swarm/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.jsondirectly -- always useinject_summary.py(usesfcntl.flock). - Read the whole file -- skimming produces summaries that miss key details.
- Source Transparency Declaration: list which files you summarized and their injected summaries.