Skip to content

Progressive summarization and chunking#77

Merged
eshulman2 merged 2 commits into
mainfrom
progressiveSum
Nov 24, 2025
Merged

Progressive summarization and chunking#77
eshulman2 merged 2 commits into
mainfrom
progressiveSum

Conversation

@eshulman2

@eshulman2 eshulman2 commented Nov 24, 2025

Copy link
Copy Markdown
Owner

Summary

This PR adds progressive summarization capabilities to handle large meeting notes that exceed LLM context limits. The system uses a multi-pass iterative approach to reduce very long documents while preserving critical
information, enabling reliable processing of meeting notes of any size.

Problem

Meeting notes can vary wildly in length (1K to 200K+ tokens), and when they exceed the LLM's context window:

  • API calls fail with context length errors
  • Generation quality degrades with bloated context
  • Action item extraction becomes unreliable

Previously, the system would either fail or truncate content, losing important information.

Solution

Implemented a three-tier processing strategy:

  1. Progressive Summarization (1-3 passes) - Gradually reduces content while preserving key information
  2. Semantic Chunking - Splits extremely large documents with overlap to maintain context
  3. Graceful Fallback - Automatic degradation to truncation if summarization fails

Key Features

  • Multi-pass reduction: Configurable 1-3 pass summarization with aggressive/balanced/conservative strategies
  • Overlapping chunks: Maintains context across chunk boundaries
  • Configurable parameters: Chunk sizes, overlap ratios, and reduction strategies
  • Enhanced action items workflow: Separate generation/refinement/review phases
  • Refactored prompt system: Prompts moved to separate .txt files for easier maintenance
  • Full observability: Detailed logging and metadata tracking
  • Zero breaking changes: Seamlessly integrates with existing workflows
  • Comprehensive testing: 1048 lines of test coverage

Changes

Core Implementation

  • Added src/infrastructure/utils/progressive_summarization.py (590 lines) - Main implementation
  • Enhanced src/workflows/action_items_generation_workflow.py with progressive summarization
  • Refactored src/infrastructure/prompts/prompts.py to use file-based prompts

Configuration

  • Added summarization config options to config.json and configs/action-items-config.json
  • New config reader in src/infrastructure/config/read_config.py

Prompts (moved to separate files)

  • src/infrastructure/prompts/summarization/ - Progressive summarization prompts (3 passes)
  • src/infrastructure/prompts/action_items/ - Generation, refinement, review prompts
  • src/infrastructure/prompts/agents/ - Agent-specific prompts
  • src/infrastructure/prompts/legacy/ - Legacy prompts preserved for compatibility

Documentation

  • Added docs/PROGRESSIVE_SUMMARIZATION.md (666 lines) - Comprehensive documentation
  • Updated docs/ARCHITECTURE.md with new components
  • Updated README.md with configuration examples

Bug Fixes

  • Fixed scripts/generate_token.py import order issue (ModuleNotFoundError)

Testing

  • Added tests/unit/utils/test_progressive_summarization.py (1048 lines)
  • Full coverage of chunking, summarization, and edge cases

Move sys.path modification before src imports to resolve ModuleNotFoundError.
Add pylint disable comment for intentional import-after-code pattern.

Fixes the script to run correctly when executed directly.
Implements automatic multi-pass progressive summarization with overlapping
chunks to handle meeting notes that exceed LLM context limits.

Key Features:
- Automatic activation based on threshold_ratio (no enable/disable flag)
- Multi-pass summarization (1-3 passes) with configurable strategies
- Automatic chunking with overlap for extremely large documents
- Refactored prompt system with separate .txt files
- Enhanced action items workflow (generation/refinement/review phases)

Design Decisions:
- Progressive summarization always activates when notes exceed threshold_ratio
  of max context tokens (no manual enable/disable to prevent misconfiguration)
- Chunking always enabled as a safety mechanism (no opt-out)
- Simple threshold_ratio (0-1) instead of multiplier-based calculation
- Three reduction strategies: aggressive/balanced/conservative

Configuration:
- threshold_ratio: Trigger when tokens > (max_context × ratio) [0-1]
- max_passes: Maximum summarization passes (1-5, default: 3)
- strategy: aggressive/balanced/conservative reduction approach
- chunk_threshold_ratio: Auto-chunk when tokens > (context × ratio)
- chunk_size_ratio: Each chunk as ratio of context window
- chunk_overlap_tokens: Token overlap between chunks

This ensures robust handling of meeting notes of any length while maintaining
coherent summaries and accurate action item extraction.
@eshulman2 eshulman2 merged commit 30e6eee into main Nov 24, 2025
6 checks passed
@eshulman2 eshulman2 deleted the progressiveSum branch November 24, 2025 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant