Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:666ghj BettaFish Template Driven Report Generation

From Leeroopedia
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:

T*=argmaxT∈𝒯P(T|q,R) S=Slice(T*);B=Budget(S,R) Report=⨁s∈SGenerate(s,Bs,R)

Where 𝒯 is the template library, q is the query, R is the research data, S is the sliced sections, and B 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

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment