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
Use three levels for most projects
Use three levels for most projects
File, folder, and project summaries balance routing precision with build cost for typical documentation corpora.
Set token limits per level
Set token limits per level
Keep file summaries shorter than folder summaries, and folder summaries shorter than the project root — avoids bloated parent nodes.
Persist hierarchies to disk
Persist hierarchies to disk
Save to JSON after the initial build so startup skips re-summarising unchanged files.
Rebuild incrementally on change
Rebuild incrementally on change
Call
update_file() or rebuild_folder() instead of rebuilding the entire tree when only part of the corpus changes.Related
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

