---
title: "Search Past Conversation"
description: "Search indexed past conversations by meaning and optional filters."
canonical_url: "https://docs.vettero.com/build/workflows/blocks/chat/search-past-conversation"
---
# Search Past Conversation

> Search indexed past conversations by meaning and optional filters.

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



</block-meta>

**Search Past Conversation** finds older chats that are similar to a query. Optional filters narrow the search to a session, user, or channel.

Only sessions on a [channel](https://docs.vettero.com/build/channels) with **Vectorize** enabled are indexed. Turn Vectorize on under routing when you create the channel, or later under **Edit routing**. Existing chats from before Vectorize was enabled are not backfilled.

<note>

The query is semantic (similar meaning), not exact keyword match. Names, order ids, and other exact strings can still match when they appear in the indexed text.

</note>

## Configure

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

<tbody>
  <tr>
    <td>
      <strong>
        Search query
      </strong>
    </td>
    
    <td>
      Text to match against indexed transcripts
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Session ID
      </strong>
    </td>
    
    <td>
      Optional session to search within
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        User identifier
      </strong>
    </td>
    
    <td>
      Optional user filter
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Channel
      </strong>
    </td>
    
    <td>
      Optional channel type (for example web)
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Channel identifier
      </strong>
    </td>
    
    <td>
      Optional identifier on that channel
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Limit
      </strong>
    </td>
    
    <td>
      Page size. Default <strong>
        10
      </strong>
      
      , 1–100
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Page
      </strong>
    </td>
    
    <td>
      Page number. Default <strong>
        1
      </strong>
    </td>
  </tr>
</tbody>
</table>

Leave **Search query** empty and the block puts an empty result list on the pipe so the graph can continue.

## 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 search returns
    </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>
        results
      </code>
    </td>
    
    <td>
      <code>
        list<Result>
      </code>
    </td>
    
    <td>
      Matching conversations, best match first
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        total
      </code>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      Matches found in this retrieval (among the top candidates)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        page
      </code>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      Page used
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        limit
      </code>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      Page size used
    </td>
  </tr>
</tbody>
</table>

Each `Result` includes:

<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 id
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        channel
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Channel type
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        channelIdentifier
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Identifier on that channel
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        userIdentifier
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      User on that channel
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        summary
      </code>
    </td>
    
    <td>
      any
    </td>
    
    <td>
      Session summary when one exists
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        snippet
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Excerpt from the matching transcript chunk
    </td>
  </tr>
</tbody>
</table>

## Use case

- Look up a similar past chat before answering (for example “refund for delayed order”).
- Combine with [Get Messages](https://docs.vettero.com/build/workflows/blocks/chat/get-messages) when you need the full transcript of a hit.
- Use [Recent Sessions](https://docs.vettero.com/build/workflows/blocks/chat/recent-sessions) when you only need the latest sessions for a user, not a meaning search.

<block-page-nav>



</block-page-nav>


## Sitemap

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