graphiti/graphiti_core/prompts
Daniel Chalef 5ca8b9565c
fix: Improve deduplication ID validation and logging (#965)
* fix: Improve deduplication ID validation and logging

- Add comprehensive logging to verify IDs sent to LLM (sent vs received)
- Enhance prompt with explicit ID bounds (0 through N-1)
- Add validation warnings for missing and extra IDs from LLM responses
- Improve error message clarity for invalid dedupe IDs
- Log actual IDs sent to LLM to confirm no index leakage

This helps diagnose cases where the LLM returns IDs outside the valid
range (e.g., ID 19 when only 0-18 were sent).

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

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

* fix: Remove redundant logging parameter

Address reviewer comment about redundant third parameter in debug log statement.

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

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

* fix: Address reviewer comments on list slicing and prompt clarity

- Fix list slicing bug: change <= to < to avoid gap when exactly 20 elements
  (previously would skip element 10 when showing 21 elements)
- Consolidate redundant prompt phrasing while maintaining clarity
  (reduced from 3 sentences to 2, keeping essential constraints)

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

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

* fix: Remove redundant prompt text to reduce token usage

Consolidate 'using these exact IDs (0 through N-1)' with following sentence
to eliminate repetition. Changes:
- 'using these exact IDs (0 through {N-1}). Do not skip IDs or use IDs outside this range'
- 'with IDs 0 through {N-1}. Do not skip or add IDs'

Saves ~15 tokens per deduplication call.

🤖 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-02 12:22:07 -07:00
..
__init__.py chore: Fix packaging (#38) 2024-08-25 10:07:50 -07:00
dedupe_edges.py ensure ascii default to false (#817) 2025-08-08 11:20:02 -04:00
dedupe_nodes.py fix: Improve deduplication ID validation and logging (#965) 2025-10-02 12:22:07 -07:00
eval.py ensure ascii default to false (#817) 2025-08-08 11:20:02 -04:00
extract_edge_dates.py prompt update (#378) 2025-04-18 00:09:12 -04:00
extract_edges.py chore: Update edge extraction prompt to paraphrase instead of quote (#957) 2025-10-01 09:05:04 -07:00
extract_nodes.py fix: Fix typo in JSON entity extraction prompt (#953) 2025-10-01 11:23:39 -05:00
invalidate_edges.py Node dedupe efficiency (#490) 2025-05-15 13:56:33 -04:00
lib.py Gemini support (#324) 2025-04-06 09:27:04 -07:00
models.py chore: update version to 0.9.3 and restructure dependencies (#338) 2025-04-08 20:47:38 -07:00
prompt_helpers.py Add support for non-ASCII characters in LLM prompts (#805) 2025-08-08 11:07:32 -04:00
summarize_nodes.py Add support for non-ASCII characters in LLM prompts (#805) 2025-08-08 11:07:32 -04:00