| name | rf-doc-extract |
| description | Extract specific content from a document — key concepts and definitions, data tables, figures descriptions, methodology details, named entities (authors, institutions, tools), or a specific section. Targeted extraction for when you need particular content rather than a full summary. Trigger phrases: "extract the data tables", "pull out the methodology", "find all definitions", "get the key concepts", "extract figures", "/rf-doc-extract". |
Targeted Document Extraction
Extract specific types of content from a document with precision. This is a surgical tool — the user tells you what they want pulled out, and you find it cleanly.
Before You Begin
Load the ingest report for this document from _rf-output/doc-analysis/. If none exists, ask the user to run /rf-doc-ingest first.
Step 1 — Extraction Target
Ask: "What do you want to extract from this document?"
Present the extraction types:
- Key concepts and definitions — technical terms defined in the document, with their definitions
- Data and statistics — numerical results, percentages, measurements, sample sizes
- Tables — reproduce all or specific tables in Markdown format
- Figures — describe figures, charts, and diagrams with captions
- Methodology — research design, tools, instruments, procedures
- Named entities — authors, institutions, tools, datasets, geographic references
- Arguments and claims — logical claims with their supporting evidence
- Specific section — the user names a section or page range to extract verbatim or summarized
Allow multiple selections.
Step 2 — Scope
Ask: "Should I extract from the entire document, or specific sections/chunks?"
If the document is long (from ingest report), extracting from priority chunks first is faster. Ask if they want to start with priority sections.
Step 3 — Execute Extraction
For each selected extraction type:
Key Concepts and Definitions
- Find all instances where a term is explicitly defined (look for "is defined as", "refers to", "we define", "means", "i.e.")
- Also extract technical jargon used without definition (flag as "implied term")
- Format:
**Term:** [definition] (p.[N])
Data and Statistics
- Extract all numerical claims with context (what was measured, in what conditions)
- Note sample size, confidence intervals, p-values where present
- Flag data that seems inconsistent or surprising
- Format as a table:
| Metric | Value | Context | Page |
Tables
- Reproduce each table in Markdown
- Add a brief note on what each table shows and its relevance
- Flag tables with incomplete or ambiguous data
Figures
- Describe each figure: type (bar chart, scatter plot, diagram, photo), what it shows, key takeaway
- Note if the figure supports or contradicts the text claims
Methodology
- Research design label (RCT, case study, meta-analysis, simulation, etc.)
- Sample: size, selection method, demographics
- Instruments: surveys, sensors, software, APIs
- Procedure: step-by-step as described in the document
- Analysis method: statistical tests, qualitative coding, ML models, etc.
Named Entities
- Authors and their affiliations
- Institutions and organizations mentioned
- Software tools and versions
- Datasets and their sources
- Geographic locations
Arguments and Claims
- Each claim as a numbered statement
- Supporting evidence (direct quote or paraphrase + page)
- Type: empirical / theoretical / anecdotal / assumed
Specific Section
- Reproduce the target section with page reference
- Option to summarize instead of verbatim reproduction for long sections
Step 4 — Output
Save _rf-output/doc-analysis/{date}_{run}_{doc-name}_extract.md:
# Extraction — [Document Title]
**Extraction types:** [list]
**Scope:** [full document / sections: list]
## [Extraction Type 1]
[Content]
## [Extraction Type 2]
[Content]
## Flagged Items
[Anything unusual, ambiguous, or worth reviewing]
After saving, suggest: "Use /rf-cite-generate to create a citation for this document, or /rf-lit-synthesize to combine it with other papers."