iris-vector-graph 1.0.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.
- iris_vector_graph-1.0.0/.env.sample +3 -0
- iris_vector_graph-1.0.0/.env.test +14 -0
- iris_vector_graph-1.0.0/.gitignore +111 -0
- iris_vector_graph-1.0.0/.python-version +1 -0
- iris_vector_graph-1.0.0/CHANGELOG.md +109 -0
- iris_vector_graph-1.0.0/CLAUDE.md +434 -0
- iris_vector_graph-1.0.0/LICENSE +21 -0
- iris_vector_graph-1.0.0/MANIFEST.in +10 -0
- iris_vector_graph-1.0.0/PKG-INFO +436 -0
- iris_vector_graph-1.0.0/PRD.md +199 -0
- iris_vector_graph-1.0.0/PRE_PUBLICATION_REVIEW.md +288 -0
- iris_vector_graph-1.0.0/PYPI_CHECKLIST.md +178 -0
- iris_vector_graph-1.0.0/PYPI_PUBLICATION_GUIDE.md +292 -0
- iris_vector_graph-1.0.0/README.md +369 -0
- iris_vector_graph-1.0.0/TEST_REPORT.md +256 -0
- iris_vector_graph-1.0.0/TODO.md +314 -0
- iris_vector_graph-1.0.0/api/__init__.py +0 -0
- iris_vector_graph-1.0.0/api/gql/__init__.py +0 -0
- iris_vector_graph-1.0.0/api/gql/core/__init__.py +0 -0
- iris_vector_graph-1.0.0/api/gql/core/domain_resolver.py +164 -0
- iris_vector_graph-1.0.0/api/gql/core/loaders.py +164 -0
- iris_vector_graph-1.0.0/api/gql/core/resolvers.py +237 -0
- iris_vector_graph-1.0.0/api/gql/core/types.py +159 -0
- iris_vector_graph-1.0.0/api/gql/loaders.py +343 -0
- iris_vector_graph-1.0.0/api/gql/resolvers/__init__.py +0 -0
- iris_vector_graph-1.0.0/api/gql/resolvers/mutation.py +291 -0
- iris_vector_graph-1.0.0/api/gql/resolvers/query.py +226 -0
- iris_vector_graph-1.0.0/api/gql/schema.py +135 -0
- iris_vector_graph-1.0.0/api/gql/types.py +438 -0
- iris_vector_graph-1.0.0/api/main.py +229 -0
- iris_vector_graph-1.0.0/api/models/__init__.py +0 -0
- iris_vector_graph-1.0.0/api/models/cypher.py +249 -0
- iris_vector_graph-1.0.0/api/routers/__init__.py +0 -0
- iris_vector_graph-1.0.0/api/routers/cypher.py +216 -0
- iris_vector_graph-1.0.0/benchmarking/README.md +384 -0
- iris_vector_graph-1.0.0/benchmarking/framework/benchmark_config.py +324 -0
- iris_vector_graph-1.0.0/benchmarking/framework/benchmark_runner.py +576 -0
- iris_vector_graph-1.0.0/benchmarking/framework/data_manager.py +472 -0
- iris_vector_graph-1.0.0/benchmarking/framework/environment_manager.py +332 -0
- iris_vector_graph-1.0.0/benchmarking/framework/performance_monitor.py +491 -0
- iris_vector_graph-1.0.0/benchmarking/framework/query_generator.py +478 -0
- iris_vector_graph-1.0.0/benchmarking/run_competitive_benchmark.py +248 -0
- iris_vector_graph-1.0.0/biomedical/__init__.py +12 -0
- iris_vector_graph-1.0.0/biomedical/biomedical_engine.py +303 -0
- iris_vector_graph-1.0.0/biomedical/biomedical_schema.py +338 -0
- iris_vector_graph-1.0.0/biomedical/legacy_wrapper.py +136 -0
- iris_vector_graph-1.0.0/cypher/hybrid_vector_graph_query.cypher +181 -0
- iris_vector_graph-1.0.0/docker/Dockerfile.fraud-embedded +52 -0
- iris_vector_graph-1.0.0/docker/merge.cpf +3 -0
- iris_vector_graph-1.0.0/docker/start-fraud-api-only.sh +17 -0
- iris_vector_graph-1.0.0/docker/start-fraud-server.sh +117 -0
- iris_vector_graph-1.0.0/docker-compose.acorn.yml +38 -0
- iris_vector_graph-1.0.0/docker-compose.fraud-community.yml +54 -0
- iris_vector_graph-1.0.0/docker-compose.fraud-embedded.yml +46 -0
- iris_vector_graph-1.0.0/docker-compose.test.yml +26 -0
- iris_vector_graph-1.0.0/docs/ENTERPRISE_ROADMAP.md +234 -0
- iris_vector_graph-1.0.0/docs/FRAUD_COMMUNITY_EDITION.md +245 -0
- iris_vector_graph-1.0.0/docs/FRAUD_FINANCIAL_SERVICES_SUMMARY.md +350 -0
- iris_vector_graph-1.0.0/docs/FRAUD_IMPLEMENTATION_SUMMARY.md +271 -0
- iris_vector_graph-1.0.0/docs/FRAUD_SCALE_TESTING.md +243 -0
- iris_vector_graph-1.0.0/docs/FRAUD_SCORING_SCALE_TEST_RESULTS.md +253 -0
- iris_vector_graph-1.0.0/docs/GRAPH_PRIMITIVES.md +149 -0
- iris_vector_graph-1.0.0/docs/GRAPH_PRIMITIVES_IMPLEMENTATION_ASSESSMENT.md +313 -0
- iris_vector_graph-1.0.0/docs/IRIS_EMBEDDED_PYTHON_LESSONS.md +139 -0
- iris_vector_graph-1.0.0/docs/advanced-graph-sql-patterns.md +371 -0
- iris_vector_graph-1.0.0/docs/algorithms/TSP_ANALYSIS.md +633 -0
- iris_vector_graph-1.0.0/docs/algorithms/TSP_IMPLEMENTATION_SUMMARY.md +399 -0
- iris_vector_graph-1.0.0/docs/api/REST_API.md +468 -0
- iris_vector_graph-1.0.0/docs/architecture/ACTUAL_SCHEMA.md +209 -0
- iris_vector_graph-1.0.0/docs/architecture/ARCHITECTURE.md +201 -0
- iris_vector_graph-1.0.0/docs/architecture/COMPETITIVE_ADVANTAGES.md +321 -0
- iris_vector_graph-1.0.0/docs/architecture/QUERY_PATTERNS.md +313 -0
- iris_vector_graph-1.0.0/docs/architecture/cypher_to_sql_translation.md +703 -0
- iris_vector_graph-1.0.0/docs/architecture/embedded_python_architecture.md +338 -0
- iris_vector_graph-1.0.0/docs/architecture/generic_graph_api_design.md +571 -0
- iris_vector_graph-1.0.0/docs/benchmarking/BENCHMARKING_TECHNICAL_SPEC.md +477 -0
- iris_vector_graph-1.0.0/docs/benchmarking/COMPETITIVE_BENCHMARKING_DESIGN.md +311 -0
- iris_vector_graph-1.0.0/docs/biomedical-demo-setup.md +300 -0
- iris_vector_graph-1.0.0/docs/design/cypher_parser_prototype.md +681 -0
- iris_vector_graph-1.0.0/docs/examples/CAREGIVER_ROUTING_DEMO.md +400 -0
- iris_vector_graph-1.0.0/docs/performance/ACORN-1_vs_Community_Performance_Comparison.md +199 -0
- iris_vector_graph-1.0.0/docs/performance/BENCHMARKS.md +247 -0
- iris_vector_graph-1.0.0/docs/performance/BIOMEDICAL_DATASETS.md +177 -0
- iris_vector_graph-1.0.0/docs/performance/graph_analytics_roadmap.md +386 -0
- iris_vector_graph-1.0.0/docs/performance/nodepk_benchmark_results.md +342 -0
- iris_vector_graph-1.0.0/docs/performance/nodepk_production_scale_projections.md +368 -0
- iris_vector_graph-1.0.0/docs/performance/performance_bottleneck_analysis.md +232 -0
- iris_vector_graph-1.0.0/docs/progress/graphql_implementation_status.md +444 -0
- iris_vector_graph-1.0.0/docs/progress/opencypher_implementation_complete.md +504 -0
- iris_vector_graph-1.0.0/docs/progress/phase2_refactoring_summary.md +369 -0
- iris_vector_graph-1.0.0/docs/python/PYTHON_SDK.md +590 -0
- iris_vector_graph-1.0.0/docs/research/sqlalchemy_graphql_integration.md +520 -0
- iris_vector_graph-1.0.0/docs/roadmap/graphql_endpoint_design.md +1062 -0
- iris_vector_graph-1.0.0/docs/roadmap/phase_2_opencypher_implementation.md +741 -0
- iris_vector_graph-1.0.0/docs/setup/DATA_FORMATS.md +295 -0
- iris_vector_graph-1.0.0/docs/setup/IRIS_PASSWORD_RESET.md +190 -0
- iris_vector_graph-1.0.0/docs/setup/QUICKSTART.md +185 -0
- iris_vector_graph-1.0.0/docs/setup/UV_SETUP.md +333 -0
- iris_vector_graph-1.0.0/examples/bitemporal/README.md +292 -0
- iris_vector_graph-1.0.0/examples/bitemporal/bitemporal_fraud.py +518 -0
- iris_vector_graph-1.0.0/examples/domains/__init__.py +0 -0
- iris_vector_graph-1.0.0/examples/domains/biomedical/__init__.py +0 -0
- iris_vector_graph-1.0.0/examples/domains/biomedical/loaders.py +191 -0
- iris_vector_graph-1.0.0/examples/domains/biomedical/resolver.py +363 -0
- iris_vector_graph-1.0.0/examples/domains/biomedical/types.py +366 -0
- iris_vector_graph-1.0.0/examples/graphQL.http +27 -0
- iris_vector_graph-1.0.0/examples/rest.http +35 -0
- iris_vector_graph-1.0.0/examples/tsp_integration_example.py +386 -0
- iris_vector_graph-1.0.0/graphrag_hybrid_comparison.py +375 -0
- iris_vector_graph-1.0.0/iris/src/Graph/CaregiverRouter.cls +361 -0
- iris_vector_graph-1.0.0/iris/src/Graph/Index/KG_Out.idx.cls +28 -0
- iris_vector_graph-1.0.0/iris/src/Graph/KG/PyOps.cls +68 -0
- iris_vector_graph-1.0.0/iris/src/Graph/KG/Service.cls +78 -0
- iris_vector_graph-1.0.0/iris/src/Graph/KG/Traversal.cls +86 -0
- iris_vector_graph-1.0.0/iris/src/Graph/Messages/OptimizeScheduleRequest.cls +38 -0
- iris_vector_graph-1.0.0/iris/src/Graph/Messages/OptimizeScheduleResponse.cls +50 -0
- iris_vector_graph-1.0.0/iris/src/Graph/ScheduleOptimizationProcess.cls +226 -0
- iris_vector_graph-1.0.0/iris/src/Graph/TestCaregiverRouter.mac +172 -0
- iris_vector_graph-1.0.0/iris/src/PageRankEmbedded.cls +249 -0
- iris_vector_graph-1.0.0/iris/src/iris_vector_graph/GraphOperators.cls +203 -0
- iris_vector_graph-1.0.0/iris_vector_graph_core/__init__.py +28 -0
- iris_vector_graph-1.0.0/iris_vector_graph_core/cypher/__init__.py +0 -0
- iris_vector_graph-1.0.0/iris_vector_graph_core/cypher/ast.py +323 -0
- iris_vector_graph-1.0.0/iris_vector_graph_core/cypher/parser.py +362 -0
- iris_vector_graph-1.0.0/iris_vector_graph_core/cypher/translator.py +388 -0
- iris_vector_graph-1.0.0/iris_vector_graph_core/engine.py +369 -0
- iris_vector_graph-1.0.0/iris_vector_graph_core/fusion.py +289 -0
- iris_vector_graph-1.0.0/iris_vector_graph_core/gql/__init__.py +0 -0
- iris_vector_graph-1.0.0/iris_vector_graph_core/schema.py +173 -0
- iris_vector_graph-1.0.0/iris_vector_graph_core/text_search.py +242 -0
- iris_vector_graph-1.0.0/iris_vector_graph_core/vector_utils.py +384 -0
- iris_vector_graph-1.0.0/models/fraud_mlp.torchscript +0 -0
- iris_vector_graph-1.0.0/package.json +28 -0
- iris_vector_graph-1.0.0/pyproject.toml +216 -0
- iris_vector_graph-1.0.0/python/demo_working_system.py +180 -0
- iris_vector_graph-1.0.0/python/iris_vector_graph_operators.py +787 -0
- iris_vector_graph-1.0.0/python/pagerank_embedded.py +198 -0
- iris_vector_graph-1.0.0/python/vector_sql_utils.py +571 -0
- iris_vector_graph-1.0.0/scripts/__init__.py +0 -0
- iris_vector_graph-1.0.0/scripts/algorithms/tsp_demo.py +356 -0
- iris_vector_graph-1.0.0/scripts/create_dummy_model.py +81 -0
- iris_vector_graph-1.0.0/scripts/demo/end_to_end_workflow.py +631 -0
- iris_vector_graph-1.0.0/scripts/deploy_graph_tvfs.py +243 -0
- iris_vector_graph-1.0.0/scripts/fraud/benchmark_fraud_at_scale.py +167 -0
- iris_vector_graph-1.0.0/scripts/fraud/benchmark_fraud_performance.py +310 -0
- iris_vector_graph-1.0.0/scripts/fraud/diagnose_performance.py +137 -0
- iris_vector_graph-1.0.0/scripts/fraud/load_fraud_schema.py +119 -0
- iris_vector_graph-1.0.0/scripts/fraud/load_fraud_schema_embedded.py +241 -0
- iris_vector_graph-1.0.0/scripts/fraud/load_sample_events.py +217 -0
- iris_vector_graph-1.0.0/scripts/fraud/load_sample_events_embedded.py +231 -0
- iris_vector_graph-1.0.0/scripts/fraud/monitor_scale.py +96 -0
- iris_vector_graph-1.0.0/scripts/fraud/quickstart.py +276 -0
- iris_vector_graph-1.0.0/scripts/fraud/setup_fraud_mvp.sh +190 -0
- iris_vector_graph-1.0.0/scripts/fraud/stress_test_fraud.py +255 -0
- iris_vector_graph-1.0.0/scripts/fraud/validate_mvp.py +337 -0
- iris_vector_graph-1.0.0/scripts/ingest/networkx_loader.py +521 -0
- iris_vector_graph-1.0.0/scripts/load-test-data.js +211 -0
- iris_vector_graph-1.0.0/scripts/migrate_vector_data.py +288 -0
- iris_vector_graph-1.0.0/scripts/migrations/__init__.py +0 -0
- iris_vector_graph-1.0.0/scripts/migrations/migrate_to_nodepk.py +743 -0
- iris_vector_graph-1.0.0/scripts/performance/pmc_scale_test.py +547 -0
- iris_vector_graph-1.0.0/scripts/performance/scale_test.py +439 -0
- iris_vector_graph-1.0.0/scripts/performance/string_db_scale_test.py +815 -0
- iris_vector_graph-1.0.0/scripts/run_complete_validation.py +144 -0
- iris_vector_graph-1.0.0/scripts/sample_data.sql +29 -0
- iris_vector_graph-1.0.0/scripts/sample_data_768.sql +43 -0
- iris_vector_graph-1.0.0/scripts/setup/setup-test-env.sh +332 -0
- iris_vector_graph-1.0.0/scripts/setup/setup_acorn_test.sh +71 -0
- iris_vector_graph-1.0.0/scripts/setup/setup_scale_test.sh +71 -0
- iris_vector_graph-1.0.0/scripts/setup/stop-test-env.sh +109 -0
- iris_vector_graph-1.0.0/scripts/testing/run-tests.sh +216 -0
- iris_vector_graph-1.0.0/scripts/validate_integration.py +405 -0
- iris_vector_graph-1.0.0/sql/bitemporal/example_queries.sql +340 -0
- iris_vector_graph-1.0.0/sql/bitemporal/schema.sql +214 -0
- iris_vector_graph-1.0.0/sql/caregiver_routing_demo.sql +180 -0
- iris_vector_graph-1.0.0/sql/fraud/procedures.sql +38 -0
- iris_vector_graph-1.0.0/sql/fraud/schema.sql +44 -0
- iris_vector_graph-1.0.0/sql/globals_schema.sql +135 -0
- iris_vector_graph-1.0.0/sql/graph_path_globals.sql +322 -0
- iris_vector_graph-1.0.0/sql/graph_walk_tvf.sql +97 -0
- iris_vector_graph-1.0.0/sql/migrations/000_base_schema_iris.sql +54 -0
- iris_vector_graph-1.0.0/sql/migrations/001_add_nodepk_table.sql +19 -0
- iris_vector_graph-1.0.0/sql/migrations/001_rollback_nodepk.sql +29 -0
- iris_vector_graph-1.0.0/sql/migrations/002_add_fk_constraints.sql +27 -0
- iris_vector_graph-1.0.0/sql/operators.sql +109 -0
- iris_vector_graph-1.0.0/sql/operators_fixed.sql +134 -0
- iris_vector_graph-1.0.0/sql/procedures/kg_PageRank.sql +64 -0
- iris_vector_graph-1.0.0/sql/schema.sql +54 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/README.md +122 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/__init__.py +0 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/app.py +350 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/models/__init__.py +0 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/models/biomedical.py +222 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/models/fraud.py +164 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/models/metrics.py +53 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/models/session.py +71 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/routes/__init__.py +0 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/routes/biomedical.py +1373 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/routes/fraud.py +467 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/services/__init__.py +0 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/services/biomedical_client.py +268 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/services/fraud_client.py +142 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/services/iris_biomedical_client.py +384 -0
- iris_vector_graph-1.0.0/src/iris_demo_server/templates/__init__.py +0 -0
- iris_vector_graph-1.0.0/src/iris_fraud_server/__init__.py +26 -0
- iris_vector_graph-1.0.0/src/iris_fraud_server/__main__.py +21 -0
- iris_vector_graph-1.0.0/src/iris_fraud_server/app.py +564 -0
- iris_vector_graph-1.0.0/test_fk_constraints.py +38 -0
- iris_vector_graph-1.0.0/tests/contract/__init__.py +0 -0
- iris_vector_graph-1.0.0/tests/contract/test_cypher_api.py +212 -0
- iris_vector_graph-1.0.0/tests/contract/test_cypher_api_errors.py +238 -0
- iris_vector_graph-1.0.0/tests/contract/test_graphql_queries.py +268 -0
- iris_vector_graph-1.0.0/tests/contract/test_graphql_schema.py +327 -0
- iris_vector_graph-1.0.0/tests/demo/__init__.py +0 -0
- iris_vector_graph-1.0.0/tests/demo/contract/test_bio_network.py +142 -0
- iris_vector_graph-1.0.0/tests/demo/contract/test_bio_pathway.py +125 -0
- iris_vector_graph-1.0.0/tests/demo/contract/test_bio_scenario.py +81 -0
- iris_vector_graph-1.0.0/tests/demo/contract/test_bio_search.py +166 -0
- iris_vector_graph-1.0.0/tests/demo/contract/test_fraud_score.py +156 -0
- iris_vector_graph-1.0.0/tests/e2e/__init__.py +3 -0
- iris_vector_graph-1.0.0/tests/e2e/test_multi_query_engine_platform.py +502 -0
- iris_vector_graph-1.0.0/tests/fraud/test_fraud_api.py +154 -0
- iris_vector_graph-1.0.0/tests/fraud/test_fraud_integration.py +234 -0
- iris_vector_graph-1.0.0/tests/integration/gql/__init__.py +0 -0
- iris_vector_graph-1.0.0/tests/integration/gql/test_graphql_mutations.py +510 -0
- iris_vector_graph-1.0.0/tests/integration/gql/test_graphql_nested_queries.py +297 -0
- iris_vector_graph-1.0.0/tests/integration/gql/test_graphql_queries.py +345 -0
- iris_vector_graph-1.0.0/tests/integration/gql/test_graphql_vector_search.py +293 -0
- iris_vector_graph-1.0.0/tests/integration/test_fastapi_graphql.py +207 -0
- iris_vector_graph-1.0.0/tests/integration/test_nodepk_advanced_benchmarks.py +562 -0
- iris_vector_graph-1.0.0/tests/integration/test_nodepk_constraints.py +609 -0
- iris_vector_graph-1.0.0/tests/integration/test_nodepk_graph_analytics.py +599 -0
- iris_vector_graph-1.0.0/tests/integration/test_nodepk_migration.py +514 -0
- iris_vector_graph-1.0.0/tests/integration/test_nodepk_performance.py +229 -0
- iris_vector_graph-1.0.0/tests/integration/test_nodepk_production_scale.py +542 -0
- iris_vector_graph-1.0.0/tests/integration/test_pagerank_sql_optimization.py +385 -0
- iris_vector_graph-1.0.0/tests/python/run_all_tests.py +384 -0
- iris_vector_graph-1.0.0/tests/python/test_iris_rest_api.py +448 -0
- iris_vector_graph-1.0.0/tests/python/test_networkx_loader.py +547 -0
- iris_vector_graph-1.0.0/tests/python/test_performance_benchmarks.py +559 -0
- iris_vector_graph-1.0.0/tests/python/test_python_operators.py +284 -0
- iris_vector_graph-1.0.0/tests/python/test_python_sdk.py +856 -0
- iris_vector_graph-1.0.0/tests/python/test_schema_validation.py +704 -0
- iris_vector_graph-1.0.0/tests/python/test_sql_queries.py +537 -0
- iris_vector_graph-1.0.0/tests/python/test_vector_functions.py +275 -0
- iris_vector_graph-1.0.0/tests/test_working_system.py +266 -0
- iris_vector_graph-1.0.0/tests/unit/test_graphql_dataloader.py +262 -0
- iris_vector_graph-1.0.0/uv.lock +3562 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Test Environment Configuration for Graph AI
|
|
2
|
+
# IRIS Test Database Connection (runs on different ports to avoid conflicts)
|
|
3
|
+
IRIS_DSN=IRIS_TEST
|
|
4
|
+
IRIS_USER=_SYSTEM
|
|
5
|
+
IRIS_PASS=SYS
|
|
6
|
+
IRIS_HOST=localhost
|
|
7
|
+
IRIS_PORT=1973
|
|
8
|
+
IRIS_NAMESPACE=USER
|
|
9
|
+
|
|
10
|
+
# Test-specific settings
|
|
11
|
+
NODE_ENV=test
|
|
12
|
+
LOG_LEVEL=error
|
|
13
|
+
TEST_TIMEOUT=30000
|
|
14
|
+
JEST_TIMEOUT=60000
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules
|
|
3
|
+
dist
|
|
4
|
+
|
|
5
|
+
# Environment files
|
|
6
|
+
.env
|
|
7
|
+
.env.local
|
|
8
|
+
.env.*.local
|
|
9
|
+
|
|
10
|
+
# Logs
|
|
11
|
+
*.log
|
|
12
|
+
npm-debug.log*
|
|
13
|
+
yarn-debug.log*
|
|
14
|
+
yarn-error.log*
|
|
15
|
+
|
|
16
|
+
# OS generated files
|
|
17
|
+
.DS_Store
|
|
18
|
+
.DS_Store?
|
|
19
|
+
._*
|
|
20
|
+
.Spotlight-V100
|
|
21
|
+
.Trashes
|
|
22
|
+
ehthumbs.db
|
|
23
|
+
Thumbs.db
|
|
24
|
+
|
|
25
|
+
# Backup files
|
|
26
|
+
*.bak
|
|
27
|
+
*.tmp
|
|
28
|
+
*.orig
|
|
29
|
+
*~
|
|
30
|
+
|
|
31
|
+
# Archives
|
|
32
|
+
*.zip
|
|
33
|
+
*.tar.gz
|
|
34
|
+
*.tar
|
|
35
|
+
*.rar
|
|
36
|
+
|
|
37
|
+
# Data directories (large test datasets)
|
|
38
|
+
data/
|
|
39
|
+
|
|
40
|
+
# License files (sensitive)
|
|
41
|
+
*.key
|
|
42
|
+
|
|
43
|
+
# IDE/Editor files
|
|
44
|
+
.vscode/
|
|
45
|
+
.idea/
|
|
46
|
+
*.swp
|
|
47
|
+
*.swo
|
|
48
|
+
|
|
49
|
+
# Claude configuration
|
|
50
|
+
.claude/
|
|
51
|
+
|
|
52
|
+
# Test coverage
|
|
53
|
+
coverage/
|
|
54
|
+
.nyc_output
|
|
55
|
+
|
|
56
|
+
# Python cache
|
|
57
|
+
__pycache__/
|
|
58
|
+
*.py[cod]
|
|
59
|
+
*$py.class
|
|
60
|
+
*.so
|
|
61
|
+
.Python
|
|
62
|
+
build/
|
|
63
|
+
develop-eggs/
|
|
64
|
+
downloads/
|
|
65
|
+
eggs/
|
|
66
|
+
.eggs/
|
|
67
|
+
lib/
|
|
68
|
+
lib64/
|
|
69
|
+
parts/
|
|
70
|
+
sdist/
|
|
71
|
+
var/
|
|
72
|
+
wheels/
|
|
73
|
+
*.egg-info/
|
|
74
|
+
.installed.cfg
|
|
75
|
+
*.egg
|
|
76
|
+
|
|
77
|
+
# UV package manager
|
|
78
|
+
.uv/
|
|
79
|
+
|
|
80
|
+
# Virtual environments
|
|
81
|
+
.venv/
|
|
82
|
+
venv/
|
|
83
|
+
ENV/
|
|
84
|
+
env/
|
|
85
|
+
|
|
86
|
+
# Python testing
|
|
87
|
+
.pytest_cache/
|
|
88
|
+
.coverage
|
|
89
|
+
htmlcov/
|
|
90
|
+
.tox/
|
|
91
|
+
|
|
92
|
+
# Type checking
|
|
93
|
+
.mypy_cache/
|
|
94
|
+
.dmypy.json
|
|
95
|
+
dmypy.json
|
|
96
|
+
|
|
97
|
+
# Jupyter Notebook
|
|
98
|
+
.ipynb_checkpoints
|
|
99
|
+
|
|
100
|
+
# Test results
|
|
101
|
+
test_results.json
|
|
102
|
+
|
|
103
|
+
# Code assistant artifacts
|
|
104
|
+
.claude-code/
|
|
105
|
+
.sesskey
|
|
106
|
+
*.sesskey
|
|
107
|
+
IMPLEMENTATION_COMPLETE.md
|
|
108
|
+
|
|
109
|
+
# Specification drafts (work in progress)
|
|
110
|
+
specs/
|
|
111
|
+
.specify/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.0] - 2025-10-19
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
#### Core Features
|
|
13
|
+
- **IRIS-Native Graph Database**: RDF-based schema (`rdf_labels`, `rdf_props`, `rdf_edges`) with native IRIS globals storage
|
|
14
|
+
- **Vector Search with HNSW**: 768-dimensional embeddings with HNSW optimization (100x performance improvement)
|
|
15
|
+
- **Hybrid Search**: RRF fusion combining vector similarity + text search + graph constraints
|
|
16
|
+
- **Bitemporal Data Model**: Track valid time vs. system time for regulatory compliance (SOX, MiFID II, Basel III)
|
|
17
|
+
- **Embedded Python**: Run ML models and graph algorithms in-database using `/usr/irissys/bin/irispython`
|
|
18
|
+
|
|
19
|
+
#### Deployment Modes
|
|
20
|
+
- **External Deployment (DEFAULT)**: Python app connects to IRIS via `iris.connect()` - simpler setup, easier debugging
|
|
21
|
+
- **Embedded Deployment (OPTIONAL)**: Python app runs inside IRIS container - maximum performance, requires licensed IRIS
|
|
22
|
+
|
|
23
|
+
#### Financial Services (Fraud Detection)
|
|
24
|
+
- Real-time fraud scoring API (<10ms) with MLP models
|
|
25
|
+
- Device fingerprinting and graph-based fraud ring detection
|
|
26
|
+
- Bitemporal audit trails for chargeback defense
|
|
27
|
+
- Tested at scale: 130M transactions (licensed IRIS), 30M transactions (community IRIS)
|
|
28
|
+
- FastAPI fraud server with external and embedded deployment options
|
|
29
|
+
|
|
30
|
+
#### Biomedical Research
|
|
31
|
+
- **Interactive Demo Server**: http://localhost:8200/bio
|
|
32
|
+
- **STRING Database Integration**: 10K proteins, 37K interactions from STRING v12.0
|
|
33
|
+
- **Protein Search**: Vector similarity search with HNSW (<2ms queries)
|
|
34
|
+
- **Network Expansion**: Interactive D3.js visualization with click-to-expand nodes
|
|
35
|
+
- **Pathway Analysis**: BFS pathfinding between proteins with confidence scoring
|
|
36
|
+
- **Contract Tests**: 20/20 passing (search 6/6, network 5/5, pathway 4/4, scenario 5/5)
|
|
37
|
+
|
|
38
|
+
#### Performance Optimizations
|
|
39
|
+
- **HNSW Vector Index**: 1.7ms vs 5800ms flat search (3400x improvement with ACORN-1)
|
|
40
|
+
- **Partial Indexes**: 10x faster queries with `WHERE system_to IS NULL`
|
|
41
|
+
- **Foreign Key Constraints**: Referential integrity with 64% performance improvement
|
|
42
|
+
- **Bounded Graph Queries**: Max 500 nodes per network expansion (FR-018)
|
|
43
|
+
|
|
44
|
+
#### Python SDK (`iris_vector_graph_core`)
|
|
45
|
+
- `IRISGraphEngine` - Core graph operations
|
|
46
|
+
- `HybridSearchFusion` - RRF fusion algorithms
|
|
47
|
+
- `TextSearchEngine` - IRIS iFind integration
|
|
48
|
+
- `VectorOptimizer` - HNSW optimization utilities
|
|
49
|
+
- `BiomedicalClient` - Direct IRIS queries for protein data
|
|
50
|
+
|
|
51
|
+
#### Documentation
|
|
52
|
+
- Comprehensive README with quick start for both domains
|
|
53
|
+
- Deployment mode clarity: External (DEFAULT) vs Embedded (ADVANCED)
|
|
54
|
+
- `CLAUDE.md` - Development guidance and architecture
|
|
55
|
+
- `TODO.md` - Project roadmap and completed milestones
|
|
56
|
+
- `PYPI_CHECKLIST.md` - Publication preparation guide
|
|
57
|
+
- Performance benchmarks and scale testing results
|
|
58
|
+
|
|
59
|
+
### Technical Details
|
|
60
|
+
|
|
61
|
+
#### Database Schema
|
|
62
|
+
- **Nodes Table**: `rdf_labels` with explicit PRIMARY KEY (NodePK implementation)
|
|
63
|
+
- **Properties Table**: `rdf_props` with key-value pairs
|
|
64
|
+
- **Edges Table**: `rdf_edges` with confidence scores and qualifiers
|
|
65
|
+
- **Embeddings Table**: `kg_NodeEmbeddings_optimized` with VECTOR(FLOAT, 768) type
|
|
66
|
+
- **Documents Table**: `kg_Documents` for full-text search
|
|
67
|
+
|
|
68
|
+
#### SQL Procedures
|
|
69
|
+
- `kg_KNN_VEC`: Vector similarity search with HNSW
|
|
70
|
+
- `kg_TXT`: Full-text search using IRIS iFind
|
|
71
|
+
- `kg_RRF_FUSE`: Reciprocal Rank Fusion (Cormack & Clarke SIGIR'09)
|
|
72
|
+
- `kg_GRAPH_PATH`: Graph pathfinding with bounded hops
|
|
73
|
+
|
|
74
|
+
#### Performance Metrics
|
|
75
|
+
- Vector search: <10ms (HNSW), <2ms (ACORN-1)
|
|
76
|
+
- Graph queries: <1ms (bounded hops)
|
|
77
|
+
- Fraud scoring: <10ms (130M transactions)
|
|
78
|
+
- Data ingestion: 476 proteins/second (STRING DB)
|
|
79
|
+
- Multi-hop queries: <50ms (100K+ proteins)
|
|
80
|
+
|
|
81
|
+
### Known Limitations
|
|
82
|
+
- IRIS database required (InterSystems IRIS 2025.1+)
|
|
83
|
+
- HNSW optimization requires ACORN-1 or IRIS 2025.3+
|
|
84
|
+
- Embedded deployment requires licensed IRIS
|
|
85
|
+
- Python 3.11+ required
|
|
86
|
+
|
|
87
|
+
### Dependencies
|
|
88
|
+
- `intersystems-irispython>=3.2.0` - IRIS database connectivity
|
|
89
|
+
- `fastapi>=0.118.0` - Web framework for APIs
|
|
90
|
+
- `networkx>=3.0` - Graph algorithms
|
|
91
|
+
- `torch>=2.0.0` - ML model support (optional)
|
|
92
|
+
- `sentence-transformers>=2.2.0` - Embeddings (optional)
|
|
93
|
+
|
|
94
|
+
### Testing
|
|
95
|
+
- 20/20 biomedical contract tests passing
|
|
96
|
+
- Integration tests with live IRIS database
|
|
97
|
+
- Performance benchmarks at scale (10K-100K proteins, 30M-130M transactions)
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## [Unreleased]
|
|
102
|
+
|
|
103
|
+
### Planned Features
|
|
104
|
+
- openCypher API endpoint (branch: `002-add-opencypher-endpoint`)
|
|
105
|
+
- GraphQL API with DataLoader batching (merged)
|
|
106
|
+
- Multi-query-engine platform (SQL, openCypher, GraphQL)
|
|
107
|
+
- Production hardening (SSL/TLS, monitoring, backup procedures)
|
|
108
|
+
|
|
109
|
+
[1.0.0]: https://github.com/intersystems-community/iris-vector-graph/releases/tag/v1.0.0
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Development Commands
|
|
6
|
+
|
|
7
|
+
### Environment Setup
|
|
8
|
+
```bash
|
|
9
|
+
# Initial setup (using uv for modern Python package management)
|
|
10
|
+
uv sync # Install dependencies via pyproject.toml
|
|
11
|
+
source .venv/bin/activate # Activate virtual environment
|
|
12
|
+
|
|
13
|
+
# Alternative (if using requirements.txt)
|
|
14
|
+
cp .env.sample .env # Edit connection details for IRIS
|
|
15
|
+
uv venv
|
|
16
|
+
uv pip install -r requirements.txt
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Database Setup
|
|
20
|
+
|
|
21
|
+
**Option 1: Docker (Recommended)**
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Standard IRIS Community Edition
|
|
25
|
+
docker-compose up -d
|
|
26
|
+
|
|
27
|
+
# ACORN-1 (pre-release build with HNSW optimization - fastest)
|
|
28
|
+
docker-compose -f docker-compose.acorn.yml up -d
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Option 2: Manual IRIS Installation**
|
|
32
|
+
|
|
33
|
+
Requires **InterSystems IRIS 2025.1+** with Vector Search (HNSW) feature:
|
|
34
|
+
|
|
35
|
+
```sql
|
|
36
|
+
-- Run in IRIS SQL tool
|
|
37
|
+
\i sql/schema.sql
|
|
38
|
+
\i sql/operators.sql # Use operators_fixed.sql if this fails
|
|
39
|
+
\i scripts/sample_data.sql # Optional sample data
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Access IRIS Management Portal: http://localhost:52773/csp/sys/UtilHome.csp (or port 252773 for ACORN-1)
|
|
43
|
+
|
|
44
|
+
### GraphQL API Server
|
|
45
|
+
```bash
|
|
46
|
+
# Start GraphQL API server (FastAPI + Strawberry)
|
|
47
|
+
uvicorn api.main:app --reload --port 8000
|
|
48
|
+
|
|
49
|
+
# Access GraphQL Playground UI
|
|
50
|
+
open http://localhost:8000/graphql
|
|
51
|
+
|
|
52
|
+
# Health check
|
|
53
|
+
curl http://localhost:8000/health
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Testing
|
|
57
|
+
```bash
|
|
58
|
+
# Run test suite
|
|
59
|
+
uv run python tests/python/run_all_tests.py # All tests
|
|
60
|
+
uv run python tests/python/run_all_tests.py --quick # Quick validation
|
|
61
|
+
|
|
62
|
+
# GraphQL API tests
|
|
63
|
+
pytest tests/integration/gql/ # GraphQL resolvers
|
|
64
|
+
pytest tests/integration/test_fastapi_graphql.py # FastAPI endpoint
|
|
65
|
+
|
|
66
|
+
# Direct pytest execution
|
|
67
|
+
pytest tests/ # All tests
|
|
68
|
+
pytest tests/unit/ # Unit tests only
|
|
69
|
+
pytest tests/integration/ # Integration tests only
|
|
70
|
+
pytest -m requires_database # Database-dependent tests
|
|
71
|
+
pytest --cov=iris_vector_graph_core # With coverage
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Development Operations
|
|
75
|
+
```bash
|
|
76
|
+
# Schema and data management
|
|
77
|
+
python scripts/setup_schema.py # Initialize database schema
|
|
78
|
+
python scripts/sample_data.py # Load sample data
|
|
79
|
+
|
|
80
|
+
# Performance testing
|
|
81
|
+
uv run python scripts/performance/test_vector_performance.py
|
|
82
|
+
uv run python scripts/performance/string_db_scale_test.py --max-proteins 10000
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### openCypher API Server
|
|
86
|
+
```bash
|
|
87
|
+
# Start openCypher API server (ASGI)
|
|
88
|
+
uvicorn api.main:app --reload --port 8000
|
|
89
|
+
|
|
90
|
+
# Alternative: Direct execution
|
|
91
|
+
uv run uvicorn api.main:app --reload --port 8000
|
|
92
|
+
|
|
93
|
+
# Access API documentation
|
|
94
|
+
open http://localhost:8000/docs # Swagger UI
|
|
95
|
+
open http://localhost:8000 # API info
|
|
96
|
+
|
|
97
|
+
# Health check
|
|
98
|
+
curl http://localhost:8000/health
|
|
99
|
+
|
|
100
|
+
# Execute Cypher query
|
|
101
|
+
curl -X POST http://localhost:8000/api/cypher \
|
|
102
|
+
-H "Content-Type: application/json" \
|
|
103
|
+
-d '{
|
|
104
|
+
"query": "MATCH (p:Protein {id: \"PROTEIN:TP53\"}) RETURN p.name",
|
|
105
|
+
"timeout": 30
|
|
106
|
+
}'
|
|
107
|
+
|
|
108
|
+
# Parameterized Cypher query
|
|
109
|
+
curl -X POST http://localhost:8000/api/cypher \
|
|
110
|
+
-H "Content-Type: application/json" \
|
|
111
|
+
-d '{
|
|
112
|
+
"query": "MATCH (p:Protein) WHERE p.id = $proteinId RETURN p.name",
|
|
113
|
+
"parameters": {"proteinId": "PROTEIN:TP53"}
|
|
114
|
+
}'
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Linting and Formatting
|
|
118
|
+
```bash
|
|
119
|
+
# Format code (per pyproject.toml configuration)
|
|
120
|
+
black .
|
|
121
|
+
isort .
|
|
122
|
+
|
|
123
|
+
# Lint code
|
|
124
|
+
flake8 .
|
|
125
|
+
mypy iris_vector_graph_core/
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Architecture Overview
|
|
129
|
+
|
|
130
|
+
This is a **Graph + Vector Retrieval** system targeting **InterSystems IRIS** that combines:
|
|
131
|
+
|
|
132
|
+
- **Vector search (HNSW)** + **lexical search** + **graph constraints**
|
|
133
|
+
- **openCypher query endpoint** for graph pattern matching
|
|
134
|
+
- **IRIS-native Python** integration with embedded operations
|
|
135
|
+
- **REST API** via FastAPI (openCypher) and IRIS ObjectScript classes
|
|
136
|
+
- **iris_vector_graph_core** Python module for high-performance operations
|
|
137
|
+
- **Direct iris.connect()** for optimal performance
|
|
138
|
+
|
|
139
|
+
### Query Engines
|
|
140
|
+
|
|
141
|
+
The system supports multiple query interfaces on the same NodePK schema:
|
|
142
|
+
|
|
143
|
+
1. **openCypher API** (`/api/cypher`) - Graph pattern matching with Cypher syntax
|
|
144
|
+
- Parser: Pattern-based MVP parser (regex-based for common queries)
|
|
145
|
+
- Translator: AST-to-SQL with label/property pushdown optimizations
|
|
146
|
+
- Endpoint: FastAPI async endpoint at http://localhost:8000/api/cypher
|
|
147
|
+
|
|
148
|
+
2. **SQL Direct** - Native IRIS SQL for maximum control
|
|
149
|
+
- Direct access to `nodes`, `rdf_edges`, `rdf_labels`, `rdf_props`, `kg_NodeEmbeddings`
|
|
150
|
+
- Full IRIS SQL capabilities including VECTOR functions
|
|
151
|
+
|
|
152
|
+
3. **GraphQL API** (on main branch) - Type-safe graph queries
|
|
153
|
+
- Generic core + domain-specific types (Protein, Gene, Pathway as examples)
|
|
154
|
+
- DataLoader batching for N+1 prevention
|
|
155
|
+
- Vector similarity via `similar()` field resolver
|
|
156
|
+
|
|
157
|
+
### Core Components
|
|
158
|
+
|
|
159
|
+
1. **SQL Layer** (`sql/`):
|
|
160
|
+
- `schema.sql` - RDF-ish tables (`rdf_labels`, `rdf_props`, `rdf_edges`) + vector embeddings table with HNSW index
|
|
161
|
+
- `operators.sql` - Stored procedures: `kg_KNN_VEC`, `kg_TXT`, `kg_RRF_FUSE`, `kg_GRAPH_PATH`
|
|
162
|
+
|
|
163
|
+
2. **Python SDK** (`python/`, `iris_vector_graph_core/`):
|
|
164
|
+
- `IRISGraphEngine` - Core graph operations and vector search
|
|
165
|
+
- `HybridSearchFusion` - RRF fusion of vector + text results
|
|
166
|
+
- `TextSearchEngine` - IRIS iFind integration
|
|
167
|
+
- `VectorOptimizer` - HNSW optimization utilities
|
|
168
|
+
|
|
169
|
+
3. **GraphQL API** (`api/gql/`):
|
|
170
|
+
- **Query Engines**: GraphQL + openCypher on top of generic graph database
|
|
171
|
+
- `schema.py` - Strawberry GraphQL schema composition
|
|
172
|
+
- `types.py` - Node interface, domain types (Protein, Gene, Pathway as EXAMPLES)
|
|
173
|
+
- `resolvers/` - Query, Mutation resolvers with DataLoader batching
|
|
174
|
+
- `loaders.py` - 6 DataLoaders for N+1 prevention (ProteinLoader, EdgeLoader, etc.)
|
|
175
|
+
- **FastAPI**: `/graphql` endpoint with Playground UI (port 8000)
|
|
176
|
+
|
|
177
|
+
4. **IRIS REST API** (`iris/src/`):
|
|
178
|
+
- `GraphAPI.cls` - REST endpoints for graph operations
|
|
179
|
+
- `VectorSearch.cls` - Vector similarity search endpoints
|
|
180
|
+
- `HybridSearch.cls` - Multi-modal search endpoints
|
|
181
|
+
|
|
182
|
+
5. **Performance Testing** (`scripts/performance/`):
|
|
183
|
+
- `test_vector_performance.py` - Vector search benchmarks
|
|
184
|
+
- `string_db_scale_test.py` - Large-scale biomedical testing
|
|
185
|
+
- `benchmark_suite.py` - Comprehensive performance analysis
|
|
186
|
+
|
|
187
|
+
### Environment Configuration
|
|
188
|
+
|
|
189
|
+
Configure IRIS connection in `.env`:
|
|
190
|
+
- `IRIS_HOST` - IRIS server hostname (default: localhost)
|
|
191
|
+
- `IRIS_PORT` - IRIS SuperServer port (default: 1972 or 21972 for ACORN-1)
|
|
192
|
+
- `IRIS_NAMESPACE` - IRIS namespace (default: USER)
|
|
193
|
+
- `IRIS_USER` - Database username (default: _SYSTEM)
|
|
194
|
+
- `IRIS_PASSWORD` - Database password (default: SYS)
|
|
195
|
+
|
|
196
|
+
### IRIS Docker Port Mapping Strategy
|
|
197
|
+
|
|
198
|
+
**Standardized Port Ranges** (per constitution):
|
|
199
|
+
- **Default IRIS**: `1972:1972` and `52773:52773` (docker-compose.yml)
|
|
200
|
+
- **Licensed IRIS (ACORN-1)**: `21972:1972` and `252773:52773` (docker-compose.acorn.yml)
|
|
201
|
+
- **Development instances**: `11972:1972` and `152773:52773` (if needed for multiple instances)
|
|
202
|
+
|
|
203
|
+
**Rationale**: Predictable ports avoid conflicts, enable easy configuration, support multiple IRIS instances
|
|
204
|
+
|
|
205
|
+
### Key Technical Notes
|
|
206
|
+
|
|
207
|
+
- **Vector embeddings**: Configured for 768-dimensional vectors (biomedical embeddings). HNSW optimization provides ~100x performance improvement.
|
|
208
|
+
- **HNSW Index**: Optimized with ACORN=1 for production performance (1.7ms vs 5800ms baseline).
|
|
209
|
+
- **RRF Fusion**: Uses Reciprocal Rank Fusion (Cormack & Clarke SIGIR'09) to combine vector and text search results.
|
|
210
|
+
- **Graph queries**: Performance-optimized with bounded hops and confidence filtering.
|
|
211
|
+
- **iris_vector_graph_core**: Modular design for integration with other RAG systems.
|
|
212
|
+
- **Cypher-to-SQL Translation**: Label pushdown and property pushdown optimizations for fast queries.
|
|
213
|
+
- **Query Pattern Matching**: MVP parser supports common Cypher patterns (MATCH, WHERE, RETURN, ORDER BY, LIMIT).
|
|
214
|
+
|
|
215
|
+
### File Structure
|
|
216
|
+
|
|
217
|
+
- `iris_vector_graph_core/` - Core Python module for graph operations
|
|
218
|
+
- `biomedical/` - Domain-specific biomedical graph operations
|
|
219
|
+
- `sql/` - Database schema and stored procedures
|
|
220
|
+
- `iris/src/` - IRIS ObjectScript classes for REST API
|
|
221
|
+
- `scripts/` - Setup, testing, and performance scripts
|
|
222
|
+
- `tests/` - Comprehensive test suite
|
|
223
|
+
- `docs/` - Documentation and performance analysis
|
|
224
|
+
|
|
225
|
+
## Constitutional Requirements
|
|
226
|
+
|
|
227
|
+
When developing, ensure compliance with `.specify/memory/constitution.md`:
|
|
228
|
+
|
|
229
|
+
### Core Principles Summary
|
|
230
|
+
1. **IRIS-Native Development** - Leverage IRIS capabilities directly (embedded Python, SQL procedures, ObjectScript)
|
|
231
|
+
2. **Test-First with Live Database** - TDD with running IRIS instance (no mocked database for integration tests)
|
|
232
|
+
3. **Performance as a Feature** - HNSW indexing, bounded queries, tracked benchmarks
|
|
233
|
+
4. **Hybrid Search by Default** - Vector + text + graph using RRF fusion
|
|
234
|
+
5. **Observability & Debuggability** - Structured logging at each layer
|
|
235
|
+
6. **Modular Core Library** - Database-agnostic iris_vector_graph_core
|
|
236
|
+
7. **Explicit Error Handling** - No silent failures, actionable error messages
|
|
237
|
+
8. **Standardized Database Interfaces** - Use proven utilities, contribute patterns back
|
|
238
|
+
|
|
239
|
+
### Testing Requirements (NON-NEGOTIABLE)
|
|
240
|
+
- All tests involving data storage, vector operations, or graph operations MUST use live IRIS
|
|
241
|
+
- Test categories:
|
|
242
|
+
- `@pytest.mark.requires_database` - MUST connect to live IRIS
|
|
243
|
+
- `@pytest.mark.integration` - MUST use IRIS for data operations
|
|
244
|
+
- `@pytest.mark.e2e` - MUST use complete IRIS + vector workflow
|
|
245
|
+
- Unit tests MAY mock IRIS for isolated component testing
|
|
246
|
+
- Performance tests MUST verify: vector search <10ms, graph queries <1ms (with HNSW)
|
|
247
|
+
|
|
248
|
+
### Development Standards
|
|
249
|
+
- **Package Management**: Use `uv` for all Python dependency management
|
|
250
|
+
- **Code Quality**: Pass black, isort, flake8, mypy before commits
|
|
251
|
+
- **Documentation**: Comprehensive docstrings for all public APIs
|
|
252
|
+
- **Versioning**: Follow semantic versioning for schema/API changes
|
|
253
|
+
|
|
254
|
+
### AI Development Constraints
|
|
255
|
+
- Follow constraint-based architecture, not "vibecoding"
|
|
256
|
+
- Constitutional validation gates prevent repeating known bugs
|
|
257
|
+
- Every bug fix MUST be captured as new validation rule or enhanced guideline
|
|
258
|
+
- Work within established frameworks, patterns, and validation loops
|
|
259
|
+
- **Constraint Philosophy**: Less freedom = less chaos. Constraints prevent regression.
|
|
260
|
+
|
|
261
|
+
## Integration with RAG Systems
|
|
262
|
+
|
|
263
|
+
The `iris_vector_graph_core` module is designed for integration with RAG frameworks like `rag-templates`:
|
|
264
|
+
|
|
265
|
+
```python
|
|
266
|
+
# Example usage in RAG pipeline
|
|
267
|
+
from iris_vector_graph_core import HybridSearchFusion, IRISGraphEngine
|
|
268
|
+
|
|
269
|
+
# Initialize engine with IRIS connection
|
|
270
|
+
engine = IRISGraphEngine(connection_params)
|
|
271
|
+
|
|
272
|
+
# Hybrid search combining vector, text, and graph
|
|
273
|
+
results = engine.hybrid_search(
|
|
274
|
+
query_vector=embeddings,
|
|
275
|
+
query_text="cancer pathway",
|
|
276
|
+
k=15,
|
|
277
|
+
use_rrf=True
|
|
278
|
+
)
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
See `docs/architecture/ACTUAL_SCHEMA.md` for working patterns and integration examples.
|
|
282
|
+
|
|
283
|
+
## GraphQL API Usage
|
|
284
|
+
|
|
285
|
+
### Quick Start
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
# 1. Start IRIS database
|
|
289
|
+
docker-compose up -d
|
|
290
|
+
|
|
291
|
+
# 2. Start GraphQL API server
|
|
292
|
+
uvicorn api.main:app --reload --port 8000
|
|
293
|
+
|
|
294
|
+
# 3. Open GraphQL Playground
|
|
295
|
+
open http://localhost:8000/graphql
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Generic Graph Queries (Works for ANY domain)
|
|
299
|
+
|
|
300
|
+
```graphql
|
|
301
|
+
# Query any node by ID (returns Node interface)
|
|
302
|
+
query {
|
|
303
|
+
node(id: "PROTEIN:TP53") {
|
|
304
|
+
__typename # Type name (e.g., "Protein")
|
|
305
|
+
id
|
|
306
|
+
labels # ["Protein"]
|
|
307
|
+
properties # {name: "Tumor protein p53", function: "..."}
|
|
308
|
+
property(key: "name") # "Tumor protein p53"
|
|
309
|
+
createdAt
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
# Query with GraphQL fragments for type-specific fields
|
|
314
|
+
query {
|
|
315
|
+
node(id: "PROTEIN:TP53") {
|
|
316
|
+
... on Protein {
|
|
317
|
+
name
|
|
318
|
+
function
|
|
319
|
+
organism
|
|
320
|
+
}
|
|
321
|
+
... on Gene {
|
|
322
|
+
name
|
|
323
|
+
chromosome
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Domain-Specific Queries (Biomedical Example)
|
|
330
|
+
|
|
331
|
+
```graphql
|
|
332
|
+
# Query protein with nested interactions
|
|
333
|
+
query {
|
|
334
|
+
protein(id: "PROTEIN:TP53") {
|
|
335
|
+
name
|
|
336
|
+
function
|
|
337
|
+
interactsWith(first: 5) {
|
|
338
|
+
name
|
|
339
|
+
function
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
# Vector similarity search (HNSW-optimized)
|
|
345
|
+
query {
|
|
346
|
+
protein(id: "PROTEIN:TP53") {
|
|
347
|
+
name
|
|
348
|
+
similar(limit: 10, threshold: 0.7) {
|
|
349
|
+
protein {
|
|
350
|
+
name
|
|
351
|
+
function
|
|
352
|
+
}
|
|
353
|
+
similarity
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
# Gene encoding proteins
|
|
359
|
+
query {
|
|
360
|
+
gene(id: "GENE:TP53") {
|
|
361
|
+
name
|
|
362
|
+
chromosome
|
|
363
|
+
encodes(first: 5) {
|
|
364
|
+
name
|
|
365
|
+
function
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
### Mutations
|
|
372
|
+
|
|
373
|
+
```graphql
|
|
374
|
+
# Create protein with embedding
|
|
375
|
+
mutation {
|
|
376
|
+
createProtein(input: {
|
|
377
|
+
id: "PROTEIN:NEW_PROTEIN"
|
|
378
|
+
name: "Novel Protein"
|
|
379
|
+
function: "Unknown function"
|
|
380
|
+
embedding: [0.1, 0.2, ..., 0.768] # 768-dimensional vector
|
|
381
|
+
}) {
|
|
382
|
+
id
|
|
383
|
+
name
|
|
384
|
+
function
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
# Update protein fields (partial update)
|
|
389
|
+
mutation {
|
|
390
|
+
updateProtein(
|
|
391
|
+
id: "PROTEIN:TP53"
|
|
392
|
+
input: {
|
|
393
|
+
function: "Updated function description"
|
|
394
|
+
confidence: 0.95
|
|
395
|
+
}
|
|
396
|
+
) {
|
|
397
|
+
id
|
|
398
|
+
name
|
|
399
|
+
function
|
|
400
|
+
confidence
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
# Delete protein (cascade via FK constraints)
|
|
405
|
+
mutation {
|
|
406
|
+
deleteProtein(id: "PROTEIN:OLD_PROTEIN")
|
|
407
|
+
}
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
### Architecture Notes
|
|
411
|
+
|
|
412
|
+
**GraphQL and openCypher are Query Engines** on top of a generic graph database:
|
|
413
|
+
|
|
414
|
+
```
|
|
415
|
+
┌────────────────────────────────────────┐
|
|
416
|
+
│ Query Engines (User-Facing) │
|
|
417
|
+
│ GraphQL | openCypher | SQL │
|
|
418
|
+
└────────────────────────────────────────┘
|
|
419
|
+
▼
|
|
420
|
+
┌────────────────────────────────────────┐
|
|
421
|
+
│ Core Graph Database (Generic) │
|
|
422
|
+
│ NodePK: nodes, rdf_edges, rdf_* │
|
|
423
|
+
│ Vector: kg_NodeEmbeddings + HNSW │
|
|
424
|
+
└────────────────────────────────────────┘
|
|
425
|
+
▼
|
|
426
|
+
┌────────────────────────────────────────┐
|
|
427
|
+
│ Domain Schemas (Optional) │
|
|
428
|
+
│ Biomedical | Social | E-commerce │
|
|
429
|
+
└────────────────────────────────────────┘
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
**Design Principle**: Biomedical types (Protein, Gene, Pathway) are **EXAMPLE implementations**, not the core API. Use generic `node()` query for custom domains.
|
|
433
|
+
|
|
434
|
+
See `docs/architecture/generic_graph_api_design.md` for full architecture details.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to do so, subject to the
|
|
10
|
+
following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|