graphiti-core 0.22.0rc1__tar.gz → 0.22.0rc3__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 (196) hide show
  1. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/PKG-INFO +1 -1
  2. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/prompts/extract_nodes.py +46 -53
  3. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/prompts/prompt_helpers.py +16 -0
  4. graphiti_core-0.22.0rc3/graphiti_core/prompts/snippets.py +29 -0
  5. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/prompts/summarize_nodes.py +24 -29
  6. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/utils/maintenance/node_operations.py +3 -2
  7. graphiti_core-0.22.0rc3/graphiti_core/utils/text_utils.py +53 -0
  8. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/pyproject.toml +1 -1
  9. graphiti_core-0.22.0rc3/tests/test_text_utils.py +106 -0
  10. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/uv.lock +1 -1
  11. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.env.example +0 -0
  12. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  13. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/dependabot.yml +0 -0
  14. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/pull_request_template.md +0 -0
  15. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/secret_scanning.yml +0 -0
  16. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/workflows/ai-moderator.yml +0 -0
  17. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/workflows/cla.yml +0 -0
  18. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/workflows/claude-code-review.yml +0 -0
  19. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/workflows/claude.yml +0 -0
  20. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/workflows/codeql.yml +0 -0
  21. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/workflows/daily_issue_maintenance.yml +0 -0
  22. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/workflows/issue-triage.yml +0 -0
  23. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/workflows/lint.yml +0 -0
  24. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/workflows/mcp-server-docker.yml +0 -0
  25. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/workflows/release-graphiti-core.yml +0 -0
  26. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/workflows/typecheck.yml +0 -0
  27. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.github/workflows/unit_tests.yml +0 -0
  28. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/.gitignore +0 -0
  29. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/AGENTS.md +0 -0
  30. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/CLAUDE.md +0 -0
  31. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/CODE_OF_CONDUCT.md +0 -0
  32. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/CONTRIBUTING.md +0 -0
  33. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/Dockerfile +0 -0
  34. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/LICENSE +0 -0
  35. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/Makefile +0 -0
  36. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/README.md +0 -0
  37. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/SECURITY.md +0 -0
  38. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/Zep-CLA.md +0 -0
  39. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/conftest.py +0 -0
  40. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/depot.json +0 -0
  41. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/docker-compose.test.yml +0 -0
  42. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/docker-compose.yml +0 -0
  43. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/ellipsis.yaml +0 -0
  44. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/data/manybirds_products.json +0 -0
  45. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/ecommerce/runner.ipynb +0 -0
  46. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/ecommerce/runner.py +0 -0
  47. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/langgraph-agent/agent.ipynb +0 -0
  48. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/langgraph-agent/tinybirds-jess.png +0 -0
  49. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/podcast/podcast_runner.py +0 -0
  50. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/podcast/podcast_transcript.txt +0 -0
  51. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/podcast/transcript_parser.py +0 -0
  52. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/quickstart/README.md +0 -0
  53. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/quickstart/quickstart_falkordb.py +0 -0
  54. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/quickstart/quickstart_neo4j.py +0 -0
  55. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/quickstart/quickstart_neptune.py +0 -0
  56. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/quickstart/requirements.txt +0 -0
  57. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/wizard_of_oz/parser.py +0 -0
  58. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/wizard_of_oz/runner.py +0 -0
  59. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/examples/wizard_of_oz/woo.txt +0 -0
  60. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/__init__.py +0 -0
  61. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/cross_encoder/__init__.py +0 -0
  62. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/cross_encoder/bge_reranker_client.py +0 -0
  63. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/cross_encoder/client.py +0 -0
  64. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/cross_encoder/gemini_reranker_client.py +0 -0
  65. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/cross_encoder/openai_reranker_client.py +0 -0
  66. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/driver/__init__.py +0 -0
  67. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/driver/driver.py +0 -0
  68. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/driver/falkordb_driver.py +0 -0
  69. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/driver/kuzu_driver.py +0 -0
  70. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/driver/neo4j_driver.py +0 -0
  71. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/driver/neptune_driver.py +0 -0
  72. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/edges.py +0 -0
  73. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/embedder/__init__.py +0 -0
  74. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/embedder/azure_openai.py +0 -0
  75. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/embedder/client.py +0 -0
  76. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/embedder/gemini.py +0 -0
  77. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/embedder/openai.py +0 -0
  78. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/embedder/voyage.py +0 -0
  79. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/errors.py +0 -0
  80. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/graph_queries.py +0 -0
  81. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/graphiti.py +0 -0
  82. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/graphiti_types.py +0 -0
  83. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/helpers.py +0 -0
  84. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/llm_client/__init__.py +0 -0
  85. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/llm_client/anthropic_client.py +0 -0
  86. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/llm_client/azure_openai_client.py +0 -0
  87. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/llm_client/client.py +0 -0
  88. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/llm_client/config.py +0 -0
  89. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/llm_client/errors.py +0 -0
  90. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/llm_client/gemini_client.py +0 -0
  91. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/llm_client/groq_client.py +0 -0
  92. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/llm_client/openai_base_client.py +0 -0
  93. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/llm_client/openai_client.py +0 -0
  94. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/llm_client/openai_generic_client.py +0 -0
  95. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/llm_client/utils.py +0 -0
  96. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/migrations/__init__.py +0 -0
  97. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/models/__init__.py +0 -0
  98. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/models/edges/__init__.py +0 -0
  99. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/models/edges/edge_db_queries.py +0 -0
  100. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/models/nodes/__init__.py +0 -0
  101. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/models/nodes/node_db_queries.py +0 -0
  102. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/nodes.py +0 -0
  103. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/prompts/__init__.py +0 -0
  104. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/prompts/dedupe_edges.py +0 -0
  105. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/prompts/dedupe_nodes.py +0 -0
  106. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/prompts/eval.py +0 -0
  107. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/prompts/extract_edge_dates.py +0 -0
  108. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/prompts/extract_edges.py +0 -0
  109. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/prompts/invalidate_edges.py +0 -0
  110. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/prompts/lib.py +0 -0
  111. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/prompts/models.py +0 -0
  112. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/py.typed +0 -0
  113. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/search/__init__.py +0 -0
  114. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/search/search.py +0 -0
  115. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/search/search_config.py +0 -0
  116. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/search/search_config_recipes.py +0 -0
  117. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/search/search_filters.py +0 -0
  118. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/search/search_helpers.py +0 -0
  119. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/search/search_utils.py +0 -0
  120. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/telemetry/__init__.py +0 -0
  121. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/telemetry/telemetry.py +0 -0
  122. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/utils/__init__.py +0 -0
  123. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/utils/bulk_utils.py +0 -0
  124. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/utils/datetime_utils.py +0 -0
  125. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/utils/maintenance/__init__.py +0 -0
  126. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/utils/maintenance/community_operations.py +0 -0
  127. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/utils/maintenance/dedup_helpers.py +0 -0
  128. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/utils/maintenance/edge_operations.py +0 -0
  129. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/utils/maintenance/graph_data_operations.py +0 -0
  130. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/utils/maintenance/temporal_operations.py +0 -0
  131. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/utils/maintenance/utils.py +0 -0
  132. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/graphiti_core/utils/ontology_utils/entity_types_utils.py +0 -0
  133. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/images/arxiv-screenshot.png +0 -0
  134. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/images/graphiti-graph-intro.gif +0 -0
  135. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/images/graphiti-intro-slides-stock-2.gif +0 -0
  136. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/images/simple_graph.svg +0 -0
  137. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/mcp_server/.env.example +0 -0
  138. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/mcp_server/.python-version +0 -0
  139. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/mcp_server/Dockerfile +0 -0
  140. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/mcp_server/README.md +0 -0
  141. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/mcp_server/cursor_rules.md +0 -0
  142. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/mcp_server/docker-compose.yml +0 -0
  143. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/mcp_server/graphiti_mcp_server.py +0 -0
  144. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/mcp_server/mcp_config_sse_example.json +0 -0
  145. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/mcp_server/mcp_config_stdio_example.json +0 -0
  146. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/mcp_server/pyproject.toml +0 -0
  147. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/mcp_server/uv.lock +0 -0
  148. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/py.typed +0 -0
  149. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/pytest.ini +0 -0
  150. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/.env.example +0 -0
  151. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/Makefile +0 -0
  152. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/README.md +0 -0
  153. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/graph_service/__init__.py +0 -0
  154. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/graph_service/config.py +0 -0
  155. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/graph_service/dto/__init__.py +0 -0
  156. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/graph_service/dto/common.py +0 -0
  157. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/graph_service/dto/ingest.py +0 -0
  158. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/graph_service/dto/retrieve.py +0 -0
  159. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/graph_service/main.py +0 -0
  160. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/graph_service/routers/__init__.py +0 -0
  161. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/graph_service/routers/ingest.py +0 -0
  162. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/graph_service/routers/retrieve.py +0 -0
  163. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/graph_service/zep_graphiti.py +0 -0
  164. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/pyproject.toml +0 -0
  165. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/server/uv.lock +0 -0
  166. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/signatures/version1/cla.json +0 -0
  167. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/cross_encoder/test_bge_reranker_client.py +0 -0
  168. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/cross_encoder/test_gemini_reranker_client.py +0 -0
  169. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/driver/__init__.py +0 -0
  170. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/driver/test_falkordb_driver.py +0 -0
  171. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/embedder/embedder_fixtures.py +0 -0
  172. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/embedder/test_gemini.py +0 -0
  173. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/embedder/test_openai.py +0 -0
  174. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/embedder/test_voyage.py +0 -0
  175. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/evals/data/longmemeval_data/README.md +0 -0
  176. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/evals/data/longmemeval_data/longmemeval_oracle.json +0 -0
  177. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/evals/eval_cli.py +0 -0
  178. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/evals/eval_e2e_graph_building.py +0 -0
  179. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/evals/pytest.ini +0 -0
  180. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/evals/utils.py +0 -0
  181. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/helpers_test.py +0 -0
  182. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/llm_client/test_anthropic_client.py +0 -0
  183. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/llm_client/test_anthropic_client_int.py +0 -0
  184. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/llm_client/test_client.py +0 -0
  185. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/llm_client/test_errors.py +0 -0
  186. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/llm_client/test_gemini_client.py +0 -0
  187. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/test_edge_int.py +0 -0
  188. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/test_entity_exclusion_int.py +0 -0
  189. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/test_graphiti_int.py +0 -0
  190. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/test_graphiti_mock.py +0 -0
  191. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/test_node_int.py +0 -0
  192. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/utils/maintenance/test_bulk_utils.py +0 -0
  193. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/utils/maintenance/test_edge_operations.py +0 -0
  194. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/utils/maintenance/test_node_operations.py +0 -0
  195. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/tests/utils/maintenance/test_temporal_operations_int.py +0 -0
  196. {graphiti_core-0.22.0rc1 → graphiti_core-0.22.0rc3}/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.22.0rc1
3
+ Version: 0.22.0rc3
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
@@ -18,49 +18,48 @@ from typing import Any, Protocol, TypedDict
18
18
 
19
19
  from pydantic import BaseModel, Field
20
20
 
21
+ from graphiti_core.utils.text_utils import MAX_SUMMARY_CHARS
22
+
21
23
  from .models import Message, PromptFunction, PromptVersion
22
24
  from .prompt_helpers import to_prompt_json
25
+ from .snippets import summary_instructions
23
26
 
24
27
 
25
28
  class ExtractedEntity(BaseModel):
26
- name: str = Field(..., description="Name of the extracted entity")
29
+ name: str = Field(..., description='Name of the extracted entity')
27
30
  entity_type_id: int = Field(
28
- description="ID of the classified entity type. "
29
- "Must be one of the provided entity_type_id integers.",
31
+ description='ID of the classified entity type. '
32
+ 'Must be one of the provided entity_type_id integers.',
30
33
  )
31
34
 
32
35
 
33
36
  class ExtractedEntities(BaseModel):
34
- extracted_entities: list[ExtractedEntity] = Field(
35
- ..., description="List of extracted entities"
36
- )
37
+ extracted_entities: list[ExtractedEntity] = Field(..., description='List of extracted entities')
37
38
 
38
39
 
39
40
  class MissedEntities(BaseModel):
40
- missed_entities: list[str] = Field(
41
- ..., description="Names of entities that weren't extracted"
42
- )
41
+ missed_entities: list[str] = Field(..., description="Names of entities that weren't extracted")
43
42
 
44
43
 
45
44
  class EntityClassificationTriple(BaseModel):
46
- uuid: str = Field(description="UUID of the entity")
47
- name: str = Field(description="Name of the entity")
45
+ uuid: str = Field(description='UUID of the entity')
46
+ name: str = Field(description='Name of the entity')
48
47
  entity_type: str | None = Field(
49
48
  default=None,
50
- description="Type of the entity. Must be one of the provided types or None",
49
+ description='Type of the entity. Must be one of the provided types or None',
51
50
  )
52
51
 
53
52
 
54
53
  class EntityClassification(BaseModel):
55
54
  entity_classifications: list[EntityClassificationTriple] = Field(
56
- ..., description="List of entities classification triples."
55
+ ..., description='List of entities classification triples.'
57
56
  )
58
57
 
59
58
 
60
59
  class EntitySummary(BaseModel):
61
60
  summary: str = Field(
62
61
  ...,
63
- description="Summary containing the important information about the entity. Under 8 sentences.",
62
+ description=f'Summary containing the important information about the entity. Under {MAX_SUMMARY_CHARS} characters.',
64
63
  )
65
64
 
66
65
 
@@ -128,8 +127,8 @@ reference entities. Only extract distinct entities from the CURRENT MESSAGE. Don
128
127
  {context['custom_prompt']}
129
128
  """
130
129
  return [
131
- Message(role="system", content=sys_prompt),
132
- Message(role="user", content=user_prompt),
130
+ Message(role='system', content=sys_prompt),
131
+ Message(role='user', content=user_prompt),
133
132
  ]
134
133
 
135
134
 
@@ -161,8 +160,8 @@ Guidelines:
161
160
  3. Do NOT extract any properties that contain dates
162
161
  """
163
162
  return [
164
- Message(role="system", content=sys_prompt),
165
- Message(role="user", content=user_prompt),
163
+ Message(role='system', content=sys_prompt),
164
+ Message(role='user', content=user_prompt),
166
165
  ]
167
166
 
168
167
 
@@ -192,8 +191,8 @@ Guidelines:
192
191
  4. Be as explicit as possible in your node names, using full names and avoiding abbreviations.
193
192
  """
194
193
  return [
195
- Message(role="system", content=sys_prompt),
196
- Message(role="user", content=user_prompt),
194
+ Message(role='system', content=sys_prompt),
195
+ Message(role='user', content=user_prompt),
197
196
  ]
198
197
 
199
198
 
@@ -216,8 +215,8 @@ Given the above previous messages, current message, and list of extracted entiti
216
215
  extracted.
217
216
  """
218
217
  return [
219
- Message(role="system", content=sys_prompt),
220
- Message(role="user", content=user_prompt),
218
+ Message(role='system', content=sys_prompt),
219
+ Message(role='user', content=user_prompt),
221
220
  ]
222
221
 
223
222
 
@@ -248,32 +247,31 @@ def classify_nodes(context: dict[str, Any]) -> list[Message]:
248
247
  3. If none of the provided entity types accurately classify an extracted node, the type should be set to None
249
248
  """
250
249
  return [
251
- Message(role="system", content=sys_prompt),
252
- Message(role="user", content=user_prompt),
250
+ Message(role='system', content=sys_prompt),
251
+ Message(role='user', content=user_prompt),
253
252
  ]
254
253
 
255
254
 
256
255
  def extract_attributes(context: dict[str, Any]) -> list[Message]:
257
256
  return [
258
257
  Message(
259
- role="system",
260
- content="You are a helpful assistant that extracts entity properties from the provided text.",
258
+ role='system',
259
+ content='You are a helpful assistant that extracts entity properties from the provided text.',
261
260
  ),
262
261
  Message(
263
- role="user",
262
+ role='user',
264
263
  content=f"""
265
-
266
- <MESSAGES>
267
- {to_prompt_json(context['previous_episodes'], indent=2)}
268
- {to_prompt_json(context['episode_content'], indent=2)}
269
- </MESSAGES>
270
-
271
- Given the above MESSAGES and the following ENTITY, update any of its attributes based on the information provided
264
+ Given the MESSAGES and the following ENTITY, update any of its attributes based on the information provided
272
265
  in MESSAGES. Use the provided attribute descriptions to better understand how each attribute should be determined.
273
266
 
274
267
  Guidelines:
275
268
  1. Do not hallucinate entity property values if they cannot be found in the current context.
276
269
  2. Only use the provided MESSAGES and ENTITY to set attribute values.
270
+
271
+ <MESSAGES>
272
+ {to_prompt_json(context['previous_episodes'], indent=2)}
273
+ {to_prompt_json(context['episode_content'], indent=2)}
274
+ </MESSAGES>
277
275
 
278
276
  <ENTITY>
279
277
  {context['node']}
@@ -286,27 +284,22 @@ def extract_attributes(context: dict[str, Any]) -> list[Message]:
286
284
  def extract_summary(context: dict[str, Any]) -> list[Message]:
287
285
  return [
288
286
  Message(
289
- role="system",
290
- content="You are a helpful assistant that extracts entity summaries from the provided text.",
287
+ role='system',
288
+ content='You are a helpful assistant that extracts entity summaries from the provided text.',
291
289
  ),
292
290
  Message(
293
- role="user",
291
+ role='user',
294
292
  content=f"""
293
+ Given the MESSAGES and the ENTITY, update the summary that combines relevant information about the entity
294
+ from the messages and relevant information from the existing summary.
295
+
296
+ {summary_instructions}
295
297
 
296
298
  <MESSAGES>
297
299
  {to_prompt_json(context['previous_episodes'], indent=2)}
298
300
  {to_prompt_json(context['episode_content'], indent=2)}
299
301
  </MESSAGES>
300
302
 
301
- Given the above MESSAGES and the following ENTITY, update the summary that combines relevant information about the entity
302
- from the messages and relevant information from the existing summary.
303
-
304
- Guidelines:
305
- 1. Do not hallucinate entity summary information if they cannot be found in the current context.
306
- 2. Only use the provided MESSAGES and ENTITY to set attribute values.
307
- 3. The summary attribute represents a summary of the ENTITY, and should be updated with new information about the Entity from the MESSAGES.
308
- 4. Keep the summary concise and to the point. SUMMARIES MUST BE LESS THAN 8 SENTENCES.
309
-
310
303
  <ENTITY>
311
304
  {context['node']}
312
305
  </ENTITY>
@@ -316,11 +309,11 @@ def extract_summary(context: dict[str, Any]) -> list[Message]:
316
309
 
317
310
 
318
311
  versions: Versions = {
319
- "extract_message": extract_message,
320
- "extract_json": extract_json,
321
- "extract_text": extract_text,
322
- "reflexion": reflexion,
323
- "extract_summary": extract_summary,
324
- "classify_nodes": classify_nodes,
325
- "extract_attributes": extract_attributes,
312
+ 'extract_message': extract_message,
313
+ 'extract_json': extract_json,
314
+ 'extract_text': extract_text,
315
+ 'reflexion': reflexion,
316
+ 'extract_summary': extract_summary,
317
+ 'classify_nodes': classify_nodes,
318
+ 'extract_attributes': extract_attributes,
326
319
  }
@@ -1,3 +1,19 @@
1
+ """
2
+ Copyright 2024, Zep Software, Inc.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ """
16
+
1
17
  import json
2
18
  from typing import Any
3
19
 
@@ -0,0 +1,29 @@
1
+ """
2
+ Copyright 2024, Zep Software, Inc.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ """
16
+
17
+ summary_instructions = """Guidelines:
18
+ 1. Output only factual content. Never explain what you're doing, why, or mention limitations/constraints.
19
+ 2. Only use the provided messages, entity, and entity context to set attribute values.
20
+ 3. Keep the summary concise and to the point. STATE FACTS DIRECTLY IN UNDER 250 CHARACTERS.
21
+
22
+ Example summaries:
23
+ BAD: "This is the only activity in the context. The user listened to this song. No other details were provided to include in this summary."
24
+ GOOD: "User played 'Blue Monday' by New Order (electronic genre) on 2024-12-03 at 14:22 UTC."
25
+ BAD: "Based on the messages provided, the user attended a meeting. This summary focuses on that event as it was the main topic discussed."
26
+ GOOD: "User attended Q3 planning meeting with sales team on March 15."
27
+ BAD: "The context shows John ordered pizza. Due to length constraints, other details are omitted from this summary."
28
+ GOOD: "John ordered pepperoni pizza from Mario's at 7:30 PM, delivered to office."
29
+ """
@@ -20,19 +20,18 @@ from pydantic import BaseModel, Field
20
20
 
21
21
  from .models import Message, PromptFunction, PromptVersion
22
22
  from .prompt_helpers import to_prompt_json
23
+ from .snippets import summary_instructions
23
24
 
24
25
 
25
26
  class Summary(BaseModel):
26
27
  summary: str = Field(
27
28
  ...,
28
- description="Summary containing the important information about the entity. Under 8 sentences",
29
+ description='Summary containing the important information about the entity. Under 250 characters',
29
30
  )
30
31
 
31
32
 
32
33
  class SummaryDescription(BaseModel):
33
- description: str = Field(
34
- ..., description="One sentence description of the provided summary"
35
- )
34
+ description: str = Field(..., description='One sentence description of the provided summary')
36
35
 
37
36
 
38
37
  class Prompt(Protocol):
@@ -50,15 +49,15 @@ class Versions(TypedDict):
50
49
  def summarize_pair(context: dict[str, Any]) -> list[Message]:
51
50
  return [
52
51
  Message(
53
- role="system",
54
- content="You are a helpful assistant that combines summaries.",
52
+ role='system',
53
+ content='You are a helpful assistant that combines summaries.',
55
54
  ),
56
55
  Message(
57
- role="user",
56
+ role='user',
58
57
  content=f"""
59
58
  Synthesize the information from the following two summaries into a single succinct summary.
60
59
 
61
- IMPORTANT: Keep the summary concise and to the point. SUMMARIES MUST BE LESS THAN 8 SENTENCES.
60
+ IMPORTANT: Keep the summary concise and to the point. SUMMARIES MUST BE LESS THAN 250 CHARACTERS.
62
61
 
63
62
  Summaries:
64
63
  {to_prompt_json(context['node_summaries'], indent=2)}
@@ -70,29 +69,25 @@ def summarize_pair(context: dict[str, Any]) -> list[Message]:
70
69
  def summarize_context(context: dict[str, Any]) -> list[Message]:
71
70
  return [
72
71
  Message(
73
- role="system",
74
- content="You are a helpful assistant that generates a summary and attributes from provided text.",
72
+ role='system',
73
+ content='You are a helpful assistant that generates a summary and attributes from provided text.',
75
74
  ),
76
75
  Message(
77
- role="user",
76
+ role='user',
78
77
  content=f"""
79
-
80
- <MESSAGES>
81
- {to_prompt_json(context['previous_episodes'], indent=2)}
82
- {to_prompt_json(context['episode_content'], indent=2)}
83
- </MESSAGES>
84
-
85
- Given the above MESSAGES and the following ENTITY name, create a summary for the ENTITY. Your summary must only use
78
+ Given the MESSAGES and the ENTITY name, create a summary for the ENTITY. Your summary must only use
86
79
  information from the provided MESSAGES. Your summary should also only contain information relevant to the
87
80
  provided ENTITY.
88
81
 
89
82
  In addition, extract any values for the provided entity properties based on their descriptions.
90
83
  If the value of the entity property cannot be found in the current context, set the value of the property to the Python value None.
91
84
 
92
- Guidelines:
93
- 1. Do not hallucinate entity property values if they cannot be found in the current context.
94
- 2. Only use the provided messages, entity, and entity context to set attribute values.
95
- 3. Keep the summary concise and to the point. SUMMARIES MUST BE LESS THAN 8 SENTENCES.
85
+ {summary_instructions}
86
+
87
+ <MESSAGES>
88
+ {to_prompt_json(context['previous_episodes'], indent=2)}
89
+ {to_prompt_json(context['episode_content'], indent=2)}
90
+ </MESSAGES>
96
91
 
97
92
  <ENTITY>
98
93
  {context['node_name']}
@@ -113,14 +108,14 @@ def summarize_context(context: dict[str, Any]) -> list[Message]:
113
108
  def summary_description(context: dict[str, Any]) -> list[Message]:
114
109
  return [
115
110
  Message(
116
- role="system",
117
- content="You are a helpful assistant that describes provided contents in a single sentence.",
111
+ role='system',
112
+ content='You are a helpful assistant that describes provided contents in a single sentence.',
118
113
  ),
119
114
  Message(
120
- role="user",
115
+ role='user',
121
116
  content=f"""
122
117
  Create a short one sentence description of the summary that explains what kind of information is summarized.
123
- Summaries must be under 8 sentences.
118
+ Summaries must be under 250 characters.
124
119
 
125
120
  Summary:
126
121
  {to_prompt_json(context['summary'], indent=2)}
@@ -130,7 +125,7 @@ def summary_description(context: dict[str, Any]) -> list[Message]:
130
125
 
131
126
 
132
127
  versions: Versions = {
133
- "summarize_pair": summarize_pair,
134
- "summarize_context": summarize_context,
135
- "summary_description": summary_description,
128
+ 'summarize_pair': summarize_pair,
129
+ 'summarize_context': summarize_context,
130
+ 'summary_description': summary_description,
136
131
  }
@@ -53,6 +53,7 @@ from graphiti_core.utils.maintenance.dedup_helpers import (
53
53
  from graphiti_core.utils.maintenance.edge_operations import (
54
54
  filter_existing_duplicate_of_edges,
55
55
  )
56
+ from graphiti_core.utils.text_utils import MAX_SUMMARY_CHARS, truncate_at_sentence
56
57
 
57
58
  logger = logging.getLogger(__name__)
58
59
 
@@ -547,7 +548,7 @@ async def _extract_entity_summary(
547
548
  summary_context = _build_episode_context(
548
549
  node_data={
549
550
  'name': node.name,
550
- 'summary': node.summary,
551
+ 'summary': truncate_at_sentence(node.summary, MAX_SUMMARY_CHARS),
551
552
  'entity_types': node.labels,
552
553
  'attributes': node.attributes,
553
554
  },
@@ -562,7 +563,7 @@ async def _extract_entity_summary(
562
563
  group_id=node.group_id,
563
564
  )
564
565
 
565
- node.summary = summary_response.get('summary', '')
566
+ node.summary = truncate_at_sentence(summary_response.get('summary', ''), MAX_SUMMARY_CHARS)
566
567
 
567
568
 
568
569
  def _build_episode_context(
@@ -0,0 +1,53 @@
1
+ """
2
+ Copyright 2024, Zep Software, Inc.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ """
16
+
17
+ import re
18
+
19
+ # Maximum length for entity/node summaries
20
+ MAX_SUMMARY_CHARS = 250
21
+
22
+
23
+ def truncate_at_sentence(text: str, max_chars: int) -> str:
24
+ """
25
+ Truncate text at or about max_chars while respecting sentence boundaries.
26
+
27
+ Attempts to truncate at the last complete sentence before max_chars.
28
+ If no sentence boundary is found before max_chars, truncates at max_chars.
29
+
30
+ Args:
31
+ text: The text to truncate
32
+ max_chars: Maximum number of characters
33
+
34
+ Returns:
35
+ Truncated text
36
+ """
37
+ if not text or len(text) <= max_chars:
38
+ return text
39
+
40
+ # Find all sentence boundaries (., !, ?) up to max_chars
41
+ truncated = text[:max_chars]
42
+
43
+ # Look for sentence boundaries: period, exclamation, or question mark followed by space or end
44
+ sentence_pattern = r'[.!?](?:\s|$)'
45
+ matches = list(re.finditer(sentence_pattern, truncated))
46
+
47
+ if matches:
48
+ # Truncate at the last sentence boundary found
49
+ last_match = matches[-1]
50
+ return text[: last_match.end()].rstrip()
51
+
52
+ # No sentence boundary found, truncate at max_chars
53
+ return truncated.rstrip()
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "graphiti-core"
3
3
  description = "A temporal graph building library"
4
- version = "0.22.0pre1"
4
+ version = "0.22.0pre3"
5
5
  authors = [
6
6
  { name = "Paul Paliychuk", email = "paul@getzep.com" },
7
7
  { name = "Preston Rasmussen", email = "preston@getzep.com" },
@@ -0,0 +1,106 @@
1
+ """
2
+ Copyright 2024, Zep Software, Inc.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ """
16
+
17
+ from graphiti_core.utils.text_utils import MAX_SUMMARY_CHARS, truncate_at_sentence
18
+
19
+
20
+ def test_truncate_at_sentence_short_text():
21
+ """Test that short text is returned unchanged."""
22
+ text = 'This is a short sentence.'
23
+ result = truncate_at_sentence(text, 100)
24
+ assert result == text
25
+
26
+
27
+ def test_truncate_at_sentence_empty():
28
+ """Test that empty text is handled correctly."""
29
+ assert truncate_at_sentence('', 100) == ''
30
+ assert truncate_at_sentence(None, 100) is None
31
+
32
+
33
+ def test_truncate_at_sentence_exact_length():
34
+ """Test text at exactly max_chars."""
35
+ text = 'A' * 100
36
+ result = truncate_at_sentence(text, 100)
37
+ assert result == text
38
+
39
+
40
+ def test_truncate_at_sentence_with_period():
41
+ """Test truncation at sentence boundary with period."""
42
+ text = 'First sentence. Second sentence. Third sentence. Fourth sentence.'
43
+ result = truncate_at_sentence(text, 40)
44
+ assert result == 'First sentence. Second sentence.'
45
+ assert len(result) <= 40
46
+
47
+
48
+ def test_truncate_at_sentence_with_question():
49
+ """Test truncation at sentence boundary with question mark."""
50
+ text = 'What is this? This is a test. More text here.'
51
+ result = truncate_at_sentence(text, 30)
52
+ assert result == 'What is this? This is a test.'
53
+ assert len(result) <= 32
54
+
55
+
56
+ def test_truncate_at_sentence_with_exclamation():
57
+ """Test truncation at sentence boundary with exclamation mark."""
58
+ text = 'Hello world! This is exciting. And more text.'
59
+ result = truncate_at_sentence(text, 30)
60
+ assert result == 'Hello world! This is exciting.'
61
+ assert len(result) <= 32
62
+
63
+
64
+ def test_truncate_at_sentence_no_boundary():
65
+ """Test truncation when no sentence boundary exists before max_chars."""
66
+ text = 'This is a very long sentence without any punctuation marks near the beginning'
67
+ result = truncate_at_sentence(text, 30)
68
+ assert len(result) <= 30
69
+ assert result.startswith('This is a very long sentence')
70
+
71
+
72
+ def test_truncate_at_sentence_multiple_periods():
73
+ """Test with multiple sentence endings."""
74
+ text = 'A. B. C. D. E. F. G. H.'
75
+ result = truncate_at_sentence(text, 10)
76
+ assert result == 'A. B. C.'
77
+ assert len(result) <= 10
78
+
79
+
80
+ def test_truncate_at_sentence_strips_trailing_whitespace():
81
+ """Test that trailing whitespace is stripped."""
82
+ text = 'First sentence. Second sentence.'
83
+ result = truncate_at_sentence(text, 20)
84
+ assert result == 'First sentence.'
85
+ assert not result.endswith(' ')
86
+
87
+
88
+ def test_max_summary_chars_constant():
89
+ """Test that MAX_SUMMARY_CHARS is set to expected value."""
90
+ assert MAX_SUMMARY_CHARS == 250
91
+
92
+
93
+ def test_truncate_at_sentence_realistic_summary():
94
+ """Test with a realistic entity summary."""
95
+ text = (
96
+ 'John is a software engineer who works at a tech company in San Francisco. '
97
+ 'He has been programming for over 10 years and specializes in Python and distributed systems. '
98
+ 'John enjoys hiking on weekends and is learning to play guitar. '
99
+ 'He graduated from MIT with a degree in computer science.'
100
+ )
101
+ result = truncate_at_sentence(text, MAX_SUMMARY_CHARS)
102
+ assert len(result) <= MAX_SUMMARY_CHARS
103
+ # Should keep complete sentences
104
+ assert result.endswith('.')
105
+ # Should include at least the first sentence
106
+ assert 'John is a software engineer' in result
@@ -783,7 +783,7 @@ wheels = [
783
783
 
784
784
  [[package]]
785
785
  name = "graphiti-core"
786
- version = "0.22.0rc1"
786
+ version = "0.22.0rc3"
787
787
  source = { editable = "." }
788
788
  dependencies = [
789
789
  { name = "diskcache" },