Skip to content

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

Open
doc-johnson wants to merge 8 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 8 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-engine template for feast init.

The template is a small product-recommendation setup built around vector similarity search. It ships 12 sample products across four categories (Electronics, Books, Sports, Home), pre-computes their embeddings with all-MiniLM-L6-v2 (384 dims) at bootstrap time, and stores them in a SQLite online store with vector search enabled. test_workflow.py runs the whole thing end to end: apply, materialize, a top-k similarity query through retrieve_online_documents_v2, then teardown.

What is in it:

  • bootstrap.py builds the product catalog and writes the embeddings out to parquet
  • feature_definitions.py defines the entity, a FeatureView with a vector_index field, and a FeatureService
  • feature_store.yaml is a plain local SQLite config with vector_enabled: true
  • test_workflow.py is the runnable demo
  • one line in cli.py registers recommendation in the feast init template choices

What I checked locally:

  • feast init test_rec --template recommendation scaffolds a working project
  • feast apply registers the entity, view and service, and a second run reports no changes
  • python test_workflow.py goes through the full cycle without errors
  • a query like "gaming laptop accessories" comes back with electronics items
  • the existing local template still behaves the same
  • ruff check and ruff format are clean

@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.

Comment on lines +31 to +35
features=[
"product_embeddings:embedding",
"product_embeddings:product_name",
"product_embeddings:category",
"product_embeddings:price",
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.

3 participants