Skip to content
Forward Deployed

Forward Deployed
Lessons and contents
Learn

Hierarchical & Memory-Augmented Retrieval: overview

Source
From the RAG & Agents Engineering course
By
Sourav Banerjee
Last updated
8 Nov 2026

Report an issue

A passage index finds local evidence. A question about the whole handbook may need a representation assembled from several passages before retrieval begins. The T13.1 notebooks build on four ideas: abstraction levels, collapsed-tree retrieval, global memory and dual-level retrieval.

Larkspur Cloud's handbook supplies the running example. A customer asks how cancellation affects data access; an operations lead asks how the handbook manages service continuity. Both questions connect policies that live in separate sections. Source passages still decide what the answer may claim.

In short

  • RAPTOR adds summaries at several levels to the retrieval corpus. Preserve their links to the passages they summarise.
  • Collapsed-tree retrieval ranks leaves and summaries together. Tree traversal chooses a route through parent-child links; these are different retrieval algorithms.
  • MemoRAG uses corpus memory to draft retrieval clues. Verify those clues against retrieved evidence before answering.
  • LightRAG separates entity-focused retrieval from retrieval over thematic relationships, then assembles graph context and source passages.
  • The lab uses four authored source passages and three representative summaries. At a two-node budget, the continuity query reaches one source identifier with leaves only and four through summary ancestry. These are fixture retrieval counts, not algorithm benchmark results.

Mental model

Representations lead back to sourcesRead sources, build and store derived representations, retrieve them, check original evidence and answer. Source passages Build representations Derived index Retrieve Check sources Answer
  1. Read the current authorised source passages.
  2. Build summaries, memory records or graph profiles.
  3. Store derived text with its source dependencies.
  4. Use the question to select derived records and passages.
  5. Check policy claims against their original passages.
  6. Answer with evidence that supports each claim.

Derived representations can make distributed evidence easier to find. They also introduce another place to lose an exception, merge unrelated entities or preserve a deleted policy. Keep source identifiers and versions through every transformation so a retrieved summary can lead back to its evidence.

Interactive lab

Search the leaves or the whole tree: open the file in a browser. Compare the thematic question in leaf-only and collapsed modes. Move the result budget and inspect which summary or source passage enters the context. Switch to the specific export question and check whether a broad summary displaces the precise evidence.

How it connects

  • Before: T5.1 establishes the flat retrieval baseline. T10.1 and T10.2 cover conversational and persistent agent memory; this module's memory represents a document corpus.
  • Next: T13.2 makes graph modelling and queries explicit. T13.3 compares graph traversal, community reports and graph expansion.

Key Takeaways

  • Choose a representation for the information need and compare it against the flat baseline.
  • A summary's source coverage does not prove that every source fact survived compression.
  • Distinguish a paper's algorithm from the simplified implementation in its teaching notebook.
  • Measure retrieval, source support, update work and generation quality separately.

Rate your confidence and keep notes on the module page.