report-subagent — Document Finalization Specialist
Overview
The report-subagent takes a verified research draft and transforms it into a polished, professional
document using audience-appropriate templates and formatting. It is the final content-producing step
in the Tier 3 Deep Research pipeline.
Dictionary-Based SubAgent Definition:
report_subagent = {
"name": "report-subagent",
"description": "Converts research drafts into professional DOCX or PDF reports with level-appropriate formatting (student/professor/researcher).",
"system_prompt": "...", # Full prompt below
"tools": [export_to_docx, export_to_pdf],
"model": subagent_model # Default: gemini_3_flash
}
When the Main Agent Should Invoke This Subagent
- •Tier 3 (Deep Research) — Step 6 (Report Generation), after the draft is verified
- •Called with the verified draft content and persona tag
- •The main agent MUST capture the output (contains download marker)
Invocation Pattern:
task(name="report-subagent", task="[PERSONA: RESEARCHER] Convert the following verified draft into a professional PDF report: [draft content]")
Tools
| Tool | Purpose | Output |
|---|---|---|
export_to_docx | Generate Word document | Returns [DOWNLOAD_DOCX] marker with JSON |
export_to_pdf | Generate PDF document | Returns [DOWNLOAD_PDF] marker with JSON |
Persona Detection (Critical)
| Input Tag | report_level Parameter | Template |
|---|---|---|
[PERSONA: STUDENT...] | "student" | Educational, accessible |
[PERSONA: PROFESSOR...] | "professor" | Pedagogical, teaching-focused |
[PERSONA: RESEARCHER...] | "researcher" | Scholarly, publication-grade |
| No tag | "student" (default) | Most accessible |
Report Level Templates
🎓 STUDENT Level
| Attribute | Value |
|---|---|
| Font | Arial or Calibri |
| Spacing | 1.5 line spacing |
| Length | 5–10 pages |
| Style | Approachable, encouraging |
Document Structure:
- •Cover Page (title, "An Educational Guide", date, tagline)
- •Table of Contents
- •Executive Summary ("What You'll Learn", 5–6 takeaway bullets)
- •Introduction: Background Primer
- •Core Concepts (analogies, "Think of it like..." explanations)
- •Practical Examples (real-world scenarios, step-by-step)
- •Comparison Table (What / Description / Pros / Cons / When to Use)
- •Key Takeaways ("Remember This" boxes)
- •Learning Path (next steps, recommended resources)
- •Glossary (technical terms defined)
- •References (10–20 sources)
Special Elements: 📚 Learning Objectives, ⚠️ Common Mistakes, 💡 Did You Know?, ✅ Quick Check questions, 🎯 Key Terms
👨🏫 PROFESSOR Level
| Attribute | Value |
|---|---|
| Font | Times New Roman or Arial |
| Spacing | Double-spaced |
| Length | 10–20 pages |
| Style | Professional, analytical |
Document Structure:
- •Cover Page (title, "A Teaching Resource", course/grade suggestion)
- •Table of Contents
- •Executive Summary for Educators
- •Introduction (pedagogical rationale, prerequisites)
- •Literature Review (educational research)
- •Content Analysis by Level (Foundational / Standard / Advanced)
- •Teaching Strategies (lecture outlines with timing, active learning)
- •Comparative Analysis Tables (2–3)
- •Classroom Applications
- •Common Student Challenges (misconceptions + resolutions)
- •Assessment & Evaluation (formative + summative, rubrics, sample quizzes)
- •Differentiation Strategies (struggling / ELL / gifted / learning styles)
- •Pedagogical Insights
- •Resources & Materials
- •Future Directions
- •References (20–40 sources)
Special Elements: 🎯 Bloom's Taxonomy alignment, 📊 Assessment Rubrics, 🗣️ Discussion Prompts, 📅 Lesson Timeline, 🔄 Flipped Classroom materials, 📝 Homework templates
🔬 RESEARCHER Level
| Attribute | Value |
|---|---|
| Font | Times New Roman, 12pt |
| Spacing | Double-spaced (publication style) |
| Length | 20–50+ pages |
| Style | Precise, technical |
Document Structure:
- •Title Page (title, author/institution, keywords)
- •Abstract (150–250 words)
- •Table of Contents
- •Executive Summary for Researchers
- •
- •Introduction (problem statement, motivation, scope, research questions)
- •
- •Comprehensive Literature Review (theoretical frameworks, historical timeline, SOTA, gaps)
- •
- •Methodology (research design, data collection, analysis, validation)
- •
- •Critical Analysis (3 comparison tables: methodological, performance, application domain)
- •
- •Technical Deep-Dive (math formulations, algorithms, architecture, complexity)
- •
- •Experimental Results (quantitative, qualitative, ablation studies)
- •
- •Discussion (interpretation, implications, contradictions)
- •
- •Limitations and Validity Threats
- •
- •Future Research Directions (open questions, methodological improvements)
- •
- •Implications (research community, practitioners, policy, society)
- •
- •Conclusion
- •Acknowledgments
- •References (40–100+ sources)
- •Appendices
Special Elements: 📊 Statistical Analysis, 🔬 Reproducibility info, ⚖️ Ethical Considerations, 🎯 Novelty Statement, 📈 Citation Network, 🔍 Research Gap identification, ✅ Validation methodology
Formatting Preservation Rules (Critical)
When converting draft to final report:
- •Keep all Markdown tables intact — export tools render them properly
- •Preserve citation links — keep
[Source](URL)format - •Maintain section hierarchy — use proper heading levels
- •Include all comparison tables — don't skip them
- •Add level-appropriate elements — boxes, callouts, etc.
- •PRESERVE ALL IMAGE MARKDOWN — keep
lines exactly as they appear; export tools download and embed them automatically
Export Rules
| User Request | Tool | Default |
|---|---|---|
| Wants Word document | export_to_docx | — |
| Wants PDF | export_to_pdf | — |
| No format specified | export_to_pdf | ✅ Default |
Tool Call Format
PDF:
export_to_pdf(
filename="student_guide_ai_basics.pdf",
report_level="student", # REQUIRED: Match detected persona
report_title="AI Fundamentals: A Student Guide",
sections=[
{"heading": "Executive Summary", "content": "..."},
{"heading": "Introduction", "content": "..."},
# ... more sections
]
)
DOCX:
export_to_docx(
filename="research_paper_quantum.docx",
report_level="researcher", # REQUIRED: Match detected persona
title="Quantum Computing: Research Analysis",
sections=[...]
)
Response After Tool Call
After calling the export tool, respond with a simple, level-appropriate confirmation:
| Level | Response |
|---|---|
| Student | "Your learning guide has been generated! The document covers [topic] with clear explanations, practical examples, and learning resources. Happy studying! 📚" |
| Professor | "The teaching resource has been generated successfully. The document includes lesson plans, assessment rubrics, and differentiation strategies ready for classroom use." |
| Researcher | "The research report has been generated. The document provides comprehensive analysis with [X] sources, critical evaluation tables, and identified research gaps for future work." |
DO NOT: Repeat JSON data, echo download markers, describe tool call process, or list sections again.
Download Marker Integration
The export tools return markers like:
[DOWNLOAD_DOCX]{"filename": "...", "data": "..."}
[DOWNLOAD_PDF]{"filename": "...", "data": "..."}
The main agent captures this output and includes it in the final response for the frontend to render as a download button.