Goal: Generate coherent, structured documents (essays, reports, summaries) by querying the knowledge base and synthesizing results into natural language.
Key insight: The knowledge base provides verified facts and relationships; the generation system organizes them into readable prose.
User Request: "Write about mammals"
│
▼
┌───────────────────┐
│ Query Expansion │ ← Identify relevant concepts
└───────────────────┘
│
▼
┌───────────────────┐
│ KB Retrieval │ ← Gather facts about mammals
└───────────────────┘
│
▼
┌───────────────────┐
│ Outline Generator │ ← Create document structure
└───────────────────┘
│
▼
┌───────────────────┐
│ Section Synthesis │ ← Generate each section
└───────────────────┘
│
▼
┌───────────────────┐
│ Coherence Check │ ← Ensure logical flow
└───────────────────┘
│
▼
Structured Document
Use concept hierarchies to create document outlines:
// KB query query: "isA ?x Mammal" results: [Cat, Dog, Whale, Bat, Human, ...] // Hierarchy extraction Mammal ├── Carnivore │ ├── Cat │ └── Dog ├── Marine Mammal │ └── Whale ├── Flying Mammal │ └── Bat └── Primate └── Human // Generated outline 1. Introduction to Mammals 2. Classification of Mammals 2.1 Carnivores 2.2 Marine Mammals 2.3 Flying Mammals 2.4 Primates 3. Common Characteristics 4. Conclusion
"Cats are mammals belonging to the carnivore family. They are characterized by having fur and whiskers. Cats exhibit hunting behavior as a natural instinct. Unlike many carnivores, cats have been domesticated and live alongside humans as pets."
| Type | Structure | Use Case |
|---|---|---|
| Encyclopedia Entry | Definition → Classification → Characteristics → Examples | Reference material |
| Comparison Essay | Introduction → Entity A → Entity B → Comparison → Conclusion | Analysis documents |
| Explanatory Report | Question → Evidence → Reasoning → Answer | Decision support |
| Summary | Key points only, bullet format | Quick reference |
| Tutorial | Concept → Prerequisites → Steps → Examples | Educational content |
Every generated statement traces back to KB facts:
// Generated text with citations
{
"text": "Cats are mammals [1] belonging to the carnivore family [2].",
"citations": {
"1": { "fact": "isA Cat Mammal", "source": "biology.sys2:42" },
"2": { "fact": "isA Cat Carnivore", "source": "biology.sys2:43" }
}
}
| Style | Characteristics | Example Phrase |
|---|---|---|
| Academic | Formal, passive voice, citations | "It has been established that..." |
| Professional | Clear, direct, action-oriented | "The analysis shows that..." |
| Educational | Simple vocabulary, examples | "Think of it like this..." |
| Casual | Conversational, contractions | "Here's what we found..." |