graphiti-core 0.15.1__tar.gz → 0.17.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.
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/.env.example +0 -1
- graphiti_core-0.17.0/.github/ISSUE_TEMPLATE/bug_report.md +54 -0
- graphiti_core-0.17.0/.github/pull_request_template.md +32 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/.github/workflows/cla.yml +1 -1
- graphiti_core-0.17.0/.github/workflows/claude-code-review.yml +78 -0
- graphiti_core-0.17.0/.github/workflows/claude.yml +64 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/CLAUDE.md +13 -4
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/PKG-INFO +19 -1
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/README.md +18 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/examples/podcast/podcast_runner.py +38 -14
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/examples/quickstart/README.md +19 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/cross_encoder/gemini_reranker_client.py +4 -1
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/driver/driver.py +2 -4
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/driver/falkordb_driver.py +9 -7
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/driver/neo4j_driver.py +14 -13
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/edges.py +3 -20
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/embedder/gemini.py +17 -5
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/graphiti.py +107 -57
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/helpers.py +0 -1
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/llm_client/gemini_client.py +8 -5
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/nodes.py +3 -22
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/prompts/dedupe_edges.py +5 -4
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/prompts/dedupe_nodes.py +3 -3
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/search/search_utils.py +1 -20
- graphiti_core-0.17.0/graphiti_core/utils/bulk_utils.py +438 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/utils/maintenance/community_operations.py +1 -6
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/utils/maintenance/edge_operations.py +35 -122
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/utils/maintenance/graph_data_operations.py +2 -6
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/utils/maintenance/node_operations.py +11 -58
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/mcp_server/pyproject.toml +1 -1
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/pyproject.toml +1 -1
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/signatures/version1/cla.json +8 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/driver/test_falkordb_driver.py +3 -5
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/uv.lock +478 -409
- graphiti_core-0.15.1/graphiti_core/utils/bulk_utils.py +0 -482
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/.github/dependabot.yml +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/.github/secret_scanning.yml +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/.github/workflows/codeql.yml +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/.github/workflows/lint.yml +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/.github/workflows/mcp-server-docker.yml +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/.github/workflows/release-graphiti-core.yml +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/.github/workflows/typecheck.yml +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/.github/workflows/unit_tests.yml +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/.gitignore +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/CODE_OF_CONDUCT.md +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/CONTRIBUTING.md +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/Dockerfile +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/LICENSE +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/Makefile +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/SECURITY.md +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/Zep-CLA.md +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/conftest.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/depot.json +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/docker-compose.test.yml +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/docker-compose.yml +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/ellipsis.yaml +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/examples/data/manybirds_products.json +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/examples/ecommerce/runner.ipynb +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/examples/ecommerce/runner.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/examples/langgraph-agent/agent.ipynb +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/examples/langgraph-agent/tinybirds-jess.png +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/examples/podcast/podcast_transcript.txt +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/examples/podcast/transcript_parser.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/examples/quickstart/quickstart_falkordb.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/examples/quickstart/quickstart_neo4j.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/examples/quickstart/requirements.txt +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/examples/wizard_of_oz/parser.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/examples/wizard_of_oz/runner.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/examples/wizard_of_oz/woo.txt +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/cross_encoder/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/cross_encoder/bge_reranker_client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/cross_encoder/client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/cross_encoder/openai_reranker_client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/driver/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/embedder/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/embedder/azure_openai.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/embedder/client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/embedder/openai.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/embedder/voyage.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/errors.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/graph_queries.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/graphiti_types.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/llm_client/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/llm_client/anthropic_client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/llm_client/azure_openai_client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/llm_client/client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/llm_client/config.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/llm_client/errors.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/llm_client/groq_client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/llm_client/openai_base_client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/llm_client/openai_client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/llm_client/openai_generic_client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/llm_client/utils.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/models/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/models/edges/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/models/edges/edge_db_queries.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/models/nodes/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/models/nodes/node_db_queries.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/prompts/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/prompts/eval.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/prompts/extract_edge_dates.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/prompts/extract_edges.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/prompts/extract_nodes.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/prompts/invalidate_edges.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/prompts/lib.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/prompts/models.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/prompts/prompt_helpers.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/prompts/summarize_nodes.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/py.typed +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/search/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/search/search.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/search/search_config.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/search/search_config_recipes.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/search/search_filters.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/search/search_helpers.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/telemetry/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/telemetry/telemetry.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/utils/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/utils/datetime_utils.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/utils/maintenance/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/utils/maintenance/temporal_operations.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/utils/maintenance/utils.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/utils/ontology_utils/entity_types_utils.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/images/arxiv-screenshot.png +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/images/graphiti-graph-intro.gif +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/images/graphiti-intro-slides-stock-2.gif +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/images/simple_graph.svg +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/mcp_server/.env.example +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/mcp_server/.python-version +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/mcp_server/Dockerfile +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/mcp_server/README.md +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/mcp_server/cursor_rules.md +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/mcp_server/docker-compose.yml +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/mcp_server/graphiti_mcp_server.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/mcp_server/mcp_config_sse_example.json +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/mcp_server/mcp_config_stdio_example.json +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/mcp_server/uv.lock +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/poetry.lock +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/py.typed +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/pytest.ini +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/.env.example +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/Makefile +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/README.md +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/graph_service/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/graph_service/config.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/graph_service/dto/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/graph_service/dto/common.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/graph_service/dto/ingest.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/graph_service/dto/retrieve.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/graph_service/main.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/graph_service/routers/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/graph_service/routers/ingest.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/graph_service/routers/retrieve.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/graph_service/zep_graphiti.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/pyproject.toml +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/server/uv.lock +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/cross_encoder/test_bge_reranker_client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/cross_encoder/test_gemini_reranker_client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/driver/__init__.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/embedder/embedder_fixtures.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/embedder/test_gemini.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/embedder/test_openai.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/embedder/test_voyage.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/evals/data/longmemeval_data/README.md +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/evals/data/longmemeval_data/longmemeval_oracle.json +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/evals/eval_cli.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/evals/eval_e2e_graph_building.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/evals/pytest.ini +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/evals/utils.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/helpers_test.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/llm_client/test_anthropic_client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/llm_client/test_anthropic_client_int.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/llm_client/test_client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/llm_client/test_errors.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/llm_client/test_gemini_client.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/test_entity_exclusion_int.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/test_graphiti_falkordb_int.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/test_graphiti_int.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/test_node_falkordb_int.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/test_node_int.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/utils/maintenance/test_edge_operations.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/utils/maintenance/test_temporal_operations_int.py +0 -0
- {graphiti_core-0.15.1 → graphiti_core-0.17.0}/tests/utils/search/search_utils_test.py +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug Report
|
|
3
|
+
about: Create a report to help us improve Graphiti
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Bug Description
|
|
10
|
+
A clear and concise description of what the bug is.
|
|
11
|
+
|
|
12
|
+
## Steps to Reproduce
|
|
13
|
+
Provide a minimal code example that reproduces the issue:
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
# Your code here
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Expected Behavior
|
|
20
|
+
A clear and concise description of what you expected to happen.
|
|
21
|
+
|
|
22
|
+
## Actual Behavior
|
|
23
|
+
A clear and concise description of what actually happened.
|
|
24
|
+
|
|
25
|
+
## Environment
|
|
26
|
+
- **Graphiti Version**: [e.g. 0.15.1]
|
|
27
|
+
- **Python Version**: [e.g. 3.11.5]
|
|
28
|
+
- **Operating System**: [e.g. macOS 14.0, Ubuntu 22.04]
|
|
29
|
+
- **Database Backend**: [e.g. Neo4j 5.26, FalkorDB 1.1.2]
|
|
30
|
+
- **LLM Provider & Model**: [e.g. OpenAI gpt-4.1, Anthropic claude-4-sonnet, Google gemini-2.5-flash]
|
|
31
|
+
|
|
32
|
+
## Installation Method
|
|
33
|
+
- [ ] pip install
|
|
34
|
+
- [ ] uv add
|
|
35
|
+
- [ ] Development installation (git clone)
|
|
36
|
+
|
|
37
|
+
## Error Messages/Traceback
|
|
38
|
+
```
|
|
39
|
+
Paste the full error message and traceback here
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Configuration
|
|
43
|
+
```python
|
|
44
|
+
# Relevant configuration or initialization code
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Additional Context
|
|
48
|
+
- Does this happen consistently or intermittently?
|
|
49
|
+
- Which component are you using? (core library, REST server, MCP server)
|
|
50
|
+
- Any recent changes to your environment?
|
|
51
|
+
- Related issues or similar problems you've encountered?
|
|
52
|
+
|
|
53
|
+
## Possible Solution
|
|
54
|
+
If you have ideas about what might be causing the issue or how to fix it, please share them here.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
Brief description of the changes in this PR.
|
|
3
|
+
|
|
4
|
+
## Type of Change
|
|
5
|
+
- [ ] Bug fix
|
|
6
|
+
- [ ] New feature
|
|
7
|
+
- [ ] Performance improvement
|
|
8
|
+
- [ ] Documentation/Tests
|
|
9
|
+
|
|
10
|
+
## Objective
|
|
11
|
+
**For new features and performance improvements:** Clearly describe the objective and rationale for this change.
|
|
12
|
+
|
|
13
|
+
## Testing
|
|
14
|
+
- [ ] Unit tests added/updated
|
|
15
|
+
- [ ] Integration tests added/updated
|
|
16
|
+
- [ ] All existing tests pass
|
|
17
|
+
|
|
18
|
+
## Breaking Changes
|
|
19
|
+
- [ ] This PR contains breaking changes
|
|
20
|
+
|
|
21
|
+
If this is a breaking change, describe:
|
|
22
|
+
- What functionality is affected
|
|
23
|
+
- Migration path for existing users
|
|
24
|
+
|
|
25
|
+
## Checklist
|
|
26
|
+
- [ ] Code follows project style guidelines (`make lint` passes)
|
|
27
|
+
- [ ] Self-review completed
|
|
28
|
+
- [ ] Documentation updated where necessary
|
|
29
|
+
- [ ] No secrets or sensitive information committed
|
|
30
|
+
|
|
31
|
+
## Related Issues
|
|
32
|
+
Closes #[issue number]
|
|
@@ -28,7 +28,7 @@ jobs:
|
|
|
28
28
|
path-to-document: "https://github.com/getzep/graphiti/blob/main/Zep-CLA.md" # e.g. a CLA or a DCO document
|
|
29
29
|
# branch should not be protected unless a personal PAT is used
|
|
30
30
|
branch: "main"
|
|
31
|
-
allowlist: paul-paliychuk,prasmussen15,danielchalef,dependabot[bot],ellipsis-dev
|
|
31
|
+
allowlist: paul-paliychuk,prasmussen15,danielchalef,dependabot[bot],ellipsis-dev,Claude[bot]
|
|
32
32
|
|
|
33
33
|
# the followings are the optional inputs - If the optional inputs are not given, then default values will be taken
|
|
34
34
|
#remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
name: Claude Code Review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize]
|
|
6
|
+
# Optional: Only run on specific file changes
|
|
7
|
+
# paths:
|
|
8
|
+
# - "src/**/*.ts"
|
|
9
|
+
# - "src/**/*.tsx"
|
|
10
|
+
# - "src/**/*.js"
|
|
11
|
+
# - "src/**/*.jsx"
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
claude-review:
|
|
15
|
+
# Optional: Filter by PR author
|
|
16
|
+
# if: |
|
|
17
|
+
# github.event.pull_request.user.login == 'external-contributor' ||
|
|
18
|
+
# github.event.pull_request.user.login == 'new-developer' ||
|
|
19
|
+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
|
20
|
+
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
permissions:
|
|
23
|
+
contents: read
|
|
24
|
+
pull-requests: write
|
|
25
|
+
issues: read
|
|
26
|
+
id-token: write
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- name: Checkout repository
|
|
30
|
+
uses: actions/checkout@v4
|
|
31
|
+
with:
|
|
32
|
+
fetch-depth: 1
|
|
33
|
+
|
|
34
|
+
- name: Run Claude Code Review
|
|
35
|
+
id: claude-review
|
|
36
|
+
uses: anthropics/claude-code-action@beta
|
|
37
|
+
with:
|
|
38
|
+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
39
|
+
|
|
40
|
+
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
|
|
41
|
+
# model: "claude-opus-4-20250514"
|
|
42
|
+
|
|
43
|
+
# Direct prompt for automated review (no @claude mention needed)
|
|
44
|
+
direct_prompt: |
|
|
45
|
+
Please review this pull request and provide feedback on:
|
|
46
|
+
- Code quality and best practices
|
|
47
|
+
- Potential bugs or issues
|
|
48
|
+
- Performance considerations
|
|
49
|
+
- Security concerns
|
|
50
|
+
- Test coverage
|
|
51
|
+
|
|
52
|
+
Be constructive and helpful in your feedback.
|
|
53
|
+
|
|
54
|
+
# Optional: Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
|
|
55
|
+
# use_sticky_comment: true
|
|
56
|
+
|
|
57
|
+
# Optional: Customize review based on file types
|
|
58
|
+
# direct_prompt: |
|
|
59
|
+
# Review this PR focusing on:
|
|
60
|
+
# - For TypeScript files: Type safety and proper interface usage
|
|
61
|
+
# - For API endpoints: Security, input validation, and error handling
|
|
62
|
+
# - For React components: Performance, accessibility, and best practices
|
|
63
|
+
# - For tests: Coverage, edge cases, and test quality
|
|
64
|
+
|
|
65
|
+
# Optional: Different prompts for different authors
|
|
66
|
+
# direct_prompt: |
|
|
67
|
+
# ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
|
|
68
|
+
# 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
|
|
69
|
+
# 'Please provide a thorough code review focusing on our coding standards and best practices.' }}
|
|
70
|
+
|
|
71
|
+
# Optional: Add specific tools for running tests or linting
|
|
72
|
+
# allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"
|
|
73
|
+
|
|
74
|
+
# Optional: Skip review for certain conditions
|
|
75
|
+
# if: |
|
|
76
|
+
# !contains(github.event.pull_request.title, '[skip-review]') &&
|
|
77
|
+
# !contains(github.event.pull_request.title, '[WIP]')
|
|
78
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Claude Code
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issue_comment:
|
|
5
|
+
types: [created]
|
|
6
|
+
pull_request_review_comment:
|
|
7
|
+
types: [created]
|
|
8
|
+
issues:
|
|
9
|
+
types: [opened, assigned]
|
|
10
|
+
pull_request_review:
|
|
11
|
+
types: [submitted]
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
claude:
|
|
15
|
+
if: |
|
|
16
|
+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
17
|
+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
18
|
+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
|
|
19
|
+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
permissions:
|
|
22
|
+
contents: read
|
|
23
|
+
pull-requests: write
|
|
24
|
+
issues: write
|
|
25
|
+
id-token: write
|
|
26
|
+
actions: read # Required for Claude to read CI results on PRs
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout repository
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 1
|
|
32
|
+
|
|
33
|
+
- name: Run Claude Code
|
|
34
|
+
id: claude
|
|
35
|
+
uses: anthropics/claude-code-action@beta
|
|
36
|
+
with:
|
|
37
|
+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
38
|
+
|
|
39
|
+
# This is an optional setting that allows Claude to read CI results on PRs
|
|
40
|
+
additional_permissions: |
|
|
41
|
+
actions: read
|
|
42
|
+
|
|
43
|
+
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
|
|
44
|
+
# model: "claude-opus-4-20250514"
|
|
45
|
+
|
|
46
|
+
# Optional: Customize the trigger phrase (default: @claude)
|
|
47
|
+
# trigger_phrase: "/claude"
|
|
48
|
+
|
|
49
|
+
# Optional: Trigger when specific user is assigned to an issue
|
|
50
|
+
# assignee_trigger: "claude-bot"
|
|
51
|
+
|
|
52
|
+
# Optional: Allow Claude to run specific commands
|
|
53
|
+
# allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
|
|
54
|
+
|
|
55
|
+
# Optional: Add custom instructions for Claude to customize its behavior for your project
|
|
56
|
+
# custom_instructions: |
|
|
57
|
+
# Follow our coding standards
|
|
58
|
+
# Ensure all new code has tests
|
|
59
|
+
# Use TypeScript for new files
|
|
60
|
+
|
|
61
|
+
# Optional: Custom environment variables for Claude
|
|
62
|
+
# claude_env: |
|
|
63
|
+
# NODE_ENV: test
|
|
64
|
+
|
|
@@ -24,7 +24,7 @@ uv sync --extra dev
|
|
|
24
24
|
# Format code (ruff import sorting + formatting)
|
|
25
25
|
make format
|
|
26
26
|
|
|
27
|
-
# Lint code (ruff +
|
|
27
|
+
# Lint code (ruff + pyright type checking)
|
|
28
28
|
make lint
|
|
29
29
|
|
|
30
30
|
# Run tests
|
|
@@ -102,7 +102,11 @@ docker-compose up
|
|
|
102
102
|
### Database Setup
|
|
103
103
|
|
|
104
104
|
- **Neo4j**: Version 5.26+ required, available via Neo4j Desktop
|
|
105
|
+
- Database name defaults to `neo4j` (hardcoded in Neo4jDriver)
|
|
106
|
+
- Override by passing `database` parameter to driver constructor
|
|
105
107
|
- **FalkorDB**: Version 1.1.2+ as alternative backend
|
|
108
|
+
- Database name defaults to `default_db` (hardcoded in FalkorDriver)
|
|
109
|
+
- Override by passing `database` parameter to driver constructor
|
|
106
110
|
|
|
107
111
|
## Development Guidelines
|
|
108
112
|
|
|
@@ -111,13 +115,18 @@ docker-compose up
|
|
|
111
115
|
- Use Ruff for formatting and linting (configured in pyproject.toml)
|
|
112
116
|
- Line length: 100 characters
|
|
113
117
|
- Quote style: single quotes
|
|
114
|
-
- Type checking with
|
|
118
|
+
- Type checking with Pyright is enforced
|
|
119
|
+
- Main project uses `typeCheckingMode = "basic"`, server uses `typeCheckingMode = "standard"`
|
|
115
120
|
|
|
116
121
|
### Testing Requirements
|
|
117
122
|
|
|
118
123
|
- Run tests with `make test` or `pytest`
|
|
119
|
-
- Integration tests require database connections
|
|
124
|
+
- Integration tests require database connections and are marked with `_int` suffix
|
|
120
125
|
- Use `pytest-xdist` for parallel test execution
|
|
126
|
+
- Run specific test files: `pytest tests/test_specific_file.py`
|
|
127
|
+
- Run specific test methods: `pytest tests/test_file.py::test_method_name`
|
|
128
|
+
- Run only integration tests: `pytest tests/ -k "_int"`
|
|
129
|
+
- Run only unit tests: `pytest tests/ -k "not _int"`
|
|
121
130
|
|
|
122
131
|
### LLM Provider Support
|
|
123
132
|
|
|
@@ -130,4 +139,4 @@ When working with the MCP server, follow the patterns established in `mcp_server
|
|
|
130
139
|
- Always search for existing knowledge before adding new information
|
|
131
140
|
- Use specific entity type filters (`Preference`, `Procedure`, `Requirement`)
|
|
132
141
|
- Store new information immediately using `add_memory`
|
|
133
|
-
- Follow discovered procedures and respect established preferences
|
|
142
|
+
- Follow discovered procedures and respect established preferences
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: graphiti-core
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.17.0
|
|
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
|
|
@@ -265,6 +265,24 @@ In addition to the Neo4j and OpenAi-compatible credentials, Graphiti also has a
|
|
|
265
265
|
If you are using one of our supported models, such as Anthropic or Voyage models, the necessary environment variables
|
|
266
266
|
must be set.
|
|
267
267
|
|
|
268
|
+
### Database Configuration
|
|
269
|
+
|
|
270
|
+
Database names are configured directly in the driver constructors:
|
|
271
|
+
|
|
272
|
+
- **Neo4j**: Database name defaults to `neo4j` (hardcoded in Neo4jDriver)
|
|
273
|
+
- **FalkorDB**: Database name defaults to `default_db` (hardcoded in FalkorDriver)
|
|
274
|
+
|
|
275
|
+
To use a different database name, pass the `database` parameter when creating the driver:
|
|
276
|
+
|
|
277
|
+
```python
|
|
278
|
+
from graphiti_core.driver.neo4j_driver import Neo4jDriver
|
|
279
|
+
|
|
280
|
+
# Use custom database name
|
|
281
|
+
driver = Neo4jDriver(uri="bolt://localhost:7687", user="neo4j", password="password", database="my_db")
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Performance Configuration
|
|
285
|
+
|
|
268
286
|
`USE_PARALLEL_RUNTIME` is an optional boolean variable that can be set to true if you wish
|
|
269
287
|
to enable Neo4j's parallel runtime feature for several of our search queries.
|
|
270
288
|
Note that this feature is not supported for Neo4j Community edition or for smaller AuraDB instances,
|
|
@@ -213,6 +213,24 @@ In addition to the Neo4j and OpenAi-compatible credentials, Graphiti also has a
|
|
|
213
213
|
If you are using one of our supported models, such as Anthropic or Voyage models, the necessary environment variables
|
|
214
214
|
must be set.
|
|
215
215
|
|
|
216
|
+
### Database Configuration
|
|
217
|
+
|
|
218
|
+
Database names are configured directly in the driver constructors:
|
|
219
|
+
|
|
220
|
+
- **Neo4j**: Database name defaults to `neo4j` (hardcoded in Neo4jDriver)
|
|
221
|
+
- **FalkorDB**: Database name defaults to `default_db` (hardcoded in FalkorDriver)
|
|
222
|
+
|
|
223
|
+
To use a different database name, pass the `database` parameter when creating the driver:
|
|
224
|
+
|
|
225
|
+
```python
|
|
226
|
+
from graphiti_core.driver.neo4j_driver import Neo4jDriver
|
|
227
|
+
|
|
228
|
+
# Use custom database name
|
|
229
|
+
driver = Neo4jDriver(uri="bolt://localhost:7687", user="neo4j", password="password", database="my_db")
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Performance Configuration
|
|
233
|
+
|
|
216
234
|
`USE_PARALLEL_RUNTIME` is an optional boolean variable that can be set to true if you wish
|
|
217
235
|
to enable Neo4j's parallel runtime feature for several of our search queries.
|
|
218
236
|
Note that this feature is not supported for Neo4j Community edition or for smaller AuraDB instances,
|
|
@@ -25,6 +25,8 @@ from pydantic import BaseModel, Field
|
|
|
25
25
|
from transcript_parser import parse_podcast_messages
|
|
26
26
|
|
|
27
27
|
from graphiti_core import Graphiti
|
|
28
|
+
from graphiti_core.nodes import EpisodeType
|
|
29
|
+
from graphiti_core.utils.bulk_utils import RawEpisode
|
|
28
30
|
from graphiti_core.utils.maintenance.graph_data_operations import clear_data
|
|
29
31
|
|
|
30
32
|
load_dotenv()
|
|
@@ -67,7 +69,7 @@ class IsPresidentOf(BaseModel):
|
|
|
67
69
|
"""Relationship between a person and the entity they are a president of"""
|
|
68
70
|
|
|
69
71
|
|
|
70
|
-
async def main():
|
|
72
|
+
async def main(use_bulk: bool = False):
|
|
71
73
|
setup_logging()
|
|
72
74
|
client = Graphiti(neo4j_uri, neo4j_user, neo4j_password)
|
|
73
75
|
await clear_data(client.driver)
|
|
@@ -75,21 +77,43 @@ async def main():
|
|
|
75
77
|
messages = parse_podcast_messages()
|
|
76
78
|
group_id = str(uuid4())
|
|
77
79
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
raw_episodes: list[RawEpisode] = []
|
|
81
|
+
for i, message in enumerate(messages[3:7]):
|
|
82
|
+
raw_episodes.append(
|
|
83
|
+
RawEpisode(
|
|
84
|
+
name=f'Message {i}',
|
|
85
|
+
content=f'{message.speaker_name} ({message.role}): {message.content}',
|
|
86
|
+
reference_time=message.actual_timestamp,
|
|
87
|
+
source=EpisodeType.message,
|
|
88
|
+
source_description='Podcast Transcript',
|
|
89
|
+
)
|
|
90
|
+
)
|
|
91
|
+
if use_bulk:
|
|
92
|
+
await client.add_episode_bulk(
|
|
93
|
+
raw_episodes,
|
|
87
94
|
group_id=group_id,
|
|
88
95
|
entity_types={'Person': Person},
|
|
89
96
|
edge_types={'IS_PRESIDENT_OF': IsPresidentOf},
|
|
90
97
|
edge_type_map={('Person', 'Entity'): ['PRESIDENT_OF']},
|
|
91
|
-
previous_episode_uuids=episode_uuids,
|
|
92
98
|
)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
else:
|
|
100
|
+
for i, message in enumerate(messages[3:14]):
|
|
101
|
+
episodes = await client.retrieve_episodes(
|
|
102
|
+
message.actual_timestamp, 3, group_ids=[group_id]
|
|
103
|
+
)
|
|
104
|
+
episode_uuids = [episode.uuid for episode in episodes]
|
|
105
|
+
|
|
106
|
+
await client.add_episode(
|
|
107
|
+
name=f'Message {i}',
|
|
108
|
+
episode_body=f'{message.speaker_name} ({message.role}): {message.content}',
|
|
109
|
+
reference_time=message.actual_timestamp,
|
|
110
|
+
source_description='Podcast Transcript',
|
|
111
|
+
group_id=group_id,
|
|
112
|
+
entity_types={'Person': Person},
|
|
113
|
+
edge_types={'IS_PRESIDENT_OF': IsPresidentOf},
|
|
114
|
+
edge_type_map={('Person', 'Entity'): ['PRESIDENT_OF']},
|
|
115
|
+
previous_episode_uuids=episode_uuids,
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
asyncio.run(main(True))
|
|
@@ -41,6 +41,8 @@ export NEO4J_PASSWORD=password
|
|
|
41
41
|
|
|
42
42
|
# Optional FalkorDB connection parameters (defaults shown)
|
|
43
43
|
export FALKORDB_URI=falkor://localhost:6379
|
|
44
|
+
|
|
45
|
+
# To use a different database, modify the driver constructor in the script
|
|
44
46
|
```
|
|
45
47
|
|
|
46
48
|
3. Run the example:
|
|
@@ -71,6 +73,23 @@ After running this example, you can:
|
|
|
71
73
|
4. Try other predefined search recipes from `graphiti_core.search.search_config_recipes`
|
|
72
74
|
5. Explore the more advanced examples in the other directories
|
|
73
75
|
|
|
76
|
+
## Troubleshooting
|
|
77
|
+
|
|
78
|
+
### "Graph not found: default_db" Error
|
|
79
|
+
|
|
80
|
+
If you encounter the error `Neo.ClientError.Database.DatabaseNotFound: Graph not found: default_db`, this occurs when the driver is trying to connect to a database that doesn't exist.
|
|
81
|
+
|
|
82
|
+
**Solution:**
|
|
83
|
+
The Neo4j driver defaults to using `neo4j` as the database name. If you need to use a different database, modify the driver constructor in the script:
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
# In quickstart_neo4j.py, change:
|
|
87
|
+
driver = Neo4jDriver(uri=neo4j_uri, user=neo4j_user, password=neo4j_password)
|
|
88
|
+
|
|
89
|
+
# To specify a different database:
|
|
90
|
+
driver = Neo4jDriver(uri=neo4j_uri, user=neo4j_user, password=neo4j_password, database="your_db_name")
|
|
91
|
+
```
|
|
92
|
+
|
|
74
93
|
## Understanding the Output
|
|
75
94
|
|
|
76
95
|
### Edge Search Results
|
{graphiti_core-0.15.1 → graphiti_core-0.17.0}/graphiti_core/cross_encoder/gemini_reranker_client.py
RENAMED
|
@@ -41,6 +41,10 @@ DEFAULT_MODEL = 'gemini-2.5-flash-lite-preview-06-17'
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
class GeminiRerankerClient(CrossEncoderClient):
|
|
44
|
+
"""
|
|
45
|
+
Google Gemini Reranker Client
|
|
46
|
+
"""
|
|
47
|
+
|
|
44
48
|
def __init__(
|
|
45
49
|
self,
|
|
46
50
|
config: LLMConfig | None = None,
|
|
@@ -57,7 +61,6 @@ class GeminiRerankerClient(CrossEncoderClient):
|
|
|
57
61
|
config (LLMConfig | None): The configuration for the LLM client, including API key, model, base URL, temperature, and max tokens.
|
|
58
62
|
client (genai.Client | None): An optional async client instance to use. If not provided, a new genai.Client is created.
|
|
59
63
|
"""
|
|
60
|
-
|
|
61
64
|
if config is None:
|
|
62
65
|
config = LLMConfig()
|
|
63
66
|
|
|
@@ -19,8 +19,6 @@ from abc import ABC, abstractmethod
|
|
|
19
19
|
from collections.abc import Coroutine
|
|
20
20
|
from typing import Any
|
|
21
21
|
|
|
22
|
-
from graphiti_core.helpers import DEFAULT_DATABASE
|
|
23
|
-
|
|
24
22
|
logger = logging.getLogger(__name__)
|
|
25
23
|
|
|
26
24
|
|
|
@@ -54,7 +52,7 @@ class GraphDriver(ABC):
|
|
|
54
52
|
raise NotImplementedError()
|
|
55
53
|
|
|
56
54
|
@abstractmethod
|
|
57
|
-
def session(self, database: str) -> GraphDriverSession:
|
|
55
|
+
def session(self, database: str | None = None) -> GraphDriverSession:
|
|
58
56
|
raise NotImplementedError()
|
|
59
57
|
|
|
60
58
|
@abstractmethod
|
|
@@ -62,5 +60,5 @@ class GraphDriver(ABC):
|
|
|
62
60
|
raise NotImplementedError()
|
|
63
61
|
|
|
64
62
|
@abstractmethod
|
|
65
|
-
def delete_all_indexes(self, database_: str =
|
|
63
|
+
def delete_all_indexes(self, database_: str | None = None) -> Coroutine:
|
|
66
64
|
raise NotImplementedError()
|
|
@@ -33,7 +33,6 @@ else:
|
|
|
33
33
|
) from None
|
|
34
34
|
|
|
35
35
|
from graphiti_core.driver.driver import GraphDriver, GraphDriverSession
|
|
36
|
-
from graphiti_core.helpers import DEFAULT_DATABASE
|
|
37
36
|
|
|
38
37
|
logger = logging.getLogger(__name__)
|
|
39
38
|
|
|
@@ -81,6 +80,7 @@ class FalkorDriver(GraphDriver):
|
|
|
81
80
|
username: str | None = None,
|
|
82
81
|
password: str | None = None,
|
|
83
82
|
falkor_db: FalkorDB | None = None,
|
|
83
|
+
database: str = 'default_db',
|
|
84
84
|
):
|
|
85
85
|
"""
|
|
86
86
|
Initialize the FalkorDB driver.
|
|
@@ -95,15 +95,16 @@ class FalkorDriver(GraphDriver):
|
|
|
95
95
|
self.client = falkor_db
|
|
96
96
|
else:
|
|
97
97
|
self.client = FalkorDB(host=host, port=port, username=username, password=password)
|
|
98
|
+
self._database = database
|
|
98
99
|
|
|
99
100
|
def _get_graph(self, graph_name: str | None) -> FalkorGraph:
|
|
100
|
-
# FalkorDB requires a non-None database name for multi-tenant graphs; the default is
|
|
101
|
+
# FalkorDB requires a non-None database name for multi-tenant graphs; the default is "default_db"
|
|
101
102
|
if graph_name is None:
|
|
102
|
-
graph_name =
|
|
103
|
+
graph_name = self._database
|
|
103
104
|
return self.client.select_graph(graph_name)
|
|
104
105
|
|
|
105
106
|
async def execute_query(self, cypher_query_, **kwargs: Any):
|
|
106
|
-
graph_name = kwargs.pop('database_',
|
|
107
|
+
graph_name = kwargs.pop('database_', self._database)
|
|
107
108
|
graph = self._get_graph(graph_name)
|
|
108
109
|
|
|
109
110
|
# Convert datetime objects to ISO strings (FalkorDB does not support datetime objects directly)
|
|
@@ -136,7 +137,7 @@ class FalkorDriver(GraphDriver):
|
|
|
136
137
|
|
|
137
138
|
return records, header, None
|
|
138
139
|
|
|
139
|
-
def session(self, database: str | None) -> GraphDriverSession:
|
|
140
|
+
def session(self, database: str | None = None) -> GraphDriverSession:
|
|
140
141
|
return FalkorDriverSession(self._get_graph(database))
|
|
141
142
|
|
|
142
143
|
async def close(self) -> None:
|
|
@@ -148,10 +149,11 @@ class FalkorDriver(GraphDriver):
|
|
|
148
149
|
elif hasattr(self.client.connection, 'close'):
|
|
149
150
|
await self.client.connection.close()
|
|
150
151
|
|
|
151
|
-
async def delete_all_indexes(self, database_: str =
|
|
152
|
+
async def delete_all_indexes(self, database_: str | None = None) -> None:
|
|
153
|
+
database = database_ or self._database
|
|
152
154
|
await self.execute_query(
|
|
153
155
|
'CALL db.indexes() YIELD name DROP INDEX name',
|
|
154
|
-
database_=
|
|
156
|
+
database_=database,
|
|
155
157
|
)
|
|
156
158
|
|
|
157
159
|
|
|
@@ -22,7 +22,6 @@ from neo4j import AsyncGraphDatabase, EagerResult
|
|
|
22
22
|
from typing_extensions import LiteralString
|
|
23
23
|
|
|
24
24
|
from graphiti_core.driver.driver import GraphDriver, GraphDriverSession
|
|
25
|
-
from graphiti_core.helpers import DEFAULT_DATABASE
|
|
26
25
|
|
|
27
26
|
logger = logging.getLogger(__name__)
|
|
28
27
|
|
|
@@ -30,34 +29,36 @@ logger = logging.getLogger(__name__)
|
|
|
30
29
|
class Neo4jDriver(GraphDriver):
|
|
31
30
|
provider: str = 'neo4j'
|
|
32
31
|
|
|
33
|
-
def __init__(
|
|
34
|
-
self,
|
|
35
|
-
uri: str,
|
|
36
|
-
user: str | None,
|
|
37
|
-
password: str | None,
|
|
38
|
-
):
|
|
32
|
+
def __init__(self, uri: str, user: str | None, password: str | None, database: str = 'neo4j'):
|
|
39
33
|
super().__init__()
|
|
40
34
|
self.client = AsyncGraphDatabase.driver(
|
|
41
35
|
uri=uri,
|
|
42
36
|
auth=(user or '', password or ''),
|
|
43
37
|
)
|
|
38
|
+
self._database = database
|
|
44
39
|
|
|
45
40
|
async def execute_query(self, cypher_query_: LiteralString, **kwargs: Any) -> EagerResult:
|
|
41
|
+
# Check if database_ is provided in kwargs.
|
|
42
|
+
# If not populated, set the value to retain backwards compatibility
|
|
46
43
|
params = kwargs.pop('params', None)
|
|
44
|
+
if params is None:
|
|
45
|
+
params = {}
|
|
46
|
+
params.setdefault('database_', self._database)
|
|
47
|
+
|
|
47
48
|
result = await self.client.execute_query(cypher_query_, parameters_=params, **kwargs)
|
|
48
49
|
|
|
49
50
|
return result
|
|
50
51
|
|
|
51
|
-
def session(self, database: str) -> GraphDriverSession:
|
|
52
|
-
|
|
52
|
+
def session(self, database: str | None = None) -> GraphDriverSession:
|
|
53
|
+
_database = database or self._database
|
|
54
|
+
return self.client.session(database=_database) # type: ignore
|
|
53
55
|
|
|
54
56
|
async def close(self) -> None:
|
|
55
57
|
return await self.client.close()
|
|
56
58
|
|
|
57
|
-
def delete_all_indexes(
|
|
58
|
-
|
|
59
|
-
) -> Coroutine[Any, Any, EagerResult]:
|
|
59
|
+
def delete_all_indexes(self, database_: str | None = None) -> Coroutine[Any, Any, EagerResult]:
|
|
60
|
+
database = database_ or self._database
|
|
60
61
|
return self.client.execute_query(
|
|
61
62
|
'CALL db.indexes() YIELD name DROP INDEX name',
|
|
62
|
-
database_=
|
|
63
|
+
database_=database,
|
|
63
64
|
)
|