* Add OpenTelemetry distributed tracing support - Add tracer abstraction with no-op and OpenTelemetry implementations - Instrument add_episode and add_episode_bulk with tracing spans - Instrument LLM client with cache-aware tracing - Add configurable span name prefix support - Refactor add_episode methods to improve code quality - Add OTEL_TRACING.md documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix linting errors in tracing implementation - Remove unused episodes_by_uuid variable - Fix tracer type annotations for context manager support - Replace isinstance tuple with union syntax - Use contextlib.suppress for exception handling - Fix import ordering and use AbstractContextManager 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Address PR review feedback on tracing implementation Critical fixes: - Remove flawed error span creation in graphiti.py that created orphaned spans - Restructure LLM client tracing to create span once at start, eliminating code duplication - Initialize LLM client tracer to NoOpTracer by default to fix type checking Enhancements: - Add comprehensive span attributes to add_episode: reference_time, entity/edge type counts, previous episodes count, invalidated edge count, community count - Optimize isinstance check for better performance 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Add prompt name tracking to OpenTelemetry tracing spans Add prompt_name parameter to all LLM client generate_response() methods and set it as a span attribute in the llm.generate span. This enables better observability by identifying which prompt template was used for each LLM call. Changes: - Add prompt_name parameter to LLMClient.generate_response() base method - Add prompt_name parameter and tracing to OpenAIBaseClient, AnthropicClient, GeminiClient, and OpenAIGenericClient - Update all 14 LLM call sites across maintenance operations to include prompt_name: - edge_operations.py: 4 calls - node_operations.py: 6 calls (note: 7 listed but only 6 unique) - temporal_operations.py: 2 calls - community_operations.py: 2 calls 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix exception handling in add_episode to record errors in OpenTelemetry span Moved try-except block inside the OpenTelemetry span context and added proper error recording with span.set_status() and span.record_exception(). This ensures exceptions are captured in the distributed trace, matching the pattern used in add_episode_bulk. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
101 lines
2.4 KiB
TOML
101 lines
2.4 KiB
TOML
[project]
|
|
name = "graphiti-core"
|
|
description = "A temporal graph building library"
|
|
version = "0.22.0pre3"
|
|
authors = [
|
|
{ name = "Paul Paliychuk", email = "paul@getzep.com" },
|
|
{ name = "Preston Rasmussen", email = "preston@getzep.com" },
|
|
{ name = "Daniel Chalef", email = "daniel@getzep.com" },
|
|
]
|
|
readme = "README.md"
|
|
license = "Apache-2.0"
|
|
requires-python = ">=3.10,<4"
|
|
dependencies = [
|
|
"pydantic>=2.11.5",
|
|
"neo4j>=5.26.0",
|
|
"diskcache>=5.6.3",
|
|
"openai>=1.91.0",
|
|
"tenacity>=9.0.0",
|
|
"numpy>=1.0.0",
|
|
"python-dotenv>=1.0.1",
|
|
"posthog>=3.0.0"
|
|
]
|
|
|
|
[project.urls]
|
|
Homepage = "https://help.getzep.com/graphiti/graphiti/overview"
|
|
Repository = "https://github.com/getzep/graphiti"
|
|
|
|
[project.optional-dependencies]
|
|
anthropic = ["anthropic>=0.49.0"]
|
|
groq = ["groq>=0.2.0"]
|
|
google-genai = ["google-genai>=1.8.0"]
|
|
kuzu = ["kuzu>=0.11.2"]
|
|
falkordb = ["falkordb>=1.1.2,<2.0.0"]
|
|
voyageai = ["voyageai>=0.2.3"]
|
|
neo4j-opensearch = ["boto3>=1.39.16", "opensearch-py>=3.0.0"]
|
|
sentence-transformers = ["sentence-transformers>=3.2.1"]
|
|
neptune = ["langchain-aws>=0.2.29", "opensearch-py>=3.0.0", "boto3>=1.39.16"]
|
|
tracing = ["opentelemetry-api>=1.20.0", "opentelemetry-sdk>=1.20.0"]
|
|
dev = [
|
|
"pyright>=1.1.404",
|
|
"groq>=0.2.0",
|
|
"anthropic>=0.49.0",
|
|
"google-genai>=1.8.0",
|
|
"falkordb>=1.1.2,<2.0.0",
|
|
"kuzu>=0.11.2",
|
|
"boto3>=1.39.16",
|
|
"opensearch-py>=3.0.0",
|
|
"langchain-aws>=0.2.29",
|
|
"ipykernel>=6.29.5",
|
|
"jupyterlab>=4.2.4",
|
|
"diskcache-stubs>=5.6.3.6.20240818",
|
|
"langgraph>=0.2.15",
|
|
"langchain-anthropic>=0.2.4",
|
|
"langsmith>=0.1.108",
|
|
"langchain-openai>=0.2.6",
|
|
"sentence-transformers>=3.2.1",
|
|
"transformers>=4.45.2",
|
|
"voyageai>=0.2.3",
|
|
"pytest>=8.3.3",
|
|
"pytest-asyncio>=0.24.0",
|
|
"pytest-xdist>=3.6.1",
|
|
"ruff>=0.7.1",
|
|
"opentelemetry-sdk>=1.20.0",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.pytest.ini_options]
|
|
pythonpath = ["."]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
|
|
[tool.ruff.lint]
|
|
select = [
|
|
# pycodestyle
|
|
"E",
|
|
# Pyflakes
|
|
"F",
|
|
# pyupgrade
|
|
"UP",
|
|
# flake8-bugbear
|
|
"B",
|
|
# flake8-simplify
|
|
"SIM",
|
|
# isort
|
|
"I",
|
|
]
|
|
ignore = ["E501"]
|
|
|
|
[tool.ruff.format]
|
|
quote-style = "single"
|
|
indent-style = "space"
|
|
docstring-code-format = true
|
|
|
|
[tool.pyright]
|
|
include = ["graphiti_core"]
|
|
pythonVersion = "3.10"
|
|
typeCheckingMode = "basic"
|