|
| 1 | +# Demo Notebooks |
| 2 | + |
| 3 | +Feast can generate tailored Jupyter notebooks for any Feast project. The notebooks adapt to your `feature_store.yaml` configuration and provide a hands-on walkthrough of core Feast functionality. |
| 4 | + |
| 5 | +## What you get |
| 6 | + |
| 7 | +For each project discovered, Feast creates a directory with notebooks covering: |
| 8 | + |
| 9 | +| Notebook | Description | |
| 10 | +|----------|-------------| |
| 11 | +| **01 — Feature Store Overview** | Explore registered entities, feature views, feature services, and data sources. | |
| 12 | +| **02 — Historical Feature Retrieval** | Build a training dataset with point-in-time correct joins using `get_historical_features`. | |
| 13 | +| **03 — Online Feature Serving** | Materialize features to the online store and retrieve them at low latency with `get_online_features`. | |
| 14 | + |
| 15 | +The content adapts automatically based on: |
| 16 | + |
| 17 | +* **Online / offline store types** — descriptions reflect the actual backends configured. |
| 18 | +* **Registry type** — local registries include `feast apply`; remote registries use `refresh_registry()`. |
| 19 | +* **Authentication** — auth details from `feature_store.yaml` are surfaced when configured. |
| 20 | +* **Vector search** — a vector/RAG retrieval section is included when embeddings are detected. |
| 21 | + |
| 22 | +## Prerequisites |
| 23 | + |
| 24 | +* Python 3.9+ |
| 25 | +* Feast installed (`pip install feast`) |
| 26 | +* A feature repository with a valid `feature_store.yaml` |
| 27 | + |
| 28 | +## Using the CLI |
| 29 | + |
| 30 | +Run the command from (or pointing to) a directory containing `feature_store.yaml`: |
| 31 | + |
| 32 | +```bash |
| 33 | +feast demo-notebooks |
| 34 | +``` |
| 35 | + |
| 36 | +This searches for `feature_store.yaml` in the current directory and every file inside the `feast-config/` directory. Each file in `feast-config/` is treated as a separate project config. For each project found, notebooks are written to `./feast-demo-notebooks/<project>/`. |
| 37 | + |
| 38 | +### Options |
| 39 | + |
| 40 | +| Option | Default | Description | |
| 41 | +|--------|---------|-------------| |
| 42 | +| `-o, --output-dir` | `./feast-demo-notebooks` | Root directory for generated notebooks | |
| 43 | +| `--overwrite` | `false` | Overwrite if the output directory already exists | |
| 44 | + |
| 45 | +```bash |
| 46 | +# Write to a custom directory |
| 47 | +feast demo-notebooks -o ./my-notebooks |
| 48 | + |
| 49 | +# Overwrite existing notebooks |
| 50 | +feast demo-notebooks --overwrite |
| 51 | + |
| 52 | +# Use --chdir to point at a different feature repo |
| 53 | +feast -c /path/to/feature_repo demo-notebooks |
| 54 | +``` |
| 55 | + |
| 56 | +## Using the Python SDK |
| 57 | + |
| 58 | +```python |
| 59 | +from feast import copy_demo_notebooks |
| 60 | + |
| 61 | +copy_demo_notebooks() |
| 62 | +``` |
| 63 | + |
| 64 | +### Parameters |
| 65 | + |
| 66 | +| Parameter | Type | Default | Description | |
| 67 | +|-----------|------|---------|-------------| |
| 68 | +| `output_dir` | `str` | `"./feast-demo-notebooks"` | Root directory for generated notebooks | |
| 69 | +| `repo_path` | `str` | `"."` | Directory to search for `feature_store.yaml` files | |
| 70 | +| `overwrite` | `bool` | `False` | Overwrite existing output directories | |
| 71 | + |
| 72 | +### Examples |
| 73 | + |
| 74 | +```python |
| 75 | +from feast import copy_demo_notebooks |
| 76 | + |
| 77 | +# Default — searches current directory, writes to ./feast-demo-notebooks/ |
| 78 | +copy_demo_notebooks() |
| 79 | + |
| 80 | +# Custom paths |
| 81 | +copy_demo_notebooks( |
| 82 | + output_dir="/home/user/notebooks", |
| 83 | + repo_path="/home/user/feast-projects/my-repo/feature_repo", |
| 84 | + overwrite=True, |
| 85 | +) |
| 86 | +``` |
| 87 | + |
| 88 | +## Multi-project repositories |
| 89 | + |
| 90 | +If your `feast-config/` directory contains multiple files, each is treated as a separate project and a dedicated notebook directory is created: |
| 91 | + |
| 92 | +``` |
| 93 | +feast-demo-notebooks/ |
| 94 | +├── project_alpha/ |
| 95 | +│ ├── 01_feature_store_overview.ipynb |
| 96 | +│ ├── 02_historical_features_training.ipynb |
| 97 | +│ └── 03_online_features_serving.ipynb |
| 98 | +└── project_beta/ |
| 99 | + ├── 01_feature_store_overview.ipynb |
| 100 | + ├── 02_historical_features_training.ipynb |
| 101 | + └── 03_online_features_serving.ipynb |
| 102 | +``` |
| 103 | + |
| 104 | +## Running the notebooks |
| 105 | + |
| 106 | +Open any generated notebook in Jupyter, JupyterLab, or VS Code and run cells from top to bottom. Each notebook: |
| 107 | + |
| 108 | +1. Configures the path to your `feature_store.yaml` automatically (no manual editing needed). |
| 109 | +2. Connects to the feature store using the Feast Python SDK. |
| 110 | +3. Walks through relevant operations with real data from your project. |
| 111 | + |
| 112 | +{% hint style="info" %} |
| 113 | +The first notebook (**01 — Overview**) includes a prerequisites check and `feast apply` / registry sync step. Subsequent notebooks assume these have already been completed. |
| 114 | +{% endhint %} |
0 commit comments