Skip to main content
Hierarchical summaries build file → folder → project abstractions so agents route queries efficiently across large knowledge bases. The user asks a broad or specific question; routing picks the right summary level.

How It Works

Quick Start

1

Build a three-level hierarchy

2

Persist and reload


Overview

The HierarchicalSummarizer provides:
  • Multi-level summaries at file, folder, and project levels
  • Query routing to appropriate summary levels
  • Incremental updates when files change
  • Persistent storage of summary hierarchies

Building Hierarchies

From Directory

Summary Levels

Query Routing

Automatic Routing

Manual Level Selection

Persistence

CLI Usage

Integration with Agents

Best Practices

File, folder, and project summaries balance routing precision with build cost for typical documentation corpora.
Keep file summaries shorter than folder summaries, and folder summaries shorter than the project root — avoids bloated parent nodes.
Save to JSON after the initial build so startup skips re-summarising unchanged files.
Call update_file() or rebuild_folder() instead of rebuilding the entire tree when only part of the corpus changes.

Knowledge

Knowledge sources and retrieval

Smart Retrieval

Query routing and relevance strategies

Context Compression

Compress long contexts before LLM calls

RAG Overview

Retrieval-augmented generation patterns