graphiti-core 0.21.0rc11__tar.gz → 0.21.0rc13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of graphiti-core might be problematic. Click here for more details.

Files changed (193) hide show
  1. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/PKG-INFO +1 -1
  2. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/graphiti.py +1 -11
  3. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/graphiti_types.py +0 -1
  4. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/prompts/dedupe_edges.py +40 -29
  5. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/prompts/dedupe_nodes.py +8 -8
  6. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/prompts/eval.py +3 -3
  7. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/prompts/extract_edges.py +17 -9
  8. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/prompts/extract_nodes.py +7 -7
  9. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/prompts/prompt_helpers.py +3 -3
  10. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/prompts/summarize_nodes.py +5 -5
  11. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/search/search_helpers.py +5 -7
  12. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/utils/bulk_utils.py +0 -1
  13. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/utils/maintenance/community_operations.py +8 -20
  14. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/utils/maintenance/edge_operations.py +44 -14
  15. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/utils/maintenance/node_operations.py +1 -11
  16. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/utils/maintenance/temporal_operations.py +0 -4
  17. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/pyproject.toml +1 -1
  18. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/utils/maintenance/test_bulk_utils.py +0 -2
  19. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/utils/maintenance/test_edge_operations.py +0 -8
  20. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/utils/maintenance/test_node_operations.py +0 -10
  21. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/uv.lock +1 -1
  22. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.env.example +0 -0
  23. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  24. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/dependabot.yml +0 -0
  25. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/pull_request_template.md +0 -0
  26. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/secret_scanning.yml +0 -0
  27. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/workflows/ai-moderator.yml +0 -0
  28. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/workflows/cla.yml +0 -0
  29. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/workflows/claude-code-review.yml +0 -0
  30. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/workflows/claude.yml +0 -0
  31. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/workflows/codeql.yml +0 -0
  32. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/workflows/daily_issue_maintenance.yml +0 -0
  33. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/workflows/issue-triage.yml +0 -0
  34. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/workflows/lint.yml +0 -0
  35. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/workflows/mcp-server-docker.yml +0 -0
  36. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/workflows/release-graphiti-core.yml +0 -0
  37. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/workflows/typecheck.yml +0 -0
  38. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.github/workflows/unit_tests.yml +0 -0
  39. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/.gitignore +0 -0
  40. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/AGENTS.md +0 -0
  41. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/CLAUDE.md +0 -0
  42. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/CODE_OF_CONDUCT.md +0 -0
  43. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/CONTRIBUTING.md +0 -0
  44. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/Dockerfile +0 -0
  45. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/LICENSE +0 -0
  46. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/Makefile +0 -0
  47. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/README.md +0 -0
  48. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/SECURITY.md +0 -0
  49. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/Zep-CLA.md +0 -0
  50. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/conftest.py +0 -0
  51. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/depot.json +0 -0
  52. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/docker-compose.test.yml +0 -0
  53. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/docker-compose.yml +0 -0
  54. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/ellipsis.yaml +0 -0
  55. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/data/manybirds_products.json +0 -0
  56. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/ecommerce/runner.ipynb +0 -0
  57. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/ecommerce/runner.py +0 -0
  58. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/langgraph-agent/agent.ipynb +0 -0
  59. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/langgraph-agent/tinybirds-jess.png +0 -0
  60. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/podcast/podcast_runner.py +0 -0
  61. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/podcast/podcast_transcript.txt +0 -0
  62. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/podcast/transcript_parser.py +0 -0
  63. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/quickstart/README.md +0 -0
  64. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/quickstart/quickstart_falkordb.py +0 -0
  65. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/quickstart/quickstart_neo4j.py +0 -0
  66. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/quickstart/quickstart_neptune.py +0 -0
  67. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/quickstart/requirements.txt +0 -0
  68. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/wizard_of_oz/parser.py +0 -0
  69. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/wizard_of_oz/runner.py +0 -0
  70. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/examples/wizard_of_oz/woo.txt +0 -0
  71. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/__init__.py +0 -0
  72. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/cross_encoder/__init__.py +0 -0
  73. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/cross_encoder/bge_reranker_client.py +0 -0
  74. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/cross_encoder/client.py +0 -0
  75. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/cross_encoder/gemini_reranker_client.py +0 -0
  76. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/cross_encoder/openai_reranker_client.py +0 -0
  77. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/driver/__init__.py +0 -0
  78. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/driver/driver.py +0 -0
  79. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/driver/falkordb_driver.py +0 -0
  80. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/driver/kuzu_driver.py +0 -0
  81. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/driver/neo4j_driver.py +0 -0
  82. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/driver/neptune_driver.py +0 -0
  83. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/edges.py +0 -0
  84. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/embedder/__init__.py +0 -0
  85. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/embedder/azure_openai.py +0 -0
  86. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/embedder/client.py +0 -0
  87. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/embedder/gemini.py +0 -0
  88. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/embedder/openai.py +0 -0
  89. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/embedder/voyage.py +0 -0
  90. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/errors.py +0 -0
  91. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/graph_queries.py +0 -0
  92. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/helpers.py +0 -0
  93. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/llm_client/__init__.py +0 -0
  94. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/llm_client/anthropic_client.py +0 -0
  95. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/llm_client/azure_openai_client.py +0 -0
  96. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/llm_client/client.py +0 -0
  97. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/llm_client/config.py +0 -0
  98. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/llm_client/errors.py +0 -0
  99. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/llm_client/gemini_client.py +0 -0
  100. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/llm_client/groq_client.py +0 -0
  101. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/llm_client/openai_base_client.py +0 -0
  102. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/llm_client/openai_client.py +0 -0
  103. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/llm_client/openai_generic_client.py +0 -0
  104. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/llm_client/utils.py +0 -0
  105. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/migrations/__init__.py +0 -0
  106. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/models/__init__.py +0 -0
  107. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/models/edges/__init__.py +0 -0
  108. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/models/edges/edge_db_queries.py +0 -0
  109. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/models/nodes/__init__.py +0 -0
  110. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/models/nodes/node_db_queries.py +0 -0
  111. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/nodes.py +0 -0
  112. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/prompts/__init__.py +0 -0
  113. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/prompts/extract_edge_dates.py +0 -0
  114. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/prompts/invalidate_edges.py +0 -0
  115. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/prompts/lib.py +0 -0
  116. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/prompts/models.py +0 -0
  117. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/py.typed +0 -0
  118. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/search/__init__.py +0 -0
  119. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/search/search.py +0 -0
  120. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/search/search_config.py +0 -0
  121. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/search/search_config_recipes.py +0 -0
  122. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/search/search_filters.py +0 -0
  123. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/search/search_utils.py +0 -0
  124. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/telemetry/__init__.py +0 -0
  125. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/telemetry/telemetry.py +0 -0
  126. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/utils/__init__.py +0 -0
  127. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/utils/datetime_utils.py +0 -0
  128. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/utils/maintenance/__init__.py +0 -0
  129. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/utils/maintenance/dedup_helpers.py +0 -0
  130. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/utils/maintenance/graph_data_operations.py +0 -0
  131. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/utils/maintenance/utils.py +0 -0
  132. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/graphiti_core/utils/ontology_utils/entity_types_utils.py +0 -0
  133. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/images/arxiv-screenshot.png +0 -0
  134. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/images/graphiti-graph-intro.gif +0 -0
  135. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/images/graphiti-intro-slides-stock-2.gif +0 -0
  136. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/images/simple_graph.svg +0 -0
  137. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/mcp_server/.env.example +0 -0
  138. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/mcp_server/.python-version +0 -0
  139. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/mcp_server/Dockerfile +0 -0
  140. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/mcp_server/README.md +0 -0
  141. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/mcp_server/cursor_rules.md +0 -0
  142. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/mcp_server/docker-compose.yml +0 -0
  143. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/mcp_server/graphiti_mcp_server.py +0 -0
  144. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/mcp_server/mcp_config_sse_example.json +0 -0
  145. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/mcp_server/mcp_config_stdio_example.json +0 -0
  146. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/mcp_server/pyproject.toml +0 -0
  147. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/mcp_server/uv.lock +0 -0
  148. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/py.typed +0 -0
  149. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/pytest.ini +0 -0
  150. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/.env.example +0 -0
  151. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/Makefile +0 -0
  152. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/README.md +0 -0
  153. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/graph_service/__init__.py +0 -0
  154. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/graph_service/config.py +0 -0
  155. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/graph_service/dto/__init__.py +0 -0
  156. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/graph_service/dto/common.py +0 -0
  157. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/graph_service/dto/ingest.py +0 -0
  158. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/graph_service/dto/retrieve.py +0 -0
  159. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/graph_service/main.py +0 -0
  160. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/graph_service/routers/__init__.py +0 -0
  161. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/graph_service/routers/ingest.py +0 -0
  162. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/graph_service/routers/retrieve.py +0 -0
  163. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/graph_service/zep_graphiti.py +0 -0
  164. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/pyproject.toml +0 -0
  165. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/server/uv.lock +0 -0
  166. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/signatures/version1/cla.json +0 -0
  167. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/cross_encoder/test_bge_reranker_client.py +0 -0
  168. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/cross_encoder/test_gemini_reranker_client.py +0 -0
  169. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/driver/__init__.py +0 -0
  170. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/driver/test_falkordb_driver.py +0 -0
  171. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/embedder/embedder_fixtures.py +0 -0
  172. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/embedder/test_gemini.py +0 -0
  173. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/embedder/test_openai.py +0 -0
  174. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/embedder/test_voyage.py +0 -0
  175. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/evals/data/longmemeval_data/README.md +0 -0
  176. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/evals/data/longmemeval_data/longmemeval_oracle.json +0 -0
  177. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/evals/eval_cli.py +0 -0
  178. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/evals/eval_e2e_graph_building.py +0 -0
  179. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/evals/pytest.ini +0 -0
  180. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/evals/utils.py +0 -0
  181. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/helpers_test.py +0 -0
  182. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/llm_client/test_anthropic_client.py +0 -0
  183. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/llm_client/test_anthropic_client_int.py +0 -0
  184. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/llm_client/test_client.py +0 -0
  185. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/llm_client/test_errors.py +0 -0
  186. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/llm_client/test_gemini_client.py +0 -0
  187. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/test_edge_int.py +0 -0
  188. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/test_entity_exclusion_int.py +0 -0
  189. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/test_graphiti_int.py +0 -0
  190. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/test_graphiti_mock.py +0 -0
  191. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/test_node_int.py +0 -0
  192. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/utils/maintenance/test_temporal_operations_int.py +0 -0
  193. {graphiti_core-0.21.0rc11 → graphiti_core-0.21.0rc13}/tests/utils/search/search_utils_test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graphiti-core
3
- Version: 0.21.0rc11
3
+ Version: 0.21.0rc13
4
4
  Summary: A temporal graph building library
5
5
  Project-URL: Homepage, https://help.getzep.com/graphiti/graphiti/overview
6
6
  Project-URL: Repository, https://github.com/getzep/graphiti
@@ -136,7 +136,6 @@ class Graphiti:
136
136
  store_raw_episode_content: bool = True,
137
137
  graph_driver: GraphDriver | None = None,
138
138
  max_coroutines: int | None = None,
139
- ensure_ascii: bool = False,
140
139
  ):
141
140
  """
142
141
  Initialize a Graphiti instance.
@@ -169,10 +168,6 @@ class Graphiti:
169
168
  max_coroutines : int | None, optional
170
169
  The maximum number of concurrent operations allowed. Overrides SEMAPHORE_LIMIT set in the environment.
171
170
  If not set, the Graphiti default is used.
172
- ensure_ascii : bool, optional
173
- Whether to escape non-ASCII characters in JSON serialization for prompts. Defaults to False.
174
- Set as False to preserve non-ASCII characters (e.g., Korean, Japanese, Chinese) in their
175
- original form, making them readable in LLM logs and improving model understanding.
176
171
 
177
172
  Returns
178
173
  -------
@@ -202,7 +197,6 @@ class Graphiti:
202
197
 
203
198
  self.store_raw_episode_content = store_raw_episode_content
204
199
  self.max_coroutines = max_coroutines
205
- self.ensure_ascii = ensure_ascii
206
200
  if llm_client:
207
201
  self.llm_client = llm_client
208
202
  else:
@@ -221,7 +215,6 @@ class Graphiti:
221
215
  llm_client=self.llm_client,
222
216
  embedder=self.embedder,
223
217
  cross_encoder=self.cross_encoder,
224
- ensure_ascii=self.ensure_ascii,
225
218
  )
226
219
 
227
220
  # Capture telemetry event
@@ -559,9 +552,7 @@ class Graphiti:
559
552
  if update_communities:
560
553
  communities, community_edges = await semaphore_gather(
561
554
  *[
562
- update_community(
563
- self.driver, self.llm_client, self.embedder, node, self.ensure_ascii
564
- )
555
+ update_community(self.driver, self.llm_client, self.embedder, node)
565
556
  for node in nodes
566
557
  ],
567
558
  max_coroutines=self.max_coroutines,
@@ -1071,7 +1062,6 @@ class Graphiti:
1071
1062
  ),
1072
1063
  None,
1073
1064
  None,
1074
- self.ensure_ascii,
1075
1065
  )
1076
1066
 
1077
1067
  edges: list[EntityEdge] = [resolved_edge] + invalidated_edges
@@ -27,6 +27,5 @@ class GraphitiClients(BaseModel):
27
27
  llm_client: LLMClient
28
28
  embedder: EmbedderClient
29
29
  cross_encoder: CrossEncoderClient
30
- ensure_ascii: bool = False
31
30
 
32
31
  model_config = ConfigDict(arbitrary_types_allowed=True)
@@ -25,11 +25,11 @@ from .prompt_helpers import to_prompt_json
25
25
  class EdgeDuplicate(BaseModel):
26
26
  duplicate_facts: list[int] = Field(
27
27
  ...,
28
- description='List of ids of any duplicate facts. If no duplicate facts are found, default to empty list.',
28
+ description='List of idx values of any duplicate facts. If no duplicate facts are found, default to empty list.',
29
29
  )
30
30
  contradicted_facts: list[int] = Field(
31
31
  ...,
32
- description='List of ids of facts that should be invalidated. If no facts should be invalidated, the list should be empty.',
32
+ description='List of idx values of facts that should be invalidated. If no facts should be invalidated, the list should be empty.',
33
33
  )
34
34
  fact_type: str = Field(..., description='One of the provided fact types or DEFAULT')
35
35
 
@@ -67,11 +67,11 @@ def edge(context: dict[str, Any]) -> list[Message]:
67
67
  Given the following context, determine whether the New Edge represents any of the edges in the list of Existing Edges.
68
68
 
69
69
  <EXISTING EDGES>
70
- {to_prompt_json(context['related_edges'], ensure_ascii=context.get('ensure_ascii', False), indent=2)}
70
+ {to_prompt_json(context['related_edges'], indent=2)}
71
71
  </EXISTING EDGES>
72
72
 
73
73
  <NEW EDGE>
74
- {to_prompt_json(context['extracted_edges'], ensure_ascii=context.get('ensure_ascii', False), indent=2)}
74
+ {to_prompt_json(context['extracted_edges'], indent=2)}
75
75
  </NEW EDGE>
76
76
 
77
77
  Task:
@@ -98,7 +98,7 @@ def edge_list(context: dict[str, Any]) -> list[Message]:
98
98
  Given the following context, find all of the duplicates in a list of facts:
99
99
 
100
100
  Facts:
101
- {to_prompt_json(context['edges'], ensure_ascii=context.get('ensure_ascii', False), indent=2)}
101
+ {to_prompt_json(context['edges'], indent=2)}
102
102
 
103
103
  Task:
104
104
  If any facts in Facts is a duplicate of another fact, return a new fact with one of their uuid's.
@@ -124,37 +124,48 @@ def resolve_edge(context: dict[str, Any]) -> list[Message]:
124
124
  Message(
125
125
  role='user',
126
126
  content=f"""
127
- <NEW FACT>
128
- {context['new_edge']}
129
- </NEW FACT>
130
-
127
+ Task:
128
+ You will receive TWO separate lists of facts. Each list uses 'idx' as its index field, starting from 0.
129
+
130
+ 1. DUPLICATE DETECTION:
131
+ - If the NEW FACT represents identical factual information as any fact in EXISTING FACTS, return those idx values in duplicate_facts.
132
+ - Facts with similar information that contain key differences should NOT be marked as duplicates.
133
+ - Return idx values from EXISTING FACTS.
134
+ - If no duplicates, return an empty list for duplicate_facts.
135
+
136
+ 2. FACT TYPE CLASSIFICATION:
137
+ - Given the predefined FACT TYPES, determine if the NEW FACT should be classified as one of these types.
138
+ - Return the fact type as fact_type or DEFAULT if NEW FACT is not one of the FACT TYPES.
139
+
140
+ 3. CONTRADICTION DETECTION:
141
+ - Based on FACT INVALIDATION CANDIDATES and NEW FACT, determine which facts the new fact contradicts.
142
+ - Return idx values from FACT INVALIDATION CANDIDATES.
143
+ - If no contradictions, return an empty list for contradicted_facts.
144
+
145
+ IMPORTANT:
146
+ - duplicate_facts: Use ONLY 'idx' values from EXISTING FACTS
147
+ - contradicted_facts: Use ONLY 'idx' values from FACT INVALIDATION CANDIDATES
148
+ - These are two separate lists with independent idx ranges starting from 0
149
+
150
+ Guidelines:
151
+ 1. Some facts may be very similar but will have key differences, particularly around numeric values in the facts.
152
+ Do not mark these facts as duplicates.
153
+
154
+ <FACT TYPES>
155
+ {context['edge_types']}
156
+ </FACT TYPES>
157
+
131
158
  <EXISTING FACTS>
132
159
  {context['existing_edges']}
133
160
  </EXISTING FACTS>
161
+
134
162
  <FACT INVALIDATION CANDIDATES>
135
163
  {context['edge_invalidation_candidates']}
136
164
  </FACT INVALIDATION CANDIDATES>
137
-
138
- <FACT TYPES>
139
- {context['edge_types']}
140
- </FACT TYPES>
141
-
142
165
 
143
- Task:
144
- If the NEW FACT represents identical factual information of one or more in EXISTING FACTS, return the idx of the duplicate facts.
145
- Facts with similar information that contain key differences should not be marked as duplicates.
146
- If the NEW FACT is not a duplicate of any of the EXISTING FACTS, return an empty list.
147
-
148
- Given the predefined FACT TYPES, determine if the NEW FACT should be classified as one of these types.
149
- Return the fact type as fact_type or DEFAULT if NEW FACT is not one of the FACT TYPES.
150
-
151
- Based on the provided FACT INVALIDATION CANDIDATES and NEW FACT, determine which existing facts the new fact contradicts.
152
- Return a list containing all idx's of the facts that are contradicted by the NEW FACT.
153
- If there are no contradicted facts, return an empty list.
154
-
155
- Guidelines:
156
- 1. Some facts may be very similar but will have key differences, particularly around numeric values in the facts.
157
- Do not mark these facts as duplicates.
166
+ <NEW FACT>
167
+ {context['new_edge']}
168
+ </NEW FACT>
158
169
  """,
159
170
  ),
160
171
  ]
@@ -64,20 +64,20 @@ def node(context: dict[str, Any]) -> list[Message]:
64
64
  role='user',
65
65
  content=f"""
66
66
  <PREVIOUS MESSAGES>
67
- {to_prompt_json([ep for ep in context['previous_episodes']], ensure_ascii=context.get('ensure_ascii', False), indent=2)}
67
+ {to_prompt_json([ep for ep in context['previous_episodes']], indent=2)}
68
68
  </PREVIOUS MESSAGES>
69
69
  <CURRENT MESSAGE>
70
70
  {context['episode_content']}
71
71
  </CURRENT MESSAGE>
72
72
  <NEW ENTITY>
73
- {to_prompt_json(context['extracted_node'], ensure_ascii=context.get('ensure_ascii', False), indent=2)}
73
+ {to_prompt_json(context['extracted_node'], indent=2)}
74
74
  </NEW ENTITY>
75
75
  <ENTITY TYPE DESCRIPTION>
76
- {to_prompt_json(context['entity_type_description'], ensure_ascii=context.get('ensure_ascii', False), indent=2)}
76
+ {to_prompt_json(context['entity_type_description'], indent=2)}
77
77
  </ENTITY TYPE DESCRIPTION>
78
78
 
79
79
  <EXISTING ENTITIES>
80
- {to_prompt_json(context['existing_nodes'], ensure_ascii=context.get('ensure_ascii', False), indent=2)}
80
+ {to_prompt_json(context['existing_nodes'], indent=2)}
81
81
  </EXISTING ENTITIES>
82
82
 
83
83
  Given the above EXISTING ENTITIES and their attributes, MESSAGE, and PREVIOUS MESSAGES; Determine if the NEW ENTITY extracted from the conversation
@@ -125,7 +125,7 @@ def nodes(context: dict[str, Any]) -> list[Message]:
125
125
  role='user',
126
126
  content=f"""
127
127
  <PREVIOUS MESSAGES>
128
- {to_prompt_json([ep for ep in context['previous_episodes']], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
128
+ {to_prompt_json([ep for ep in context['previous_episodes']], indent=2)}
129
129
  </PREVIOUS MESSAGES>
130
130
  <CURRENT MESSAGE>
131
131
  {context['episode_content']}
@@ -142,11 +142,11 @@ def nodes(context: dict[str, Any]) -> list[Message]:
142
142
  }}
143
143
 
144
144
  <ENTITIES>
145
- {to_prompt_json(context['extracted_nodes'], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
145
+ {to_prompt_json(context['extracted_nodes'], indent=2)}
146
146
  </ENTITIES>
147
147
 
148
148
  <EXISTING ENTITIES>
149
- {to_prompt_json(context['existing_nodes'], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
149
+ {to_prompt_json(context['existing_nodes'], indent=2)}
150
150
  </EXISTING ENTITIES>
151
151
 
152
152
  Each entry in EXISTING ENTITIES is an object with the following structure:
@@ -197,7 +197,7 @@ def node_list(context: dict[str, Any]) -> list[Message]:
197
197
  Given the following context, deduplicate a list of nodes:
198
198
 
199
199
  Nodes:
200
- {to_prompt_json(context['nodes'], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
200
+ {to_prompt_json(context['nodes'], indent=2)}
201
201
 
202
202
  Task:
203
203
  1. Group nodes together such that all duplicate nodes are in the same list of uuids
@@ -68,7 +68,7 @@ def query_expansion(context: dict[str, Any]) -> list[Message]:
68
68
  Bob is asking Alice a question, are you able to rephrase the question into a simpler one about Alice in the third person
69
69
  that maintains the relevant context?
70
70
  <QUESTION>
71
- {to_prompt_json(context['query'], ensure_ascii=context.get('ensure_ascii', False))}
71
+ {to_prompt_json(context['query'])}
72
72
  </QUESTION>
73
73
  """
74
74
  return [
@@ -84,10 +84,10 @@ def qa_prompt(context: dict[str, Any]) -> list[Message]:
84
84
  Your task is to briefly answer the question in the way that you think Alice would answer the question.
85
85
  You are given the following entity summaries and facts to help you determine the answer to your question.
86
86
  <ENTITY_SUMMARIES>
87
- {to_prompt_json(context['entity_summaries'], ensure_ascii=context.get('ensure_ascii', False))}
87
+ {to_prompt_json(context['entity_summaries'])}
88
88
  </ENTITY_SUMMARIES>
89
89
  <FACTS>
90
- {to_prompt_json(context['facts'], ensure_ascii=context.get('ensure_ascii', False))}
90
+ {to_prompt_json(context['facts'])}
91
91
  </FACTS>
92
92
  <QUESTION>
93
93
  {context['query']}
@@ -24,9 +24,16 @@ from .prompt_helpers import to_prompt_json
24
24
 
25
25
  class Edge(BaseModel):
26
26
  relation_type: str = Field(..., description='FACT_PREDICATE_IN_SCREAMING_SNAKE_CASE')
27
- source_entity_id: int = Field(..., description='The id of the source entity of the fact.')
28
- target_entity_id: int = Field(..., description='The id of the target entity of the fact.')
29
- fact: str = Field(..., description='')
27
+ source_entity_id: int = Field(
28
+ ..., description='The id of the source entity from the ENTITIES list'
29
+ )
30
+ target_entity_id: int = Field(
31
+ ..., description='The id of the target entity from the ENTITIES list'
32
+ )
33
+ fact: str = Field(
34
+ ...,
35
+ description='A natural language description of the relationship between the entities, paraphrased from the source text',
36
+ )
30
37
  valid_at: str | None = Field(
31
38
  None,
32
39
  description='The date and time when the relationship described by the edge fact became true or was established. Use ISO 8601 format (YYYY-MM-DDTHH:MM:SS.SSSSSSZ)',
@@ -73,7 +80,7 @@ def edge(context: dict[str, Any]) -> list[Message]:
73
80
  </FACT TYPES>
74
81
 
75
82
  <PREVIOUS_MESSAGES>
76
- {to_prompt_json([ep for ep in context['previous_episodes']], ensure_ascii=context.get('ensure_ascii', False), indent=2)}
83
+ {to_prompt_json([ep for ep in context['previous_episodes']], indent=2)}
77
84
  </PREVIOUS_MESSAGES>
78
85
 
79
86
  <CURRENT_MESSAGE>
@@ -81,7 +88,7 @@ def edge(context: dict[str, Any]) -> list[Message]:
81
88
  </CURRENT_MESSAGE>
82
89
 
83
90
  <ENTITIES>
84
- {context['nodes']}
91
+ {to_prompt_json(context['nodes'], indent=2)}
85
92
  </ENTITIES>
86
93
 
87
94
  <REFERENCE_TIME>
@@ -107,11 +114,12 @@ You may use information from the PREVIOUS MESSAGES only to disambiguate referenc
107
114
 
108
115
  # EXTRACTION RULES
109
116
 
110
- 1. Only emit facts where both the subject and object match IDs in ENTITIES.
117
+ 1. **Entity ID Validation**: `source_entity_id` and `target_entity_id` must use only the `id` values from the ENTITIES list provided above.
118
+ - **CRITICAL**: Using IDs not in the list will cause the edge to be rejected
111
119
  2. Each fact must involve two **distinct** entities.
112
120
  3. Use a SCREAMING_SNAKE_CASE string as the `relation_type` (e.g., FOUNDED, WORKS_AT).
113
121
  4. Do not emit duplicate or semantically redundant facts.
114
- 5. The `fact_text` should closely paraphrase the original source sentence(s). Do not verbatim quote the original text.
122
+ 5. The `fact` should closely paraphrase the original source sentence(s). Do not verbatim quote the original text.
115
123
  6. Use `REFERENCE_TIME` to resolve vague or relative temporal expressions (e.g., "last week").
116
124
  7. Do **not** hallucinate or infer temporal bounds from unrelated events.
117
125
 
@@ -133,7 +141,7 @@ def reflexion(context: dict[str, Any]) -> list[Message]:
133
141
 
134
142
  user_prompt = f"""
135
143
  <PREVIOUS MESSAGES>
136
- {to_prompt_json([ep for ep in context['previous_episodes']], ensure_ascii=context.get('ensure_ascii', False), indent=2)}
144
+ {to_prompt_json([ep for ep in context['previous_episodes']], indent=2)}
137
145
  </PREVIOUS MESSAGES>
138
146
  <CURRENT MESSAGE>
139
147
  {context['episode_content']}
@@ -167,7 +175,7 @@ def extract_attributes(context: dict[str, Any]) -> list[Message]:
167
175
  content=f"""
168
176
 
169
177
  <MESSAGE>
170
- {to_prompt_json(context['episode_content'], ensure_ascii=context.get('ensure_ascii', False), indent=2)}
178
+ {to_prompt_json(context['episode_content'], indent=2)}
171
179
  </MESSAGE>
172
180
  <REFERENCE TIME>
173
181
  {context['reference_time']}
@@ -89,7 +89,7 @@ def extract_message(context: dict[str, Any]) -> list[Message]:
89
89
  </ENTITY TYPES>
90
90
 
91
91
  <PREVIOUS MESSAGES>
92
- {to_prompt_json([ep for ep in context['previous_episodes']], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
92
+ {to_prompt_json([ep for ep in context['previous_episodes']], indent=2)}
93
93
  </PREVIOUS MESSAGES>
94
94
 
95
95
  <CURRENT MESSAGE>
@@ -197,7 +197,7 @@ def reflexion(context: dict[str, Any]) -> list[Message]:
197
197
 
198
198
  user_prompt = f"""
199
199
  <PREVIOUS MESSAGES>
200
- {to_prompt_json([ep for ep in context['previous_episodes']], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
200
+ {to_prompt_json([ep for ep in context['previous_episodes']], indent=2)}
201
201
  </PREVIOUS MESSAGES>
202
202
  <CURRENT MESSAGE>
203
203
  {context['episode_content']}
@@ -221,7 +221,7 @@ def classify_nodes(context: dict[str, Any]) -> list[Message]:
221
221
 
222
222
  user_prompt = f"""
223
223
  <PREVIOUS MESSAGES>
224
- {to_prompt_json([ep for ep in context['previous_episodes']], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
224
+ {to_prompt_json([ep for ep in context['previous_episodes']], indent=2)}
225
225
  </PREVIOUS MESSAGES>
226
226
  <CURRENT MESSAGE>
227
227
  {context['episode_content']}
@@ -259,8 +259,8 @@ def extract_attributes(context: dict[str, Any]) -> list[Message]:
259
259
  content=f"""
260
260
 
261
261
  <MESSAGES>
262
- {to_prompt_json(context['previous_episodes'], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
263
- {to_prompt_json(context['episode_content'], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
262
+ {to_prompt_json(context['previous_episodes'], indent=2)}
263
+ {to_prompt_json(context['episode_content'], indent=2)}
264
264
  </MESSAGES>
265
265
 
266
266
  Given the above MESSAGES and the following ENTITY, update any of its attributes based on the information provided
@@ -289,8 +289,8 @@ def extract_summary(context: dict[str, Any]) -> list[Message]:
289
289
  content=f"""
290
290
 
291
291
  <MESSAGES>
292
- {to_prompt_json(context['previous_episodes'], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
293
- {to_prompt_json(context['episode_content'], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
292
+ {to_prompt_json(context['previous_episodes'], indent=2)}
293
+ {to_prompt_json(context['episode_content'], indent=2)}
294
294
  </MESSAGES>
295
295
 
296
296
  Given the above MESSAGES and the following ENTITY, update the summary that combines relevant information about the entity
@@ -4,20 +4,20 @@ from typing import Any
4
4
  DO_NOT_ESCAPE_UNICODE = '\nDo not escape unicode characters.\n'
5
5
 
6
6
 
7
- def to_prompt_json(data: Any, ensure_ascii: bool = True, indent: int = 2) -> str:
7
+ def to_prompt_json(data: Any, ensure_ascii: bool = False, indent: int = 2) -> str:
8
8
  """
9
9
  Serialize data to JSON for use in prompts.
10
10
 
11
11
  Args:
12
12
  data: The data to serialize
13
- ensure_ascii: If True, escape non-ASCII characters. If False, preserve them.
13
+ ensure_ascii: If True, escape non-ASCII characters. If False (default), preserve them.
14
14
  indent: Number of spaces for indentation
15
15
 
16
16
  Returns:
17
17
  JSON string representation of the data
18
18
 
19
19
  Notes:
20
- When ensure_ascii=False, non-ASCII characters (e.g., Korean, Japanese, Chinese)
20
+ By default (ensure_ascii=False), non-ASCII characters (e.g., Korean, Japanese, Chinese)
21
21
  are preserved in their original form in the prompt, making them readable
22
22
  in LLM logs and improving model understanding.
23
23
  """
@@ -59,7 +59,7 @@ def summarize_pair(context: dict[str, Any]) -> list[Message]:
59
59
  Summaries must be under 250 words.
60
60
 
61
61
  Summaries:
62
- {to_prompt_json(context['node_summaries'], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
62
+ {to_prompt_json(context['node_summaries'], indent=2)}
63
63
  """,
64
64
  ),
65
65
  ]
@@ -76,8 +76,8 @@ def summarize_context(context: dict[str, Any]) -> list[Message]:
76
76
  content=f"""
77
77
 
78
78
  <MESSAGES>
79
- {to_prompt_json(context['previous_episodes'], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
80
- {to_prompt_json(context['episode_content'], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
79
+ {to_prompt_json(context['previous_episodes'], indent=2)}
80
+ {to_prompt_json(context['episode_content'], indent=2)}
81
81
  </MESSAGES>
82
82
 
83
83
  Given the above MESSAGES and the following ENTITY name, create a summary for the ENTITY. Your summary must only use
@@ -100,7 +100,7 @@ def summarize_context(context: dict[str, Any]) -> list[Message]:
100
100
  </ENTITY CONTEXT>
101
101
 
102
102
  <ATTRIBUTES>
103
- {to_prompt_json(context['attributes'], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
103
+ {to_prompt_json(context['attributes'], indent=2)}
104
104
  </ATTRIBUTES>
105
105
  """,
106
106
  ),
@@ -120,7 +120,7 @@ def summary_description(context: dict[str, Any]) -> list[Message]:
120
120
  Summaries must be under 250 words.
121
121
 
122
122
  Summary:
123
- {to_prompt_json(context['summary'], ensure_ascii=context.get('ensure_ascii', True), indent=2)}
123
+ {to_prompt_json(context['summary'], indent=2)}
124
124
  """,
125
125
  ),
126
126
  ]
@@ -24,9 +24,7 @@ def format_edge_date_range(edge: EntityEdge) -> str:
24
24
  return f'{edge.valid_at if edge.valid_at else "date unknown"} - {(edge.invalid_at if edge.invalid_at else "present")}'
25
25
 
26
26
 
27
- def search_results_to_context_string(
28
- search_results: SearchResults, ensure_ascii: bool = False
29
- ) -> str:
27
+ def search_results_to_context_string(search_results: SearchResults) -> str:
30
28
  """Reformats a set of SearchResults into a single string to pass directly to an LLM as context"""
31
29
  fact_json = [
32
30
  {
@@ -58,16 +56,16 @@ def search_results_to_context_string(
58
56
  These are the most relevant facts and their valid and invalid dates. Facts are considered valid
59
57
  between their valid_at and invalid_at dates. Facts with an invalid_at date of "Present" are considered valid.
60
58
  <FACTS>
61
- {to_prompt_json(fact_json, ensure_ascii=ensure_ascii, indent=12)}
59
+ {to_prompt_json(fact_json, indent=12)}
62
60
  </FACTS>
63
61
  <ENTITIES>
64
- {to_prompt_json(entity_json, ensure_ascii=ensure_ascii, indent=12)}
62
+ {to_prompt_json(entity_json, indent=12)}
65
63
  </ENTITIES>
66
64
  <EPISODES>
67
- {to_prompt_json(episode_json, ensure_ascii=ensure_ascii, indent=12)}
65
+ {to_prompt_json(episode_json, indent=12)}
68
66
  </EPISODES>
69
67
  <COMMUNITIES>
70
- {to_prompt_json(community_json, ensure_ascii=ensure_ascii, indent=12)}
68
+ {to_prompt_json(community_json, indent=12)}
71
69
  </COMMUNITIES>
72
70
  """
73
71
 
@@ -479,7 +479,6 @@ async def dedupe_edges_bulk(
479
479
  episode,
480
480
  edge_types,
481
481
  set(edge_types),
482
- clients.ensure_ascii,
483
482
  )
484
483
  for episode, edge, candidates in dedupe_tuples
485
484
  ]
@@ -131,13 +131,10 @@ def label_propagation(projection: dict[str, list[Neighbor]]) -> list[list[str]]:
131
131
  return clusters
132
132
 
133
133
 
134
- async def summarize_pair(
135
- llm_client: LLMClient, summary_pair: tuple[str, str], ensure_ascii: bool = True
136
- ) -> str:
134
+ async def summarize_pair(llm_client: LLMClient, summary_pair: tuple[str, str]) -> str:
137
135
  # Prepare context for LLM
138
136
  context = {
139
137
  'node_summaries': [{'summary': summary} for summary in summary_pair],
140
- 'ensure_ascii': ensure_ascii,
141
138
  }
142
139
 
143
140
  llm_response = await llm_client.generate_response(
@@ -149,12 +146,9 @@ async def summarize_pair(
149
146
  return pair_summary
150
147
 
151
148
 
152
- async def generate_summary_description(
153
- llm_client: LLMClient, summary: str, ensure_ascii: bool = True
154
- ) -> str:
149
+ async def generate_summary_description(llm_client: LLMClient, summary: str) -> str:
155
150
  context = {
156
151
  'summary': summary,
157
- 'ensure_ascii': ensure_ascii,
158
152
  }
159
153
 
160
154
  llm_response = await llm_client.generate_response(
@@ -168,7 +162,7 @@ async def generate_summary_description(
168
162
 
169
163
 
170
164
  async def build_community(
171
- llm_client: LLMClient, community_cluster: list[EntityNode], ensure_ascii: bool = True
165
+ llm_client: LLMClient, community_cluster: list[EntityNode]
172
166
  ) -> tuple[CommunityNode, list[CommunityEdge]]:
173
167
  summaries = [entity.summary for entity in community_cluster]
174
168
  length = len(summaries)
@@ -180,9 +174,7 @@ async def build_community(
180
174
  new_summaries: list[str] = list(
181
175
  await semaphore_gather(
182
176
  *[
183
- summarize_pair(
184
- llm_client, (str(left_summary), str(right_summary)), ensure_ascii
185
- )
177
+ summarize_pair(llm_client, (str(left_summary), str(right_summary)))
186
178
  for left_summary, right_summary in zip(
187
179
  summaries[: int(length / 2)], summaries[int(length / 2) :], strict=False
188
180
  )
@@ -195,7 +187,7 @@ async def build_community(
195
187
  length = len(summaries)
196
188
 
197
189
  summary = summaries[0]
198
- name = await generate_summary_description(llm_client, summary, ensure_ascii)
190
+ name = await generate_summary_description(llm_client, summary)
199
191
  now = utc_now()
200
192
  community_node = CommunityNode(
201
193
  name=name,
@@ -215,7 +207,6 @@ async def build_communities(
215
207
  driver: GraphDriver,
216
208
  llm_client: LLMClient,
217
209
  group_ids: list[str] | None,
218
- ensure_ascii: bool = True,
219
210
  ) -> tuple[list[CommunityNode], list[CommunityEdge]]:
220
211
  community_clusters = await get_community_clusters(driver, group_ids)
221
212
 
@@ -223,7 +214,7 @@ async def build_communities(
223
214
 
224
215
  async def limited_build_community(cluster):
225
216
  async with semaphore:
226
- return await build_community(llm_client, cluster, ensure_ascii)
217
+ return await build_community(llm_client, cluster)
227
218
 
228
219
  communities: list[tuple[CommunityNode, list[CommunityEdge]]] = list(
229
220
  await semaphore_gather(
@@ -312,17 +303,14 @@ async def update_community(
312
303
  llm_client: LLMClient,
313
304
  embedder: EmbedderClient,
314
305
  entity: EntityNode,
315
- ensure_ascii: bool = True,
316
306
  ) -> tuple[list[CommunityNode], list[CommunityEdge]]:
317
307
  community, is_new = await determine_entity_community(driver, entity)
318
308
 
319
309
  if community is None:
320
310
  return [], []
321
311
 
322
- new_summary = await summarize_pair(
323
- llm_client, (entity.summary, community.summary), ensure_ascii
324
- )
325
- new_name = await generate_summary_description(llm_client, new_summary, ensure_ascii)
312
+ new_summary = await summarize_pair(llm_client, (entity.summary, community.summary))
313
+ new_name = await generate_summary_description(llm_client, new_summary)
326
314
 
327
315
  community.summary = new_summary
328
316
  community.name = new_name