graphiti/graphiti_core/utils
Daniel Chalef 296287d076 Optimize edge deduplication prompt for caching and clarity
- Restructure prompt to place invariant instructions at top and dynamic context at bottom for better LLM caching
- Change 'id' to 'idx' in edge context lists to avoid confusion with other identifiers
- Remove 'fact_type_id' from edge types context as LLM only needs fact_type_name
- Remove dynamic range values from prompt instructions (e.g., "range 0-N")
- Add debug logging before LLM call to track input sizes
- Add validation logging after LLM response to catch invalid idx values
- Clarify that duplicate_facts uses EXISTING FACTS idx and contradicted_facts uses INVALIDATION CANDIDATES idx

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-02 16:50:26 -07:00
..
maintenance Optimize edge deduplication prompt for caching and clarity 2025-10-02 16:50:26 -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