Building Long Context RAG with RAPTOR for Analyzing Workato Recipe Code

Ferry Djaja
5 min readMar 31, 2024

In this blog, I would like to go through how to use RAPTOR for analyzing Workato recipe JSON code and ultimately generating a comprehensive summary of the Workato recipe flow.

RAPTOR — Recursive Abstractive Processing For Tree-Organized Retrieval

Overview

RAPTOR is trying to address the limitations of existing retrieval-augmented language models that can only retrieve short chunks from a retrieval corpus. It proposes a novel method for large text corpus processing that recursively embeds, clusters, and summarizes chunks of text into a multi-layered tree structure.

RAPTOR is a system that processes chunks of text by clustering them, creating summaries of these clusters, and repeating this process to form a tree-like structure. This structure allows RAPTOR to provide a Language Model (LLM) with context chunks that represent the text at various levels. This enables the LLM to answer questions effectively and efficiently at different levels of detail.

Tree construction process: RAPTOR recursively clusters chunks of text based on their
vector embeddings and generates text summaries of those clusters, constructing a tree from the
bottom up. Nodes clustered together are siblings; a parent node contains the text summary of that
cluster.

--

--

No responses yet