feat(cli): Add recommendation template for feast init - #6078
feat(cli): Add recommendation template for feast init#6078doc-johnson wants to merge 13 commits into
Conversation
d9af218 to
df3427d
Compare
Add a new "recommendation" template demonstrating product recommendations using vector similarity search with pre-computed embeddings (all-MiniLM-L6-v2) and SQLite online store with vector_enabled. Signed-off-by: doc-johnson <hustler@mail.ru>
1fb6e6b to
7478002
Compare
Signed-off-by: doc-johnson <hustler@mail.ru>
There was a problem hiding this comment.
Pull request overview
Adds a new feast init template (recommendation) that scaffolds a small product-recommendation demo using vector similarity search backed by a local SQLite online store (with vector search enabled). This extends Feast’s CLI templates with a concrete end-to-end example for vector retrieval.
Changes:
- Adds a new
sdk/python/feast/templates/recommendation/template with bootstrap data generation (embeddings), feature definitions, local SQLite config, and an end-to-end demo script. - Registers the
recommendationtemplate in the CLI--templatechoices. - Adds a unit test to validate the presence of key template artifacts and vector-search-related configuration.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/tests/unit/local_feast_tests/test_init.py | Adds assertions that the recommendation template exists and is configured for SQLite vector search. |
| sdk/python/feast/templates/recommendation/bootstrap.py | Bootstraps a small product catalog and writes precomputed embeddings to parquet; fills template placeholders. |
| sdk/python/feast/templates/recommendation/feature_repo/feature_definitions.py | Defines the entity/FeatureView with a vector-indexed embedding field and a FeatureService. |
| sdk/python/feast/templates/recommendation/feature_repo/feature_store.yaml | Configures a local SQLite online store with vector_enabled: true. |
| sdk/python/feast/templates/recommendation/feature_repo/test_workflow.py | End-to-end demo script: apply, materialize, vector similarity query via retrieve_online_documents_v2, teardown. |
| sdk/python/feast/templates/recommendation/init.py | Adds package marker for the new template directory. |
| sdk/python/feast/templates/recommendation/feature_repo/init.py | Adds package marker for the template feature repo. |
| sdk/python/feast/cli/cli.py | Adds recommendation to the accepted feast init --template values. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
HaoXuAI
left a comment
There was a problem hiding this comment.
feast init should not require an optional ML package or download a model. The bootstrap imports sentence_transformers and loads all-MiniLM-L6-v2 during initialization, so a normal Feast installation can fail after partially creating the repository; even feast[rag] still depends on network/model-cache availability.
Please ship small precomputed embeddings, generate deterministic placeholder vectors as the existing RAG template does, or defer model installation/loading to test_workflow.py. The test should invoke init_repo(..., template="recommendation") in the standard test environment and verify initialization completes, rather than only checking that template files exist.
…on-template Signed-off-by: doc-johnson <hustler@mail.ru>
Signed-off-by: doc-johnson <hustler@mail.ru>
…on-template Signed-off-by: doc-johnson <hustler@mail.ru>
|
Updated in 4911874.
The test now calls The targeted init test and Ruff pass locally. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6078 +/- ##
==========================================
+ Coverage 46.96% 47.02% +0.06%
==========================================
Files 418 418
Lines 51675 51675
Branches 7485 7485
==========================================
+ Hits 24268 24300 +32
+ Misses 25673 25635 -38
- Partials 1734 1740 +6
*This pull request uses carry forward flags. Click here to find out more.
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Covers point 3 from #5478: a recommendation template for
feast init.The template creates a small product catalog with deterministic 384-dimensional placeholder vectors. Initialization works in the standard Feast environment without installing an ML package or downloading a model.
test_workflow.pyloadsall-MiniLM-L6-v2only when the demo is run, replaces the placeholder vectors, applies the repo, materializes the data, runs a top-k query withretrieve_online_documents_v2, and tears the repo down. The online store is local SQLite with vector search enabled, andproduct_idis included in the requested result fields.The unit test calls
init_repo(..., template="recommendation")and verifies the generated config, feature definitions, parquet data, vector dimensions, and bootstrap cleanup. The targeted test and Ruff pass locally.