graphiti-core 0.13.2__tar.gz → 0.14.0__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 (171) hide show
  1. graphiti_core-0.14.0/.env.example +20 -0
  2. graphiti_core-0.14.0/.github/dependabot.yml +19 -0
  3. graphiti_core-0.14.0/.github/secret_scanning.yml +11 -0
  4. graphiti_core-0.14.0/.github/workflows/cla.yml +42 -0
  5. graphiti_core-0.14.0/.github/workflows/codeql.yml +100 -0
  6. graphiti_core-0.14.0/.github/workflows/lint.yml +24 -0
  7. graphiti_core-0.14.0/.github/workflows/release-graphiti-core.yml +37 -0
  8. graphiti_core-0.14.0/.github/workflows/typecheck.yml +47 -0
  9. graphiti_core-0.14.0/.github/workflows/unit_tests.yml +30 -0
  10. graphiti_core-0.14.0/.gitignore +168 -0
  11. graphiti_core-0.14.0/CLAUDE.md +133 -0
  12. graphiti_core-0.14.0/CODE_OF_CONDUCT.md +128 -0
  13. graphiti_core-0.14.0/CONTRIBUTING.md +134 -0
  14. graphiti_core-0.14.0/Dockerfile +87 -0
  15. graphiti_core-0.14.0/Makefile +32 -0
  16. graphiti_core-0.13.2/README.md → graphiti_core-0.14.0/PKG-INFO +133 -7
  17. graphiti_core-0.13.2/PKG-INFO → graphiti_core-0.14.0/README.md +86 -41
  18. graphiti_core-0.14.0/SECURITY.md +15 -0
  19. graphiti_core-0.14.0/Zep-CLA.md +41 -0
  20. graphiti_core-0.14.0/conftest.py +6 -0
  21. graphiti_core-0.14.0/depot.json +1 -0
  22. graphiti_core-0.14.0/docker-compose.test.yml +39 -0
  23. graphiti_core-0.14.0/docker-compose.yml +48 -0
  24. graphiti_core-0.14.0/ellipsis.yaml +20 -0
  25. graphiti_core-0.14.0/examples/data/manybirds_products.json +1226 -0
  26. graphiti_core-0.14.0/examples/ecommerce/runner.ipynb +1948 -0
  27. graphiti_core-0.14.0/examples/ecommerce/runner.py +123 -0
  28. graphiti_core-0.14.0/examples/langgraph-agent/agent.ipynb +575 -0
  29. graphiti_core-0.14.0/examples/langgraph-agent/tinybirds-jess.png +0 -0
  30. graphiti_core-0.14.0/examples/podcast/podcast_runner.py +95 -0
  31. graphiti_core-0.14.0/examples/podcast/podcast_transcript.txt +419 -0
  32. graphiti_core-0.14.0/examples/podcast/transcript_parser.py +124 -0
  33. graphiti_core-0.14.0/examples/quickstart/README.md +94 -0
  34. graphiti_core-0.14.0/examples/quickstart/quickstart_falkordb.py +244 -0
  35. graphiti_core-0.14.0/examples/quickstart/quickstart_neo4j.py +242 -0
  36. graphiti_core-0.14.0/examples/quickstart/requirements.txt +2 -0
  37. graphiti_core-0.14.0/examples/wizard_of_oz/parser.py +36 -0
  38. graphiti_core-0.14.0/examples/wizard_of_oz/runner.py +93 -0
  39. graphiti_core-0.14.0/examples/wizard_of_oz/woo.txt +4671 -0
  40. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/graphiti.py +72 -3
  41. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/helpers.py +35 -0
  42. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/nodes.py +2 -0
  43. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/search/search_utils.py +1 -1
  44. graphiti_core-0.14.0/graphiti_core/telemetry/__init__.py +9 -0
  45. graphiti_core-0.14.0/graphiti_core/telemetry/telemetry.py +117 -0
  46. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/utils/bulk_utils.py +5 -2
  47. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/utils/maintenance/node_operations.py +6 -0
  48. graphiti_core-0.14.0/images/arxiv-screenshot.png +0 -0
  49. graphiti_core-0.14.0/images/graphiti-graph-intro.gif +0 -0
  50. graphiti_core-0.14.0/images/graphiti-intro-slides-stock-2.gif +0 -0
  51. graphiti_core-0.14.0/images/simple_graph.svg +130 -0
  52. graphiti_core-0.14.0/mcp_server/.env.example +35 -0
  53. graphiti_core-0.14.0/mcp_server/.python-version +1 -0
  54. graphiti_core-0.14.0/mcp_server/Dockerfile +49 -0
  55. graphiti_core-0.14.0/mcp_server/README.md +380 -0
  56. graphiti_core-0.14.0/mcp_server/cursor_rules.md +34 -0
  57. graphiti_core-0.14.0/mcp_server/docker-compose.yml +46 -0
  58. graphiti_core-0.14.0/mcp_server/graphiti_mcp_server.py +1251 -0
  59. graphiti_core-0.14.0/mcp_server/mcp_config_sse_example.json +8 -0
  60. graphiti_core-0.14.0/mcp_server/mcp_config_stdio_example.json +21 -0
  61. graphiti_core-0.14.0/mcp_server/pyproject.toml +13 -0
  62. graphiti_core-0.14.0/mcp_server/uv.lock +874 -0
  63. graphiti_core-0.14.0/poetry.lock +5446 -0
  64. graphiti_core-0.14.0/py.typed +0 -0
  65. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/pyproject.toml +32 -30
  66. graphiti_core-0.14.0/pytest.ini +3 -0
  67. graphiti_core-0.14.0/server/.env.example +6 -0
  68. graphiti_core-0.14.0/server/Makefile +32 -0
  69. graphiti_core-0.14.0/server/README.md +58 -0
  70. graphiti_core-0.14.0/server/graph_service/__init__.py +0 -0
  71. graphiti_core-0.14.0/server/graph_service/config.py +26 -0
  72. graphiti_core-0.14.0/server/graph_service/dto/__init__.py +15 -0
  73. graphiti_core-0.14.0/server/graph_service/dto/common.py +28 -0
  74. graphiti_core-0.14.0/server/graph_service/dto/ingest.py +15 -0
  75. graphiti_core-0.14.0/server/graph_service/dto/retrieve.py +45 -0
  76. graphiti_core-0.14.0/server/graph_service/main.py +29 -0
  77. graphiti_core-0.14.0/server/graph_service/routers/__init__.py +0 -0
  78. graphiti_core-0.14.0/server/graph_service/routers/ingest.py +111 -0
  79. graphiti_core-0.14.0/server/graph_service/routers/retrieve.py +63 -0
  80. graphiti_core-0.14.0/server/graph_service/zep_graphiti.py +114 -0
  81. graphiti_core-0.14.0/server/pyproject.toml +63 -0
  82. graphiti_core-0.14.0/server/uv.lock +1159 -0
  83. graphiti_core-0.14.0/signatures/version1/cla.json +164 -0
  84. graphiti_core-0.14.0/tests/cross_encoder/test_bge_reranker_client.py +83 -0
  85. graphiti_core-0.14.0/tests/embedder/embedder_fixtures.py +20 -0
  86. graphiti_core-0.14.0/tests/embedder/test_gemini.py +127 -0
  87. graphiti_core-0.14.0/tests/embedder/test_openai.py +126 -0
  88. graphiti_core-0.14.0/tests/embedder/test_voyage.py +142 -0
  89. graphiti_core-0.14.0/tests/evals/data/longmemeval_data/README.md +3 -0
  90. graphiti_core-0.14.0/tests/evals/data/longmemeval_data/longmemeval_oracle.json +67042 -0
  91. graphiti_core-0.14.0/tests/evals/eval_cli.py +40 -0
  92. graphiti_core-0.14.0/tests/evals/eval_e2e_graph_building.py +180 -0
  93. graphiti_core-0.14.0/tests/evals/pytest.ini +4 -0
  94. graphiti_core-0.14.0/tests/evals/utils.py +39 -0
  95. graphiti_core-0.14.0/tests/helpers_test.py +38 -0
  96. graphiti_core-0.14.0/tests/llm_client/test_anthropic_client.py +255 -0
  97. graphiti_core-0.14.0/tests/llm_client/test_anthropic_client_int.py +85 -0
  98. graphiti_core-0.14.0/tests/llm_client/test_client.py +57 -0
  99. graphiti_core-0.14.0/tests/llm_client/test_errors.py +76 -0
  100. graphiti_core-0.14.0/tests/test_entity_exclusion_int.py +331 -0
  101. graphiti_core-0.14.0/tests/test_graphiti_int.py +141 -0
  102. graphiti_core-0.14.0/tests/test_node_int.py +122 -0
  103. graphiti_core-0.14.0/tests/utils/maintenance/test_edge_operations.py +94 -0
  104. graphiti_core-0.14.0/tests/utils/maintenance/test_temporal_operations_int.py +269 -0
  105. graphiti_core-0.14.0/tests/utils/search/search_utils_test.py +163 -0
  106. graphiti_core-0.14.0/uv.lock +3930 -0
  107. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/LICENSE +0 -0
  108. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/__init__.py +0 -0
  109. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/cross_encoder/__init__.py +0 -0
  110. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/cross_encoder/bge_reranker_client.py +0 -0
  111. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/cross_encoder/client.py +0 -0
  112. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/cross_encoder/openai_reranker_client.py +0 -0
  113. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/driver/__init__.py +0 -0
  114. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/driver/driver.py +0 -0
  115. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/driver/falkordb_driver.py +0 -0
  116. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/driver/neo4j_driver.py +0 -0
  117. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/edges.py +0 -0
  118. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/embedder/__init__.py +0 -0
  119. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/embedder/azure_openai.py +0 -0
  120. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/embedder/client.py +0 -0
  121. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/embedder/gemini.py +0 -0
  122. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/embedder/openai.py +0 -0
  123. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/embedder/voyage.py +0 -0
  124. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/errors.py +0 -0
  125. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/graph_queries.py +0 -0
  126. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/graphiti_types.py +0 -0
  127. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/llm_client/__init__.py +0 -0
  128. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/llm_client/anthropic_client.py +0 -0
  129. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/llm_client/azure_openai_client.py +0 -0
  130. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/llm_client/client.py +0 -0
  131. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/llm_client/config.py +0 -0
  132. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/llm_client/errors.py +0 -0
  133. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/llm_client/gemini_client.py +0 -0
  134. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/llm_client/groq_client.py +0 -0
  135. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/llm_client/openai_base_client.py +0 -0
  136. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/llm_client/openai_client.py +0 -0
  137. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/llm_client/openai_generic_client.py +0 -0
  138. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/llm_client/utils.py +0 -0
  139. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/models/__init__.py +0 -0
  140. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/models/edges/__init__.py +0 -0
  141. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/models/edges/edge_db_queries.py +0 -0
  142. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/models/nodes/__init__.py +0 -0
  143. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/models/nodes/node_db_queries.py +0 -0
  144. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/prompts/__init__.py +0 -0
  145. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/prompts/dedupe_edges.py +0 -0
  146. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/prompts/dedupe_nodes.py +0 -0
  147. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/prompts/eval.py +0 -0
  148. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/prompts/extract_edge_dates.py +0 -0
  149. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/prompts/extract_edges.py +0 -0
  150. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/prompts/extract_nodes.py +0 -0
  151. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/prompts/invalidate_edges.py +0 -0
  152. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/prompts/lib.py +0 -0
  153. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/prompts/models.py +0 -0
  154. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/prompts/prompt_helpers.py +0 -0
  155. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/prompts/summarize_nodes.py +0 -0
  156. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/py.typed +0 -0
  157. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/search/__init__.py +0 -0
  158. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/search/search.py +0 -0
  159. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/search/search_config.py +0 -0
  160. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/search/search_config_recipes.py +0 -0
  161. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/search/search_filters.py +0 -0
  162. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/search/search_helpers.py +0 -0
  163. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/utils/__init__.py +0 -0
  164. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/utils/datetime_utils.py +0 -0
  165. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/utils/maintenance/__init__.py +0 -0
  166. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/utils/maintenance/community_operations.py +0 -0
  167. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/utils/maintenance/edge_operations.py +0 -0
  168. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/utils/maintenance/graph_data_operations.py +0 -0
  169. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/utils/maintenance/temporal_operations.py +0 -0
  170. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/utils/maintenance/utils.py +0 -0
  171. {graphiti_core-0.13.2 → graphiti_core-0.14.0}/graphiti_core/utils/ontology_utils/entity_types_utils.py +0 -0
@@ -0,0 +1,20 @@
1
+ OPENAI_API_KEY=
2
+
3
+ # Neo4j database connection
4
+ NEO4J_URI=
5
+ NEO4J_PORT=
6
+ NEO4J_USER=
7
+ NEO4J_PASSWORD=
8
+
9
+ # FalkorDB database connection
10
+ FALKORDB_URI=
11
+ FALKORDB_PORT=
12
+ FALKORDB_USER=
13
+ FALKORDB_PASSWORD=
14
+
15
+ DEFAULT_DATABASE=
16
+ USE_PARALLEL_RUNTIME=
17
+ SEMAPHORE_LIMIT=
18
+ GITHUB_SHA=
19
+ MAX_REFLEXION_ITERATIONS=
20
+ ANTHROPIC_API_KEY=
@@ -0,0 +1,19 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "pip" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "weekly"
12
+ - package-ecosystem: "pip"
13
+ directory: "/server" # Location of server package manifests
14
+ schedule:
15
+ interval: "weekly"
16
+ - package-ecosystem: "pip"
17
+ directory: "/mcp_server" # Location of server package manifests
18
+ schedule:
19
+ interval: "weekly"
@@ -0,0 +1,11 @@
1
+ # Secret scanning configuration
2
+ # This file excludes specific files/directories from secret scanning alerts
3
+
4
+ paths-ignore:
5
+ # PostHog public API key for anonymous telemetry
6
+ # This is a public key intended for client-side use and safe to commit
7
+ # Key: phc_UG6EcfDbuXz92neb3rMlQFDY0csxgMqRcIPWESqnSmo
8
+ - "graphiti_core/telemetry/telemetry.py"
9
+
10
+ # Example/test directories that may contain dummy credentials
11
+ - "tests/**/fixtures/**"
@@ -0,0 +1,42 @@
1
+ name: "CLA Assistant"
2
+ on:
3
+ issue_comment:
4
+ types: [created]
5
+ pull_request_target:
6
+ types: [opened, closed, synchronize]
7
+
8
+ # explicitly configure permissions, in case your GITHUB_TOKEN workflow permissions are set to read-only in repository settings
9
+ permissions:
10
+ actions: write
11
+ contents: write # this can be 'read' if the signatures are in remote repository
12
+ pull-requests: write
13
+ statuses: write
14
+
15
+ jobs:
16
+ CLAAssistant:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - name: "CLA Assistant"
20
+ if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
21
+ uses: contributor-assistant/github-action@v2.6.1
22
+ env:
23
+ # the default github token does not have branch protection override permissions
24
+ # the repo secrets will need to be updated when the token expires.
25
+ GITHUB_TOKEN: ${{ secrets.DANIEL_PAT }}
26
+ with:
27
+ path-to-signatures: "signatures/version1/cla.json"
28
+ path-to-document: "https://github.com/getzep/graphiti/blob/main/Zep-CLA.md" # e.g. a CLA or a DCO document
29
+ # branch should not be protected unless a personal PAT is used
30
+ branch: "main"
31
+ allowlist: paul-paliychuk,prasmussen15,danielchalef,dependabot[bot],ellipsis-dev
32
+
33
+ # the followings are the optional inputs - If the optional inputs are not given, then default values will be taken
34
+ #remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
35
+ #remote-repository-name: enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository)
36
+ #create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
37
+ #signed-commit-message: 'For example: $contributorName has signed the CLA in $owner/$repo#$pullRequestNo'
38
+ #custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
39
+ #custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
40
+ #custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
41
+ #lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
42
+ #use-dco-flag: true - If you are using DCO instead of CLA
@@ -0,0 +1,100 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL Advanced"
13
+
14
+ on:
15
+ push:
16
+ branches: [ "main" ]
17
+ pull_request:
18
+ branches: [ "main" ]
19
+ schedule:
20
+ - cron: '43 1 * * 6'
21
+
22
+ jobs:
23
+ analyze:
24
+ name: Analyze (${{ matrix.language }})
25
+ # Runner size impacts CodeQL analysis time. To learn more, please see:
26
+ # - https://gh.io/recommended-hardware-resources-for-running-codeql
27
+ # - https://gh.io/supported-runners-and-hardware-resources
28
+ # - https://gh.io/using-larger-runners (GitHub.com only)
29
+ # Consider using larger runners or machines with greater resources for possible analysis time improvements.
30
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31
+ permissions:
32
+ # required for all workflows
33
+ security-events: write
34
+
35
+ # required to fetch internal or private CodeQL packs
36
+ packages: read
37
+
38
+ # only required for workflows in private repositories
39
+ actions: read
40
+ contents: read
41
+
42
+ strategy:
43
+ fail-fast: false
44
+ matrix:
45
+ include:
46
+ - language: actions
47
+ build-mode: none
48
+ - language: python
49
+ build-mode: none
50
+ # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
51
+ # Use `c-cpp` to analyze code written in C, C++ or both
52
+ # Use 'java-kotlin' to analyze code written in Java, Kotlin or both
53
+ # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
54
+ # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
55
+ # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
56
+ # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
57
+ # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
58
+ steps:
59
+ - name: Checkout repository
60
+ uses: actions/checkout@v4
61
+
62
+ # Add any setup steps before running the `github/codeql-action/init` action.
63
+ # This includes steps like installing compilers or runtimes (`actions/setup-node`
64
+ # or others). This is typically only required for manual builds.
65
+ # - name: Setup runtime (example)
66
+ # uses: actions/setup-example@v1
67
+
68
+ # Initializes the CodeQL tools for scanning.
69
+ - name: Initialize CodeQL
70
+ uses: github/codeql-action/init@v3
71
+ with:
72
+ languages: ${{ matrix.language }}
73
+ build-mode: ${{ matrix.build-mode }}
74
+ # If you wish to specify custom queries, you can do so here or in a config file.
75
+ # By default, queries listed here will override any specified in a config file.
76
+ # Prefix the list here with "+" to use these queries and those in the config file.
77
+
78
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
79
+ # queries: security-extended,security-and-quality
80
+
81
+ # If the analyze step fails for one of the languages you are analyzing with
82
+ # "We were unable to automatically build your code", modify the matrix above
83
+ # to set the build mode to "manual" for that language. Then modify this step
84
+ # to build your code.
85
+ # ℹ️ Command-line programs to run using the OS shell.
86
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
87
+ - if: matrix.build-mode == 'manual'
88
+ shell: bash
89
+ run: |
90
+ echo 'If you are using a "manual" build mode for one or more of the' \
91
+ 'languages you are analyzing, replace this with the commands to build' \
92
+ 'your code, for example:'
93
+ echo ' make bootstrap'
94
+ echo ' make release'
95
+ exit 1
96
+
97
+ - name: Perform CodeQL Analysis
98
+ uses: github/codeql-action/analyze@v3
99
+ with:
100
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,24 @@
1
+ name: Lint with Ruff
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ pull_request:
7
+ branches: ["main"]
8
+
9
+ jobs:
10
+ ruff:
11
+ environment: development
12
+ runs-on: depot-ubuntu-22.04
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - name: Set up Python
16
+ uses: actions/setup-python@v5
17
+ with:
18
+ python-version: "3.10"
19
+ - name: Install dependencies
20
+ run: |
21
+ python -m pip install --upgrade pip
22
+ pip install "ruff>0.1.7"
23
+ - name: Run Ruff linting
24
+ run: ruff check --output-format=github
@@ -0,0 +1,37 @@
1
+ name: Release to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*.*.*"]
6
+
7
+ jobs:
8
+ release:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ id-token: write
12
+ contents: write
13
+ environment:
14
+ name: release
15
+ url: https://pypi.org/p/zep-cloud
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - name: Set up Python 3.11
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.11"
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v3
24
+ with:
25
+ version: "latest"
26
+ - name: Compare pyproject version with tag
27
+ run: |
28
+ TAG_VERSION=${GITHUB_REF#refs/tags/}
29
+ PROJECT_VERSION=$(uv run python -c "import tomllib; print('v' + tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
30
+ if [ "$TAG_VERSION" != "$PROJECT_VERSION" ]; then
31
+ echo "Tag version $TAG_VERSION does not match the project version $PROJECT_VERSION"
32
+ exit 1
33
+ fi
34
+ - name: Build project for distribution
35
+ run: uv build
36
+ - name: Publish package distributions to PyPI
37
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,47 @@
1
+ name: MyPy Type Check
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ pull_request:
7
+ branches: ["main"]
8
+
9
+ jobs:
10
+ mypy:
11
+ runs-on: depot-ubuntu-22.04
12
+ environment: development
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - name: Set up Python
16
+ id: setup-python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.10"
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v3
22
+ with:
23
+ version: "latest"
24
+ - name: Install dependencies
25
+ run: uv sync --extra dev
26
+ - name: Run MyPy for graphiti-core
27
+ shell: bash
28
+ run: |
29
+ set -o pipefail
30
+ uv run mypy ./graphiti_core --show-column-numbers --show-error-codes | sed -E '
31
+ s/^(.*):([0-9]+):([0-9]+): (error|warning): (.+) \[(.+)\]/::error file=\1,line=\2,endLine=\2,col=\3,title=\6::\5/;
32
+ s/^(.*):([0-9]+):([0-9]+): note: (.+)/::notice file=\1,line=\2,endLine=\2,col=\3,title=Note::\4/;
33
+ '
34
+ - name: Install graph-service dependencies
35
+ shell: bash
36
+ run: |
37
+ cd server
38
+ uv sync --extra dev
39
+ - name: Run MyPy for graph-service
40
+ shell: bash
41
+ run: |
42
+ cd server
43
+ set -o pipefail
44
+ uv run mypy . --show-column-numbers --show-error-codes | sed -E '
45
+ s/^(.*):([0-9]+):([0-9]+): (error|warning): (.+) \[(.+)\]/::error file=\1,line=\2,endLine=\2,col=\3,title=\6::\5/;
46
+ s/^(.*):([0-9]+):([0-9]+): note: (.+)/::notice file=\1,line=\2,endLine=\2,col=\3,title=Note::\4/;
47
+ '
@@ -0,0 +1,30 @@
1
+ name: Unit Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: depot-ubuntu-22.04
12
+ environment:
13
+ name: development
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.10"
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v3
22
+ with:
23
+ version: "latest"
24
+ - name: Install dependencies
25
+ run: uv sync --extra dev
26
+ - name: Run non-integration tests
27
+ env:
28
+ PYTHONPATH: ${{ github.workspace }}
29
+ run: |
30
+ uv run pytest -m "not integration"
@@ -0,0 +1,168 @@
1
+ ### Python template
2
+ # Byte-compiled / optimized / DLL files
3
+ __pycache__/
4
+ *.py[cod]
5
+ *$py.class
6
+
7
+ # C extensions
8
+ *.so
9
+
10
+ # Distribution / packaging
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # uv
99
+ # It is generally recommended to include uv.lock in version control.
100
+ # This ensures reproducibility across different environments.
101
+ # https://docs.astral.sh/uv/concepts/projects/#lockfile
102
+ # uv.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
159
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
+ .idea/
161
+ .vscode/
162
+
163
+ ## Other
164
+ # Cache files
165
+ cache.db*
166
+
167
+ # All DS_Store files
168
+ .DS_Store
@@ -0,0 +1,133 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ Graphiti is a Python framework for building temporally-aware knowledge graphs designed for AI agents. It enables real-time incremental updates to knowledge graphs without batch recomputation, making it suitable for dynamic environments.
8
+
9
+ Key features:
10
+
11
+ - Bi-temporal data model with explicit tracking of event occurrence times
12
+ - Hybrid retrieval combining semantic embeddings, keyword search (BM25), and graph traversal
13
+ - Support for custom entity definitions via Pydantic models
14
+ - Integration with Neo4j and FalkorDB as graph storage backends
15
+
16
+ ## Development Commands
17
+
18
+ ### Main Development Commands (run from project root)
19
+
20
+ ```bash
21
+ # Install dependencies
22
+ uv sync --extra dev
23
+
24
+ # Format code (ruff import sorting + formatting)
25
+ make format
26
+
27
+ # Lint code (ruff + mypy type checking)
28
+ make lint
29
+
30
+ # Run tests
31
+ make test
32
+
33
+ # Run all checks (format, lint, test)
34
+ make check
35
+ ```
36
+
37
+ ### Server Development (run from server/ directory)
38
+
39
+ ```bash
40
+ cd server/
41
+ # Install server dependencies
42
+ uv sync --extra dev
43
+
44
+ # Run server in development mode
45
+ uvicorn graph_service.main:app --reload
46
+
47
+ # Format, lint, test server code
48
+ make format
49
+ make lint
50
+ make test
51
+ ```
52
+
53
+ ### MCP Server Development (run from mcp_server/ directory)
54
+
55
+ ```bash
56
+ cd mcp_server/
57
+ # Install MCP server dependencies
58
+ uv sync
59
+
60
+ # Run with Docker Compose
61
+ docker-compose up
62
+ ```
63
+
64
+ ## Code Architecture
65
+
66
+ ### Core Library (`graphiti_core/`)
67
+
68
+ - **Main Entry Point**: `graphiti.py` - Contains the main `Graphiti` class that orchestrates all functionality
69
+ - **Graph Storage**: `driver/` - Database drivers for Neo4j and FalkorDB
70
+ - **LLM Integration**: `llm_client/` - Clients for OpenAI, Anthropic, Gemini, Groq
71
+ - **Embeddings**: `embedder/` - Embedding clients for various providers
72
+ - **Graph Elements**: `nodes.py`, `edges.py` - Core graph data structures
73
+ - **Search**: `search/` - Hybrid search implementation with configurable strategies
74
+ - **Prompts**: `prompts/` - LLM prompts for entity extraction, deduplication, summarization
75
+ - **Utilities**: `utils/` - Maintenance operations, bulk processing, datetime handling
76
+
77
+ ### Server (`server/`)
78
+
79
+ - **FastAPI Service**: `graph_service/main.py` - REST API server
80
+ - **Routers**: `routers/` - API endpoints for ingestion and retrieval
81
+ - **DTOs**: `dto/` - Data transfer objects for API contracts
82
+
83
+ ### MCP Server (`mcp_server/`)
84
+
85
+ - **MCP Implementation**: `graphiti_mcp_server.py` - Model Context Protocol server for AI assistants
86
+ - **Docker Support**: Containerized deployment with Neo4j
87
+
88
+ ## Testing
89
+
90
+ - **Unit Tests**: `tests/` - Comprehensive test suite using pytest
91
+ - **Integration Tests**: Tests marked with `_int` suffix require database connections
92
+ - **Evaluation**: `tests/evals/` - End-to-end evaluation scripts
93
+
94
+ ## Configuration
95
+
96
+ ### Environment Variables
97
+
98
+ - `OPENAI_API_KEY` - Required for LLM inference and embeddings
99
+ - `USE_PARALLEL_RUNTIME` - Optional boolean for Neo4j parallel runtime (enterprise only)
100
+ - Provider-specific keys: `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`, `GROQ_API_KEY`, `VOYAGE_API_KEY`
101
+
102
+ ### Database Setup
103
+
104
+ - **Neo4j**: Version 5.26+ required, available via Neo4j Desktop
105
+ - **FalkorDB**: Version 1.1.2+ as alternative backend
106
+
107
+ ## Development Guidelines
108
+
109
+ ### Code Style
110
+
111
+ - Use Ruff for formatting and linting (configured in pyproject.toml)
112
+ - Line length: 100 characters
113
+ - Quote style: single quotes
114
+ - Type checking with MyPy is enforced
115
+
116
+ ### Testing Requirements
117
+
118
+ - Run tests with `make test` or `pytest`
119
+ - Integration tests require database connections
120
+ - Use `pytest-xdist` for parallel test execution
121
+
122
+ ### LLM Provider Support
123
+
124
+ The codebase supports multiple LLM providers but works best with services supporting structured output (OpenAI, Gemini). Other providers may cause schema validation issues, especially with smaller models.
125
+
126
+ ### MCP Server Usage Guidelines
127
+
128
+ When working with the MCP server, follow the patterns established in `mcp_server/cursor_rules.md`:
129
+
130
+ - Always search for existing knowledge before adding new information
131
+ - Use specific entity type filters (`Preference`, `Procedure`, `Requirement`)
132
+ - Store new information immediately using `add_memory`
133
+ - Follow discovered procedures and respect established preferences