graphiti/graphiti_core/utils
Daniel Chalef f59845e2a8 feat: Add optional callback to control node summary generation
Add NodeSummaryFilter callback parameter to extract_attributes_from_nodes
and extract_attributes_from_node functions, allowing consumers to
selectively skip summary regeneration for specific nodes.

This enables downstream applications to implement custom logic for
throttling or filtering which nodes should have summaries regenerated,
reducing unnecessary LLM calls and token costs.

Key changes:
- Add NodeSummaryFilter type alias: Callable[[EntityNode], Awaitable[bool]]
- Update extract_attributes_from_nodes with optional should_summarize_node parameter
- Update extract_attributes_from_node with conditional summary generation logic
- Add 5 comprehensive test cases covering callback functionality
- Maintain full backwards compatibility (default None = all summaries generated)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-01 13:22:20 -07:00
..
maintenance feat: Add optional callback to control node summary generation 2025-10-01 13:22:20 -07:00
ontology_utils move summary out of attribute extraction (#792) 2025-07-31 12:15:21 -04:00
__init__.py refactor: use utc_now() for consistent UTC datetime handling (#234) 2024-12-09 10:36:04 -08:00
bulk_utils.py fix: Prevent duplicate edge facts within same episode (#955) 2025-10-01 07:30:30 -07:00
datetime_utils.py Add support for Kuzu as the graph driver (#799) 2025-08-27 11:45:21 -04:00