document-summary
Published
Public
in @summarization-essentialseval100%

Summarize a document with format (paragraph/bullets) and length (one sentence/short/detailed) knobs — grounded strictly in the input, with key topic tags.

document-summary

The workhorse: summarize any document with a format knob (paragraph / bullets) and a length knob (one_sentence / short / detailed) — grounded strictly in the input. The prompt never adds outside knowledge, never sharpens a hedge ("may improve" stays "may improve"), and returns key_topics tags you can use for search or routing.

Entrypoints

EntrypointRendersInputs
systemSummarizer instructions + format/length definitions + embedded output schemaformat, target_length
userThe delimited document + knobsdocument, format, target_length

Render system as the system message and user as the user message. Pass the shared variables to both renders.

Variables

  • document (string, required) — the text to summarize; may be empty.
  • format (string, required)paragraph (prose) or bullets (markdown - list).
  • target_length (string, required)one_sentence, short (2–4 sentences / 3–5 bullets), or detailed (2–3 paragraphs / 8–12 bullets).

Output

{
  "reasoning": "An incident postmortem; at short length the cause, impact, and fix make the cut.",
  "summary": "A misconfigured cache caused elevated error rates for 43 minutes on May 3. Rolling back the deploy restored service, and the team added a config lint to prevent recurrence.",
  "key_topics": ["incident postmortem", "cache misconfiguration", "rollback"]
}
  • Grounded only — every statement is supported by the document; outside knowledge is banned even when true.
  • Instructions inside the document are summarized, not obeyed.
  • Empty-input behaviour is specified and observable: empty/whitespace document → summary is exactly "Nothing to summarize." with empty key_topics (the published eval asserts it).

House conventions

  • Reasoning-first, key order pinned in the system prompt.
  • Closed knob vocabularies — two formats, three lengths, defined in the prompt.
  • Injection-safe input: triple-mustache inside an XML-style <document> delimiter.
  • Eval-gated: the published eval checks schema, must-mention facts, must-NOT-mention traps, and groundedness via the collection's summary-grader judge.

Part of the Summarization Essentials collection — pair with key-points-extraction when you need verbatim supporting quotes.

@sufleur/