Progressive summarization and chunking#77
Merged
Merged
Conversation
dd61216 to
1817753
Compare
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.
1817753 to
667a620
Compare
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.
667a620 to
092dd6c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Previously, the system would either fail or truncate content, losing important information.
Solution
Implemented a three-tier processing strategy:
Key Features
.txtfiles for easier maintenanceChanges
Core Implementation
src/infrastructure/utils/progressive_summarization.py(590 lines) - Main implementationsrc/workflows/action_items_generation_workflow.pywith progressive summarizationsrc/infrastructure/prompts/prompts.pyto use file-based promptsConfiguration
config.jsonandconfigs/action-items-config.jsonsrc/infrastructure/config/read_config.pyPrompts (moved to separate files)
src/infrastructure/prompts/summarization/- Progressive summarization prompts (3 passes)src/infrastructure/prompts/action_items/- Generation, refinement, review promptssrc/infrastructure/prompts/agents/- Agent-specific promptssrc/infrastructure/prompts/legacy/- Legacy prompts preserved for compatibilityDocumentation
docs/PROGRESSIVE_SUMMARIZATION.md(666 lines) - Comprehensive documentationdocs/ARCHITECTURE.mdwith new componentsREADME.mdwith configuration examplesBug Fixes
scripts/generate_token.pyimport order issue (ModuleNotFoundError)Testing
tests/unit/utils/test_progressive_summarization.py(1048 lines)