Skip to content

feat(cli): Add recommendation template for feast init - #6078

Open
doc-johnson wants to merge 13 commits into
feast-dev:masterfrom
doc-johnson:feat/recommendation-template
Open

feat(cli): Add recommendation template for feast init#6078
doc-johnson wants to merge 13 commits into
feast-dev:masterfrom
doc-johnson:feat/recommendation-template

Conversation

@doc-johnson

@doc-johnson doc-johnson commented Mar 8, 2026

Copy link
Copy Markdown

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.py loads all-MiniLM-L6-v2 only when the demo is run, replaces the placeholder vectors, applies the repo, materializes the data, runs a top-k query with retrieve_online_documents_v2, and tears the repo down. The online store is local SQLite with vector search enabled, and product_id is 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.

@doc-johnson
doc-johnson requested a review from a team as a code owner March 8, 2026 19:50

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@doc-johnson
doc-johnson force-pushed the feat/recommendation-template branch from d9af218 to df3427d Compare March 9, 2026 12:25
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>
@doc-johnson
doc-johnson force-pushed the feat/recommendation-template branch from 1fb6e6b to 7478002 Compare June 26, 2026 09:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 recommendation template in the CLI --template choices.
  • 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 HaoXuAI left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@doc-johnson

doc-johnson commented Aug 18, 2026

Copy link
Copy Markdown
Author

Updated in 4911874.

feast init now writes deterministic 384-dimensional placeholder vectors and does not import sentence-transformers or download a model. The explicit demo loads all-MiniLM-L6-v2 and replaces the placeholders before apply and materialization.

The test now calls init_repo(..., template="recommendation") and checks the generated repo and parquet vectors. I also added product_id to the requested retrieval fields.

The targeted init test and Ruff pass locally.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.02%. Comparing base (6a4690a) to head (db99b69).
⚠️ Report is 1 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ *Carryforward flag
go-feature-server 30.58% <ø> (ø) Carriedforward from 6a4690a
python-unit 48.33% <ø> (+0.06%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
sdk/python/feast/cli/cli.py 55.17% <ø> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a4690a...db99b69. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants