> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/sdgm/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/sdgm/_mcp/server.

# Create a Graph

> Create a Kumo Relational graph from prepared DataFrames or a supported data source

A Kumo Relational graph combines table metadata with the relationships used to sample predictive context. Create the graph after preparing the source data and physical column types.

## Choose a graph backend

| Data location           | Entry point                            |
| ----------------------- | -------------------------------------- |
| pandas DataFrames       | `Graph.from_data()`                    |
| SQLite                  | `Graph.from_sqlite()`                  |
| DuckDB                  | `Graph.from_duckdb()`                  |
| Snowflake               | `Graph.from_snowflake()`               |
| Databricks              | `Graph.from_databricks()`              |
| Databricks metric view  | `Graph.from_databricks_metric_view()`  |
| Snowflake semantic view | `Graph.from_snowflake_semantic_view()` |
| Amazon S3               | `read("s3")`, then `Graph.from_data()` |
| RelBench dataset        | `Graph.from_relbench()`                |

Local DataFrames must fit in application memory. This includes DataFrames loaded from Amazon S3 with `read("s3")`. Database- and warehouse-backed graphs query and sample data from their respective sources; refer to the connector pages for information about permissions and connection behavior.

Factories that accept local file paths reject URI schemes rather than fetching remote URLs. Unsupported file extensions and unrecognized connector keyword arguments are rejected explicitly.

## Create a graph from DataFrames

Using the prepared `customers`, `orders`, and `products` DataFrames from [Data Requirements](/rfm/data-requirements):

```python
from kumo_relational_client import relational

graph = relational.Graph.from_data({
    "customers": customers,
    "orders": orders,
    "products": products,
})
```

`Graph.from_data()` creates the graph and infers table metadata and relationships. Treat this inference as a starting point; the following pages explain how to inspect and correct the inferred metadata and relationships.

For every `Graph.from_*()` factory, `edges=None` permits declared or inferred relationships. Pass `edges=[]` to create a graph with no edges and suppress relationship inference.

## Create a connector-backed graph

For data stored in a database or warehouse, use the corresponding factory and connector configuration. The connector pages provide the required permissions, connection parameters, and examples:

* [SQLite](/rfm/connectors/sqlite)
* [DuckDB](/rfm/connectors/duckdb)
* [Snowflake](/rfm/connectors/snowflake)
* [Databricks](/rfm/connectors/databricks)
* [Amazon S3](/rfm/connectors/s3)

Database- and warehouse-backed graphs retain source-backed table definitions and query the source when Kumo Relational needs relational context. S3 reads instead materialize each object into a DataFrame before graph creation.

Install the `relbench` extra before using `Graph.from_relbench()`. Metric-view and semantic-view constructors convert the source view metadata into graph tables and relationships. Review `graph.conversion_messages` after conversion. If your application handles those diagnostics separately, filter the corresponding warnings explicitly:

```python
import warnings
from kumo_relational_client.relational import ViewConversionWarning

warnings.filterwarnings("ignore", category=ViewConversionWarning)
```

If credentials or an active warehouse session change, call `graph.update_connection(...)` to reconnect a source-backed graph without rebuilding its metadata.

Next, [configure the inferred table metadata](/rfm/table-definitions).