finds.dev← search

// the find

parthsarthi03/raptor

★ 1,711 · Python · MIT · updated Sep 2024

The official implementation of RAPTOR: Recursive Abstractive Processing for Tree-Organized Retrieval

RAPTOR is a research implementation of a 2024 ICLR paper that builds a recursive tree of abstractive summaries over your documents, then retrieves across multiple levels of that tree. The idea is that flat chunk retrieval misses high-level context; the tree structure is supposed to fix that. Aimed at ML researchers and RAG practitioners willing to read the paper alongside the code.

The core algorithm is well-structured — clustering, summarizing, and building the tree layer-by-layer is cleanly separated into `cluster_tree_builder.py` and `cluster_utils.py`. The abstraction model (BaseSummarizationModel, BaseQAModel, BaseEmbeddingModel) makes swapping in local models straightforward, and the demo notebook actually shows Llama/Mistral examples. It ships with both a tree-traversal retriever and a collapsed FAISS retriever, so you can compare approaches without rewriting. The clustering uses Gaussian Mixture Models rather than k-means, which handles uneven document density better.

Last commit was September 2024 and the docs are still marked WIP — this is research code that was shipped to support a paper, not a maintained library. It's hardwired to OpenAI by default and the README doesn't make it obvious that switching models requires reading the source. There's no chunking strategy exposed — you hand it a raw text string and the tree builder decides what to do, which makes it hard to reason about or tune for your domain. No async support, no streaming, no batching controls; indexing a large corpus will block your process and hit rate limits with no backoff.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →