Use Cases + Implementation

How do you build summarization with AI agents?

Build summarization as an agent workflow: split long inputs into sections, summarise each with citations, then combine the partial summaries and verify that key facts survived. On Plugsky the workflow uses live chat completions with JSON mode for structured summaries, long-context models for combining many sections, and function calling when the agent must fetch or check source material.

Key facts

PatternSplit → summarise sections → combine → verify coverage
RuntimeChat completions with streaming and JSON mode (live)
Long contextplugsky-longctx for combining many partial summaries
CitationsSection-level source references in structured output
Models30+ models behind one endpoint, route per pass
VerificationCoverage checks against extracted entities and figures
DeploymentRegion-locked planes, VPC, on-prem and air-gapped options
Free tierplugsky-micro and plugsky-lite on the free plan, no card required

TL;DR

  • Summarise in passes for long inputs; single-shot prompts lose the middle.
  • Keep citations per section so readers can verify any claim.
  • Extract figures and entities first, then check the summary covers them.
  • Use JSON mode for summaries with sections, bullets and sources.
  • Evaluate coverage and factual fidelity, not just readability.

How it works, step by step

  1. Estimate input size in tokens and decide between single-pass and multi-pass summarisation.
  2. Split long inputs along natural boundaries — sections, speakers or document structure — keeping references.
  3. Summarise each part with an instruction to preserve figures, dates, names and decisions.
  4. Combine partial summaries with a long-context model, requiring citations to the original parts.
  5. Run a coverage check: extract key entities and figures from the source and confirm they appear.
  6. Add a verification pass that flags unsupported or missing items before publication.
  7. Evaluate coverage, factual fidelity and length targets on a labelled set of documents.
1Estimate input sizein tokens anddecide between2Split long inputsalong naturalboundaries —3Summarise each partwith an instructionto preserve4Combine partialsummaries with along-context model,5Run a coveragecheck: extract keyentities and6Add a verificationpass that flagsunsupported or

Try it yourself

Open the tokenizer →

Map, reduce and verify

Long inputs break single-shot summarisation: models compress beginnings and endings and lose the middle. The fix is structural — summarise in parts, then combine. Each part keeps its source reference, and the combination step works from partial summaries rather than the full text, which keeps the final prompt manageable.

Plugsky's chat completions endpoint is live with streaming and JSON mode, so summaries can be structured objects with sections, bullets and sources. When the agent needs to fetch related material — a referenced appendix, a linked thread — function calling handles it in the same loop.

Chunking and long-context trade-offs

There are two valid strategies. Multi-pass map-reduce handles very long inputs reliably and scales with document size. Single-pass with a long-context model is simpler and better at preserving cross-section reasoning when the input fits comfortably. Choose per document type rather than committing to one approach.

  • Preserve structure: split on sections, headings or speaker turns, not fixed windows.
  • Protect facts: instruct each pass to retain figures, dates and named entities verbatim.
  • Reference everything: every bullet in a partial summary cites its section.
  • Mind the budget: check token counts before prompting and trim retrieval rather than truncating mid-sentence.

Evaluating summaries

Readability is the easy part; fidelity is what matters. Evaluate coverage — are the key entities, figures and decisions present — and factual accuracy — does every claim match the source. Build a labelled set of documents with the facts that must survive, then score each summary against it.

Track length targets too, since summaries that balloon or truncate fail their purpose. Route section summaries to small, fast models and the combination pass to a long-context model. Store the structured summary with its citations so reviewers and downstream systems can verify claims without reopening the source. For confidential documents, deploy in a region-locked plane or on-prem with Plugsky and keep retention aligned to policy.

Honest comparison

ConcernAgentic multi-passSingle-shot promptManual summarising
Long inputsHandles full documents reliablyLoses middle sectionsDepends on reader
CitationsSection-level references retainedUsually absentNotes
Fact preservationExplicit figures and entitiesInconsistentHuman judgement
VerificationCoverage checks before releaseNoneReview
Cost shapeMore calls, smaller promptsOne large callHuman time

Frequently asked questions

When should I use multi-pass summarisation?

When the input exceeds what a single prompt handles well or contains many distinct sections. Splitting on structure and combining partial summaries preserves coverage far better than one large prompt.

How do I stop summaries losing numbers?

Instruct each pass to retain figures, dates and named entities verbatim, then run a coverage check that compares extracted facts against the final summary and flags anything missing.

Should summaries include citations?

Yes. Section-level references let readers verify claims quickly and make the summary auditable, which matters for meetings, research and compliance work.

Which model handles the combine step?

A long-context model such as plugsky-longctx works well when many partial summaries must be weighed together. Section passes can run on smaller, faster models.

How do I evaluate quality?

Score coverage of must-keep facts, factual fidelity against the source and adherence to length targets, using a labelled document set rather than subjective reading.

Can the agent summarise meeting transcripts?

Yes. Split by speaker turn or topic block, summarise each, then combine into decisions, actions and open questions with references back to the transcript.

Can it run on-prem?

Yes. Plugsky supports region-locked cloud planes plus VPC, on-prem and air-gapped deployment, so confidential documents can stay inside your network.