graphiti/graphiti_core
HUGO SON ce9ef3ca79
Add support for non-ASCII characters in LLM prompts (#805)
* Add support for non-ASCII characters in LLM prompts

- Add ensure_ascii parameter to Graphiti class (default: True)
- Create to_prompt_json helper function for consistent JSON serialization
- Update all prompt files to use new helper function
- Preserve Korean/Japanese/Chinese characters when ensure_ascii=False
- Maintain backward compatibility with existing behavior

Fixes issue where non-ASCII characters were escaped as unicode sequences
in prompts, making them unreadable in LLM logs and potentially affecting
model understanding.

* Remove unused json imports after replacing with to_prompt_json helper

- Fix ruff lint errors (F401) for unused json imports
- All prompt files now use to_prompt_json helper instead of json.dumps
- Maintains clean code style and passes lint checks

* Fix ensure_ascii propagation to all LLM calls

- Add ensure_ascii parameter to maintenance operation functions that were missing it
- Update function signatures in node_operations, community_operations, temporal_operations, and edge_operations
- Ensure all llm_client.generate_response calls receive proper ensure_ascii context
- Fix hardcoded ensure_ascii: True values that prevented non-ASCII character preservation
- Maintain backward compatibility with default ensure_ascii=True
- Complete the fix for issue #804 ensuring Korean/Japanese/Chinese characters are properly handled in LLM prompts
2025-08-08 11:07:32 -04:00
..
cross_encoder Bulk ingestion (#698) 2025-07-10 12:14:49 -04:00
driver chore/prepare kuzu integration (#762) 2025-07-29 09:07:34 -04:00
embedder save edge update (#721) 2025-07-14 11:15:38 -04:00
llm_client save edge update (#721) 2025-07-14 11:15:38 -04:00
models chore/prepare kuzu integration (#762) 2025-07-29 09:07:34 -04:00
prompts Add support for non-ASCII characters in LLM prompts (#805) 2025-08-08 11:07:32 -04:00
search Add support for non-ASCII characters in LLM prompts (#805) 2025-08-08 11:07:32 -04:00
telemetry feat: add telemetry with PostHog and update Docker configurations (#633) 2025-06-27 12:23:30 -07:00
utils Add support for non-ASCII characters in LLM prompts (#805) 2025-08-08 11:07:32 -04:00
__init__.py chore: Fix packaging (#38) 2024-08-25 10:07:50 -07:00
edges.py chore/prepare kuzu integration (#762) 2025-07-29 09:07:34 -04:00
errors.py Add group ID validation and error handling (#618) 2025-06-24 09:33:54 -07:00
graph_queries.py add community group id index (#802) 2025-08-04 12:24:44 -04:00
graphiti.py Add support for non-ASCII characters in LLM prompts (#805) 2025-08-08 11:07:32 -04:00
graphiti_types.py Add support for non-ASCII characters in LLM prompts (#805) 2025-08-08 11:07:32 -04:00
helpers.py move summary out of attribute extraction (#792) 2025-07-31 12:15:21 -04:00
nodes.py add batch delete capabilities (#813) 2025-08-07 15:51:30 -04:00
py.typed Add py.typed file (#105) 2024-09-11 08:44:06 -04:00