---
title: "Summarize Chat"
description: "Summarize a session or message-id range into concise text."
canonical_url: "https://docs.vettero.com/build/workflows/blocks/chat/summarize"
---
# Summarize Chat

> Summarize a session or message-id range into concise text.

<block-meta block="Yes" channels="Any" folder="chat" group="Chat" groupTo="/build/workflows/blocks/chat" icon="i-lucide-scroll-text" pipe="Value" scope="Any" tool="Yes" type="chat.summarize">



</block-meta>

**Summarize Chat** generates a short summary of a chat session, optionally limited to a message-id range. Session id is required. [Start Chat](https://docs.vettero.com/build/workflows/blocks/chat/start-chat) can also summarize the conversation it started when that session ends — use this block when you need a summary on an existing session.

## Configure

<table>
<thead>
  <tr>
    <th>
      Setting
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Session ID
      </strong>
    </td>
    
    <td>
      Session to summarize (required). Literal or variable
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        From Message ID
      </strong>
    </td>
    
    <td>
      Optional start of the range
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        To Message ID
      </strong>
    </td>
    
    <td>
      Optional end of the range
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Prompt
      </strong>
    </td>
    
    <td>
      Instructions for the summary. A default prompt is filled in if you leave it empty
    </td>
  </tr>
</tbody>
</table>

## Handles

<table>
<thead>
  <tr>
    <th>
      Handle
    </th>
    
    <th>
      Role
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        In
      </strong>
      
       (target)
    </td>
    
    <td>
      Incoming connection
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Out
      </strong>
      
       (source)
    </td>
    
    <td>
      Continues after the summary is generated
    </td>
  </tr>
</tbody>
</table>

## Pipe schema

The next block reads this on the data pipe (`pipe.value`).

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        sessionId
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Session that was summarized
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        message
      </code>
    </td>
    
    <td>
      object
    </td>
    
    <td>
      Window that was summarized
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        summary
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Generated summary text
    </td>
  </tr>
</tbody>
</table>

`message` includes:

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        start
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      First message id in the window (may be empty)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        end
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Last message id in the window (may be empty)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        count
      </code>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      How many messages were included
    </td>
  </tr>
</tbody>
</table>

## Use case

- Store a recap on a table row after a long chat.
- Summarize only the handover window using start and end message ids from [Handover](https://docs.vettero.com/build/workflows/blocks/chat/handover).

<block-page-nav>



</block-page-nav>


## Sitemap

See the full [sitemap](https://docs.vettero.com/sitemap.md) for all pages.
