> 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

Create a `relational.Graph` from prepared tables or a supported data source.
The client uses its keys, relationships, and time columns to sample prediction
context. Set source dtypes before graph construction.

## Choose a graph backend

Choose the entry point that matches where your data is stored.
Use `Graph.from_data()` for DataFrames already loaded into your application, or use a source-specific factory to connect directly to a database or warehouse.

| 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 requirement 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 do not fetch remote URLs and reject paths that use URI schemes.
They also reject unsupported file extensions and unrecognized connector keyword arguments.

## Create a graph from DataFrames

The following example uses the prepared `customers`, `orders`, and `products` DataFrames from [Data Requirements](/kumo-relational/user-guide/prepare-data/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.
Table metadata describes the columns and their roles, while relationships identify how rows in different tables connect.
Treat the inferred values as a starting point; the following pages explain how to inspect and correct them.

For every `Graph.from_*()` factory, an edge represents a relationship between two tables.
The default, `edges=None`, permits declared or inferred relationships.
Pass `edges=[]` only when you want a graph with no relationships and want to 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](/kumo-relational/user-guide/prepare-data/connect-data-sources/sqlite)
* [DuckDB](/kumo-relational/user-guide/prepare-data/connect-data-sources/duckdb)
* [Snowflake](/kumo-relational/user-guide/prepare-data/connect-data-sources/snowflake)
* [Databricks](/kumo-relational/user-guide/prepare-data/connect-data-sources/databricks)
* [Amazon S3](/kumo-relational/user-guide/prepare-data/connect-data-sources/s3)

Database- and warehouse-backed graphs retain table definitions that reference the source and query it when Kumo Relational needs related data for a prediction.
S3 reads instead materialize each object into a DataFrame before graph creation.

## Handle specialized sources and connection changes

Some graph factories require additional setup or checks.

**RelBench:** Install the `relbench` extra before using `Graph.from_relbench()`.

**Databricks metric views and Snowflake semantic views:** These constructors convert 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)
```

**Updated credentials or warehouse sessions:** Call `graph.update_connection(...)` to reconnect a source-backed graph without rebuilding its metadata.

Next, [configure the inferred table metadata](/kumo-relational/user-guide/build-a-relational-graph/table-definitions).