key-points-extraction
Published
Public
in @summarization-essentialseval100%

Extract up to N key points from a document, each backed by a verbatim supporting quote — groundedness you can verify with a substring check, no judge needed.

key-points-extraction

Distill a document into up to N key points, each backed by a verbatim quote from the source. The quote contract makes groundedness mechanically checkable: every quote must survive a plain substring test against the document (document.includes(quote)), so you can verify the extraction in one line of code — no LLM judge, no trust required.

Entrypoints

EntrypointRendersInputs
systemExtraction rules + the quote contract + embedded output schemanum_points
userThe delimited document + point budgetdocument, num_points

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

Variables

  • document (string, required) — the text to extract from; may be empty.
  • num_points (integer, required) — maximum number of points; the prompt returns fewer when the document doesn't contain that many distinct substantive points.

Output

{
  "reasoning": "The postmortem's substantive claims are the cause, the impact window, and the prevention step.",
  "key_points": [
    { "point": "A cache misconfiguration caused the outage.", "quote": "the root cause was a misconfigured cache TTL" },
    { "point": "Errors were elevated for 43 minutes.", "quote": "error rates stayed elevated for 43 minutes" }
  ]
}

Verify it at runtime (do this)

const ok = result.key_points.every(k => document.includes(k.quote));

A failed check means the model paraphrased or fabricated a quote — treat that extraction as unsupported. The published eval asserts exactly this, in CEL, over every dataset case: output.key_points.all(k, case.document.contains(k.quote)).

Behaviour you can rely on

  • Quotes are character-for-character: same casing and punctuation, single-line spans, no ellipsis-stitching.
  • Fewer beats padded: a thin document yields fewer points, never trivia; empty document yields an empty array.
  • Points don't overlap and are ordered most-important-first.
  • Document is data — embedded instructions are content, never orders.

House conventions

  • Reasoning-first, key order pinned in the system prompt.
  • Strict schema, additionalProperties: false.
  • Injection-safe input: triple-mustache inside an XML-style <document> delimiter.
  • Runtime membership check documented above — same pattern as rag-essentials citations.

Part of the Summarization Essentials collection.

@sufleur/