liveBook · Manning

High-Level Searcher

As explained in Retrieval Augmented Generation, The Foundational Ideas

The High-Level Searcher is LevelRAG's planning component that decomposes a user query into atomic sub-queries, summarizes evidence, verifies answers, and issues supplemental queries.

A complex question can fail even when retrieval finds relevant documents: a single pass may leave one part unanswered, and an answer generator may fill the gap without evidence. The High-Level Searcher (HLS) is LevelRAG’s planner for this problem. It breaks a request into atomic retrieval tasks, examines what comes back, and decides whether more research is needed. section 11.1.5 section 11.3

The HLS directs an iterative workflow rather than searching an index itself:

  • Decompose the request into indivisible sub-queries and select a suitable sparse, dense, or web searcher for each. section 11.3.1 section 11.3.3
  • Answer each sub-query from its retrieved documents to produce a focused summary. This avoids stuffing all documents into one prompt and losing important facts in a long context. section 11.3.1
  • Verify whether the combined summaries answer the original question. If they do not, name the missing information and issue supplemental queries. section 11.3 section 11.3.3

Following a compliance reference

To compare 2025 enhanced due diligence requirements for domestic politically exposed persons in the UK and EU, the HLS can request UK and EU requirements separately. If a UK result cites FCA guidance FG25/3, it can create a further query for that identifier—even though the user never supplied it. That follow-up distinguishes planning from a one-shot split of the original question. section 11.3.1

Listing 11.5 The LevelRAG engine with verify-and-supplement loop.
class LevelRAGEngine:
    def __init__(self, hls: HighLevelSearcher,
                 low_level_searchers: dict, max_iter: int = 3):
        self.hls = hls
        self.searchers = low_level_searchers  #A
        self.max_iter = max_iter
 
    def execute(self, user_query: str) -> List[str]:
        summaries: List[str] = []
        pending = self.hls.decompose(user_query)
        for iteration in range(self.max_iter):
            for atomic in pending:  #B
                searcher = self.searchers.get(
                    atomic.tool, self.searchers['dense'])
                docs = searcher.retrieve(atomic.text)
                summary = self.hls.summarize(atomic, docs)
                summaries.append(
                    f"[{atomic.tool.upper()}] {atomic.rationale}\n{summary}"
                )
            verdict = self.hls.verify(user_query, summaries)  #C
            if verdict.sufficient:
                return summaries
            pending = self.hls.supplement(verdict.missing)  #D
            if not pending:
                break
        return summaries  #E
 

The engine listing shows how atomic queries are dispatched, their results summarized, and the workflow bounded by a maximum iteration count. section 11.3.3

The HLS owns decomposition, summarization, verification, and supplementation; a separate engine executes the loop and dispatches retrieval. One implementation routes each atomic query to a single chosen searcher to reduce cost. The original LevelRAG design instead runs each query through all low-level searchers, allowing evidence from multiple retrieval methods to be considered. In production, a CRAG-style evaluator can also audit each sub-result before summarization, but the extra work makes it useful to reserve the full pipeline for complex queries. section 11.3.3 section 11.5.3

How Retrieval Augmented Generation, The Foundational Ideas covers it

How deep it goes
Works through planner responsibilities and a bounded Python engine loop, while deferring fuller prompt instructions to a companion implementation.
Examples
Traces a UK–EU domestic PEP compliance comparison that generates a follow-up query for a newly discovered guidance identifier.
What it assumes
Assumes familiarity with LLM-backed retrieval while defining atomic queries and distinguishing planning from direct index access.
What you can do after
Build it from scratch with Python planner methods and an engine that dispatches queries, checks sufficiency, and limits iterations.
How it connects
Links query decomposition and retrieval verification to sparse retrieval, dense retrieval, web search, and CRAG-style result evaluation.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Retrieval Augmented Generation, The Foundational Ideas. The section links point to the parts of the book it draws on.