Principle:666ghj BettaFish Template Driven Report Generation
| Knowledge Sources | |
|---|---|
| Domains | Report_Generation, NLP, LLM_Prompting |
| Last Updated | 2026-10-08 00:00 GMT |
Overview
Technique that uses predefined report templates as structural skeletons, with an LLM selecting and adapting the best template for a given topic, then generating content to fill each section according to a planned word budget.
Description
Template-Driven Report Generation decouples report structure from report content. Instead of asking the LLM to generate both the outline and the content in one pass (which often produces inconsistent structures), the system: 1. Maintains a library of templates for different report types (brand reputation, crisis PR, market analysis, etc.) 2. Uses an LLM to select the most appropriate template based on the query and available data 3. Slices the template into structural sections 4. Plans a word budget for each section 5. Generates content section-by-section, constrained by the template structure and word budget
This approach ensures structural consistency while allowing content flexibility.
Usage
Use this principle when generating professional reports that must follow consistent structures across different topics. It is especially valuable when different report types have different compliance or formatting requirements.
Theoretical Basis
The generation follows a select-then-fill pipeline:
Where is the template library, is the query, is the research data, is the sliced sections, and is the word budget.
Pseudo-code Logic:
# Abstract pattern (NOT real implementation)
template = llm_select_template(query, reports, templates)
sections = parse_template(template)
layout = llm_design_layout(sections, reports, query)
budget = llm_plan_budget(sections, layout, reports)
chapters = [generate_chapter(s, budget[s], reports) for s in sections]
ir = stitch(chapters)
report = render(ir)
Related Pages
Implemented By
- Implementation:666ghj_BettaFish_ReportAgent_generate_report
- Implementation:666ghj_BettaFish_TemplateSelectionNode_run
- Implementation:666ghj_BettaFish_parse_template_sections
- Implementation:666ghj_BettaFish_DocumentLayoutNode_run
- Implementation:666ghj_BettaFish_WordBudgetNode_run
- Implementation:666ghj_BettaFish_ChapterGenerationNode_run
- Implementation:666ghj_BettaFish_DocumentComposer_build_document
- Implementation:666ghj_BettaFish_HTMLRenderer_render