Preview — full styling will appear after the next deploy completes.

agentic-ai-patterns

Skeleton of Thought

Parallel structured content generation

Generate a structured outline first, then fill each section IN PARALLEL. Dramatically faster than sequential writing for long structured outputs like reports or documentation.

flowchart TD
    S([__start__]) --> O[outline]
    O -->|Send| W1[write_section 1]
    O -->|Send| W2[write_section 2]
    O -->|Send| W3[write_section N]
    W1 --> A[assemble]
    W2 --> A
    W3 --> A
    A --> E([__end__])

Skeleton of Thought (SoT) addresses a key inefficiency in long-form generation: if you write a 10-section report section by section, the LLM is idle while waiting for the previous section to finish. SoT breaks this by first generating a lightweight outline (the "skeleton"), then writing all sections simultaneously.

In LangGraph, the `outline` node produces a list of `{title, description, order}` objects. The `fan_out_sections` node emits one `Send` per section, dispatching all section writers in parallel. Each writer receives the section specification and relevant database context and writes independently.

The `assemble` node runs only after all parallel writers have completed. It sorts sections by their `order` field and stitches them into a final report. On a 10-section report, this can be 5–7× faster than sequential generation — making SoT one of the highest-ROI patterns in this collection.