| name | summarizer |
| version | 1.0.0 |
| description | Summarises a block of text to a target word count using extractive techniques. |
| inputs | [{"name":"text","type":"string","description":"The text to summarise (plain text, up to ~10 000 words)","required":true},{"name":"max_words","type":"integer","description":"Target maximum word count for the summary (default 100)","required":false},{"name":"language","type":"string","description":"BCP-47 language code for the output summary, e.g. 'en', 'es' (default: 'en')","required":false}] |
| outputs | [{"name":"summary","type":"string","description":"The condensed summary text"},{"name":"word_count","type":"integer","description":"Actual word count of the returned summary"},{"name":"compression_ratio","type":"number","description":"Ratio of summary words to input words (lower = more compressed)"}] |
| capabilities | ["stateless","streaming"] |
| dependencies | ["httpx>=0.27.0"] |
| resources | {"vcpu":1,"memory_mib":128,"boot_timeout_ms":500} |
Overview
The summarizer agent condenses large blocks of text into concise summaries.
It uses a sentence-scoring heuristic (TF-IDF-style term frequency) to select the
most representative sentences from the input, staying within the requested max_words limit.
This agent is deliberately stateless — each request is independent.
Algorithm
- Tokenise the input into sentences (split on
., !, ? followed by whitespace).
- Score each sentence by the frequency of its constituent words across the full document.
- Select top-scoring sentences in document order until
max_words is reached.
- Return the selected sentences joined by spaces.
Example
Request:
{
"text": "The unikernel-fabric is a spec-driven runtime...",
"max_words": 50
}
Response:
{
"summary": "The unikernel-fabric is a spec-driven runtime for deploying autonomous agents.",
"word_count": 12,
"compression_ratio": 0.24
}
Error Handling
- If
text is empty or fewer than 10 words, return HTTP 422 with {"error": "text too short to summarise"}.
- If
max_words is less than 5, clamp to 5.
- If the detected or requested
language is not supported, fall back to "en" and note it in a warning field.