Metadata-Version: 2.4
Name: structured-data-models-relational-engine
Version: 1.0.0
Summary: Relational driver (graph building, samplers, PQL, native neighbor-sampler) for the NVIDIA Structured Data Models client
Author: NVIDIA
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/NVIDIA/structured-data-models-client
Project-URL: Source, https://github.com/NVIDIA/structured-data-models-client
Project-URL: Issues, https://github.com/NVIDIA/structured-data-models-client/issues
Project-URL: Changelog, https://github.com/NVIDIA/structured-data-models-client/blob/main/CHANGELOG.md
Keywords: deep-learning,graph-neural-networks,relational-foundation-model,predictive-query
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: <3.14,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: pyarrow>=10.0.1
Requires-Dist: python-dateutil
Requires-Dist: requests>=2.28.2
Requires-Dist: urllib3
Requires-Dist: typing_extensions>=4.5.0
Requires-Dist: pydantic>=2.7
Requires-Dist: structured-data-models-api==1.0.0
Requires-Dist: structured-data-models-pql==1.0.0
Requires-Dist: structured-data-models-connectors==1.0.0
Requires-Dist: antlr4-python3-runtime==4.13.2
Requires-Dist: rich>=9.0.0
Requires-Dist: jinja2
Requires-Dist: tabulate
Provides-Extra: snowflake-serving
Requires-Dist: snowflake-snowpark-python>=1.20; extra == "snowflake-serving"
Provides-Extra: test
Requires-Dist: packaging; extra == "test"
Requires-Dist: pooch; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-httpserver; extra == "test"
Requires-Dist: pytest-mock; extra == "test"
Requires-Dist: pytest-subtests; extra == "test"
Requires-Dist: requests-mock; extra == "test"
Provides-Extra: explain
Requires-Dist: openai>=1.40; extra == "explain"
Provides-Extra: relbench
Requires-Dist: pooch; extra == "relbench"
Requires-Dist: tqdm; extra == "relbench"
Provides-Extra: sqlite
Requires-Dist: structured-data-models-connectors[sqlite]; extra == "sqlite"
Provides-Extra: duckdb
Requires-Dist: structured-data-models-connectors[duckdb]; extra == "duckdb"
Provides-Extra: snowflake
Requires-Dist: structured-data-models-connectors[snowflake]; extra == "snowflake"
Requires-Dist: pyyaml; extra == "snowflake"
Provides-Extra: databricks
Requires-Dist: structured-data-models-connectors[databricks]; extra == "databricks"
Requires-Dist: pyyaml; extra == "databricks"
Provides-Extra: postgres
Requires-Dist: structured-data-models-connectors[postgres]; extra == "postgres"
Dynamic: license-file
Dynamic: requires-dist

# sdm_relational_engine

The Kumo Relational driver for the [`structured-data-models-client`](https://github.com/NVIDIA/structured-data-models-client) client.

This distribution provides the heavy, client-side machinery a Kumo Relational prediction
needs before a request reaches a NIM: the relational `Graph`/`Table` abstractions,
the neighbor samplers (local native `relationallib`, plus DuckDB / SQLite / Snowflake /
Databricks / PostgreSQL backends), the PQL parser, and the HTTP client that talks to a Universal
TFM NIM.

It is imported as `sdm_relational_engine` and is normally installed transitively via the client's
`relational` extra rather than on its own:

```bash
pip install 'structured-data-models-client[relational]'      # pulls the sdm_relational_engine driver
```

It can also be installed on its own, for the graph, sampler and PQL machinery.
Predicting is not available that way: the engine's entry points refuse a direct
call, so a prediction has to go through `structured-data-models-client`.

```bash
pip install structured-data-models-relational-engine
# optional data backends:
pip install "structured-data-models-relational-engine[duckdb]"      # or [sqlite] / [snowflake] / [databricks] / [postgres]
# optional features:
pip install "structured-data-models-relational-engine[explain]"     # natural-language explanation summaries
pip install "structured-data-models-relational-engine[relbench]"    # Graph.from_relbench() dataset loading
```

Release wheels are built for CPython 3.10, 3.11, 3.12 and 3.13
(`manylinux_2_28` x86-64 and aarch64); no source distribution is published.

Application code should import the client's neutral surface, not this package
directly:

```python
import pandas as pd
from sdm_client import KumoRelational, PredictiveQuery, SDMClient

users_df = pd.DataFrame({'user_id': range(12)})
orders_df = pd.DataFrame(
    {
        'order_id': range(120),
        'user_id': [i % 12 for i in range(120)],
        'price': [10.0 + i for i in range(120)],
        'ordered_at': pd.date_range('2026-01-01', periods=120, freq='D'),
    }
)

query = PredictiveQuery(
    'PREDICT SUM(orders.price, 0, 30, days) FOR EACH users.user_id',
    {'users': users_df, 'orders': orders_df},
)
request = query.materialize(indices=[1, 2, 3])

with SDMClient(url='http://localhost:8000') as client:
    result = client.predict(request, model=KumoRelational())
```

## Local development

```bash
pip install -e ".[test,databricks]"
pytest tests -m "not live_nim"
```

For source checkouts, the live-NIM suite
(`../../qa/run_rfm_nim_live_tests.sh --full`) includes durable, ticket-free
rejection regressions for fixed NIM defects; every rejection probe is followed
by a known-good prediction to detect service degradation.

The native neighbor sampler (`sdm_relational_engine.relationallib`) is built from
`src/sdm_relational_engine/csrc/neighbor_sampler.cpp` via CMake/scikit-build-core. Set
`WITH_RELATIONALLIB=0` to skip the native build for a pure-Python editable install.
