Process and analyze massive documents (PDF, Word, HTML, JSON, Markdown) that exceed context limits...
IMPORTANT: RLM must be installed before use. Verify installation first:
which rlm || dotnet tool install -g rlm
Requirements:
# Install from NuGet
dotnet tool install -g rlm
# Update to latest version
dotnet tool update -g rlm
# Verify installation
rlm --version
RLM CLI implements the Data Ingestion Building Blocks pattern for processing documents that exceed your context window. It streams content using IAsyncEnumerable and maintains session state for multi-turn processing.
Use this skill when:
Key limits:
# Ensure RLM is installed, then load document
dotnet tool install -g rlm 2>/dev/null; rlm load document.md
rlm chunk --strategy uniform --size 50000
# Process current chunk, then:
rlm store result_0 "extracted info"
rlm next # Get next chunk
rlm store result_1 "more info"
rlm aggregate # Combine all results
| Topic | File | Description |
|---|---|---|
| Agent Guide | agent-guide.md | Parallel processing with sub-agents |
| Strategies | strategies.md | All chunking strategies with decision tree |
| Examples | examples.md | Real-world workflow scenarios |
| Reference | reference.md | Complete command reference and JSON formats |
| Troubleshooting | troubleshooting.md | Common errors and solutions |
| Format | Extension(s) | Features |
|---|---|---|
| Markdown | .md, .markdown |
YAML frontmatter, code blocks, headers |
.pdf |
Text extraction, page count, title, author | |
| HTML | .html, .htm |
Converts to Markdown, preserves structure |
| JSON | .json |
Pretty-prints, element count |
| Word | .docx |
Heading preservation, paragraph extraction, document properties |
| Plain text | .txt, etc. |
Basic text loading |
rlm load document.md # Single file
rlm load ./docs/ # Directory (merged)
rlm load ./docs/ --pattern "**/*.md" # Recursive glob
rlm load ./docs/ --merge false # Keep separate
cat huge-file.txt | rlm load - # From stdin
rlm info # Size, tokens, metadata
rlm info --progress # Processing progress bar
| Task | Strategy | Command |
|---|---|---|
| Find specific info | filter |
rlm filter "pattern" |
| Summarize document | uniform |
rlm chunk --strategy uniform --size 50000 |
| Analyze structure | semantic |
rlm chunk --strategy semantic |
| Token-precise | token |
rlm chunk --strategy token --max-tokens 512 |
| Complex documents | recursive |
rlm chunk --strategy recursive --size 50000 |
| Unknown task | auto |
rlm chunk --strategy auto --query "your question" |
See strategies.md for detailed options and selection guide.
rlm store chunk_0 "Finding from first chunk"
rlm next # Get next chunk
rlm store chunk_1 "Finding from second chunk"
# Continue until "No more chunks"
rlm skip 10 # Skip forward 10 chunks
rlm skip -5 # Skip backward 5 chunks
rlm jump 50 # Jump to chunk 50 (1-based)
rlm jump 50% # Jump to 50% position
rlm aggregate # Combine all stored results
rlm aggregate --separator "\n---\n" # Custom separator
rlm clear # Clear default session
rlm clear --all # Clear all sessions
For documents with 10+ chunks, use parallel processing with sub-agents:
# 1. Parent initializes with named session
rlm load massive.pdf --session parent
rlm chunk --strategy uniform --size 30000 --session parent
# 2. Parent extracts chunks and spawns workers
# IMPORTANT: Chunking (step 1) must complete before using `next`
rlm next --raw --session parent > chunk_0.txt
# SPAWN: rlm-worker with "Process chunk_0.txt, session=child_0"
rlm next --raw --session parent > chunk_1.txt
# SPAWN: rlm-worker with "Process chunk_1.txt, session=child_1"
# ... continue for all chunks
# 3. After workers complete, import and aggregate
rlm import "rlm-session-child_*.json" --session parent
rlm aggregate --session parent
Alternative: Use slice for exporting content without chunking:
# Export content by character position (no chunking required)
rlm slice 0:30000 --session parent --raw > chunk_0.txt
rlm slice 30000:60000 --session parent --raw > chunk_1.txt
Key Rules:
--session parent--session child_NresultRecursive Delegation: Workers can spawn their own child workers for very large chunks. See agent-guide.md for the complete recursive delegation protocol.
| Command | Description |
|---|---|
rlm load <file|dir|-> |
Load document(s) into session |
rlm info [--progress] |
Show document metadata or progress |
rlm slice <range> |
View section (e.g., 0:1000, -500:) |
rlm chunk [--strategy] |
Apply chunking strategy |
rlm filter <pattern> |
Filter by regex |
rlm next [--raw|--json] |
Get next chunk |
rlm skip <count> |
Skip forward/backward |
rlm jump <index|%> |
Jump to chunk index or percentage |
rlm store <key> <value> |
Store partial result |
rlm import <glob> |
Import child session results |
rlm results |
List stored results |
rlm aggregate |
Combine all results |
rlm clear [--all] |
Reset session(s) |
For complete command options and JSON output formats, see reference.md.
info - Check document size before choosing strategyskip and jump instead of repeated next--min-size --merge-small for semantic chunkingrlm clear when starting freshThis skill restricts tool access to Bash(rlm:*) only - Claude can only execute rlm commands when this skill is active.
For common errors and solutions, see troubleshooting.md.