Skip to content

Commit e362173

Browse files
committed
feat: Add demo noteboooks for users
Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
1 parent 728aa2e commit e362173

10 files changed

Lines changed: 1415 additions & 3 deletions

File tree

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
* [RAG Fine Tuning with Feast and Milvus](../examples/rag-retriever/README.md)
5757
* [MCP - AI Agent Example](../examples/mcp_feature_store/README.md)
5858
* [Feast-Powered AI Agent](../examples/agent_feature_store/README.md)
59+
* [Demo Notebooks](tutorials/demo-notebooks.md)
5960

6061
## How-to Guides
6162

docs/getting-started/quickstart.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,7 @@ show up in the upcoming concepts + architecture + tutorial pages as well.
666666

667667
## Next steps
668668

669+
* Run `feast demo-notebooks` to generate tailored Jupyter notebooks for your project. See [Demo Notebooks](../tutorials/demo-notebooks.md).
669670
* Read the [Concepts](concepts/) page to understand the Feast data model.
670671
* Read the [Architecture](architecture/) page.
671672
* Check out our [Tutorials](../tutorials/tutorials-overview/) section for more examples on how to use Feast.

docs/reference/feast-cli-commands.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Commands:
2121
apply Create or update a feature store deployment
2222
configuration Display Feast configuration
2323
delete Delete a Feast object from the registry
24+
demo-notebooks Generate demo Jupyter notebooks for the project
2425
entities Access entities
2526
feature-views Access feature views
2627
init Create a new Feast repository
@@ -142,6 +143,47 @@ The delete operation is permanent and will remove the object from the registry.
142143
If multiple objects have the same name across different types, `feast delete` will delete the first one it finds. For programmatic deletion with more control, use the Python SDK methods like `store.delete_feature_view()`, `store.delete_feature_service()`, etc.
143144
{% endhint %}
144145

146+
## Demo Notebooks
147+
148+
Generate tailored demo Jupyter notebooks for each Feast project found in the current directory.
149+
150+
```bash
151+
feast demo-notebooks
152+
```
153+
154+
The command searches for `feature_store.yaml` in the current directory and every file inside the `feast-config/` directory. Each file is treated as a separate project config, and notebooks are created under `./feast-demo-notebooks/<project>/`.
155+
156+
The generated notebooks adapt to your project configuration (online/offline store types, authentication, vector search) and cover:
157+
158+
* **Feature store overview** — explore registered entities, feature views, and services.
159+
* **Historical feature retrieval** — build training datasets with point-in-time correct joins.
160+
* **Online feature serving** — materialize features and retrieve them at low latency.
161+
162+
**Options:**
163+
164+
* `-o, --output-dir` — Directory where the notebooks are written. Default: `./feast-demo-notebooks`.
165+
* `--overwrite` — Overwrite existing notebooks if the output directory already exists.
166+
167+
```bash
168+
feast demo-notebooks -o ./my-notebooks --overwrite
169+
```
170+
171+
You can also use the `--chdir` global option to point at a different feature repository:
172+
173+
```bash
174+
feast -c /path/to/feature_repo demo-notebooks
175+
```
176+
177+
The same functionality is available via the Python SDK:
178+
179+
```python
180+
from feast import copy_demo_notebooks
181+
182+
copy_demo_notebooks(output_dir="./feast-demo-notebooks", repo_path=".")
183+
```
184+
185+
For more details see the [Demo Notebooks tutorial](../tutorials/demo-notebooks.md).
186+
145187
## Entities
146188

147189
List all registered entities

docs/tutorials/demo-notebooks.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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 %}

pixi.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/python/docs/source/feast.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ feast.data\_format module
6565
:undoc-members:
6666
:show-inheritance:
6767

68+
feast.demos module
69+
------------------
70+
71+
.. automodule:: feast.demos
72+
:members:
73+
:undoc-members:
74+
:show-inheritance:
75+
6876
feast.data\_source module
6977
-------------------------
7078

sdk/python/feast/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from importlib.metadata import PackageNotFoundError
22
from importlib.metadata import version as _version
33

4+
from feast.demos import copy_demo_notebooks
45
from feast.infra.offline_stores.bigquery_source import BigQuerySource
56
from feast.infra.offline_stores.contrib.athena_offline_store.athena_source import (
67
AthenaSource,
@@ -41,6 +42,7 @@
4142
__all__ = [
4243
"Aggregation",
4344
"BatchFeatureView",
45+
"copy_demo_notebooks",
4446
"DataFrameEngine",
4547
"Entity",
4648
"KafkaSource",

sdk/python/feast/cli/cli.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,39 @@ def validate(
598598
exit(1)
599599

600600

601+
@cli.command("demo-notebooks")
602+
@click.option(
603+
"--output-dir",
604+
"-o",
605+
default="./feast-demo-notebooks",
606+
show_default=True,
607+
help="Directory where the demo notebooks are written.",
608+
)
609+
@click.option(
610+
"--overwrite",
611+
is_flag=True,
612+
default=False,
613+
help="Overwrite existing notebooks if the output directory already exists.",
614+
)
615+
@click.pass_context
616+
def demo_notebooks_command(ctx: click.Context, output_dir: str, overwrite: bool):
617+
"""
618+
Generate demo Jupyter notebooks tailored to the feature store configuration.
619+
620+
Searches for feature_store.yaml in the current directory and every file
621+
inside feast-config/. Each file is treated as a separate project config.
622+
For each project found, a sub-directory is created under OUTPUT_DIR.
623+
"""
624+
from feast.demos import copy_demo_notebooks
625+
626+
repo = ctx.obj["CHDIR"]
627+
copy_demo_notebooks(
628+
output_dir=output_dir,
629+
repo_path=str(repo),
630+
overwrite=overwrite,
631+
)
632+
633+
601634
cli.add_command(data_sources_cmd)
602635
cli.add_command(entities_cmd)
603636
cli.add_command(feature_services_cmd)

0 commit comments

Comments
 (0)