graphiti/graphiti_core/utils/maintenance
Daniel Chalef 8770012745
Refactor prompt structure: move MESSAGES after instructions (#980)
* Refactor prompt structure: move MESSAGES after instructions

Reordered prompt structure in extract_nodes.py to place MESSAGES section
after instructions/guidelines in both extract_attributes and extract_summary
functions for improved prompt clarity.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* Add sentence-aware text truncator for entity summaries

- Created truncate_at_sentence() utility function that truncates text at
  sentence boundaries while respecting max character limits
- Added MAX_SUMMARY_CHARS constant (250 chars) for entity summaries
- Applied truncator to entity summaries in prompts (extract_nodes.py)
- Applied truncator to LLM-generated summaries (node_operations.py)
- Added comprehensive test suite for truncation logic

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

Co-Authored-By: Claude <noreply@anthropic.com>

* Clean up formatting in extract_attributes prompt

- Remove extra blank lines
- Fix indentation of MESSAGES tag

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

Co-Authored-By: Claude <noreply@anthropic.com>

* Bump version to 0.22.0pre3

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

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-04 19:06:32 -07:00
..
__init__.py Gemini support (#324) 2025-04-06 09:27:04 -07:00
community_operations.py Remove ensure_ascii configuration parameter (#969) 2025-10-02 15:10:57 -07:00
dedup_helpers.py Refactor batch deduplication logic to enhance node resolution and track duplicate pairs (#929) (#936) 2025-09-26 08:40:18 -07:00
edge_operations.py Add group_id parameter to language extraction function (#952) 2025-10-03 09:05:45 -07:00
graph_data_operations.py OpenSearch updates (#906) 2025-09-14 01:43:37 -04:00
node_operations.py Refactor prompt structure: move MESSAGES after instructions (#980) 2025-10-04 19:06:32 -07:00
temporal_operations.py Remove ensure_ascii configuration parameter (#969) 2025-10-02 15:10:57 -07:00
utils.py chore: Fix packaging (#38) 2024-08-25 10:07:50 -07:00