Blueprints

Summarize Text with an AI Agent, Generate Multilingual Summaries in Short, Medium, or Long Format

Source

yaml
id: agent-text-summarizer
namespace: company.ai

inputs:
  - id: summary_length
    displayName: Summary Length
    type: SELECT
    defaults: medium
    values:
      - short
      - medium
      - long

  - id: language
    displayName: Language ISO code
    type: SELECT
    defaults: en
    values:
      - en
      - fr
      - de
      - es
      - it
      - ru
      - ja

  - id: text
    type: STRING
    displayName: Text to summarize
    defaults: |
      Kestra is an open-source orchestration platform that:
      - Allows you to define workflows declaratively in YAML
      - Allows non-developers to automate tasks with a no-code interface
      - Keeps everything versioned and governed, so it stays secure and auditable
      - Extends easily for custom use cases through plugins and custom scripts.
      Kestra follows a "start simple and grow as needed" philosophy. You can schedule a basic workflow in a few minutes, then later add Python scripts, Docker containers, or complicated branching logic if the situation calls for it.

tasks:
  - id: multilingual_agent
    type: io.kestra.plugin.ai.agent.AIAgent
    systemMessage: |
      You are a precise technical assistant.
      Produce a {{ inputs.summary_length }} summary in {{ inputs.language }}.
      Keep it factual, remove fluff, and avoid marketing language.
      If the input is empty or non-text, return a one-sentence explanation.
      Output format:
      - 1-2 sentences for 'short'
      - 2-5 sentences for 'medium'
      - Up to 5 paragraphs for 'long'
    prompt: |
      Summarize the following content: {{ inputs.text }}

  - id: english_brevity
    type: io.kestra.plugin.ai.agent.AIAgent
    prompt: Generate exactly 1 sentence English summary of "{{
      outputs.multilingual_agent.textOutput }}"

pluginDefaults:
  - type: io.kestra.plugin.ai.agent.AIAgent
    values:
      provider:
        type: io.kestra.plugin.ai.provider.GoogleGemini
        modelName: gemini-2.5-flash
        apiKey: "{{ kv('GEMINI_API_KEY') }}"
        configuration:
          logRequests: true
          logResponses: true
          responseFormat:
            type: TEXT

About this blueprint

AI

This blueprint demonstrates how to automate AI-powered text summarization using an agent-based large language model, with support for multiple languages and configurable summary lengths.

It shows how to:

  1. Summarize long-form text automatically using an AI agent.
  2. Choose the level of detail by generating short, medium, or long summaries.
  3. Produce summaries in multiple languages using standard ISO language codes.
  4. Enforce strict output constraints to generate factual, low-noise summaries suitable for technical and business use cases.
  5. Chain AI agents to post-process results, including generating an exact one-sentence English summary for previews, indexing, or downstream systems.

This pattern is widely used in content automation, knowledge management, document processing, search indexing, and AI assistants where large volumes of text must be summarized quickly and consistently.

By combining clear instructions with output rules, this blueprint helps produce repeatable summarization results that can be integrated into broader automation or data processing pipelines.

AIAgent

Google Gemini

More Related Blueprints

New to Kestra?

Use blueprints to kickstart your first workflows.

Get started with Kestra