This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**Warning**: This is an _experimental_ feature. To our knowledge, this is stable, but there are still rough edges in the experience. Contributions are welcome!
## Overview
Vector database allows user to store and retrieve embeddings. Feast provides general APIs to store and retrieve embeddings.
## Integration
Below are supported vector databases and implemented features:
*Note: V2 Support means the SDK supports retrieval of features along with vector embeddings from vector similarity search.
Note: SQLite is in limited access and only working on Python 3.10. It will be updated as [sqlite_vec](https://github.com/asg017/sqlite-vec/) progresses.
{% hint style="danger" %}
We will be deprecating the `retrieve_online_documents` method in the SDK in the future.
We recommend using the `retrieve_online_documents_v2` method instead, which offers easier vector index configuration
directly in the Feature View and the ability to retrieve standard features alongside your vector embeddings for richer context injection.
Long term we will collapse the two methods into one, but for now, we recommend using the `retrieve_online_documents_v2` method.
Beyond that, we will then have `retrieve_online_documents` and `retrieve_online_documents_v2` simply point to `get_online_features` for
backwards compatibility and the adopt industry standard naming conventions.
{% endhint %}
**Note**: Milvus and SQLite implement the v2 `retrieve_online_documents_v2` method in the SDK. This will be the longer-term solution so that Data Scientists can easily enable vector similarity search by just flipping a flag.
## Examples
- See the v0 [Rag Demo](https://github.com/feast-dev/feast-workshop/blob/rag/module_4_rag) for an example on how to use vector database using the `retrieve_online_documents` method (planning migration and deprecation (planning migration and deprecation).
- See the v1 [Milvus Quickstart](../../examples/rag/milvus-quickstart.ipynb) for a quickstart guide on how to use Feast with Milvus using the `retrieve_online_documents_v2` method.
### **Prepare offline embedding dataset**
Run the following commands to prepare the embedding dataset:
```shell
python pull_states.py
python batch_score_documents.py
```
The output will be stored in `data/city_wikipedia_summaries.csv.`
### **Initialize Feast feature store and materialize the data to the online store**
Use the feature_store.yaml file to initialize the feature store. This will use the data as offline store, and Milvus as online store.
```yaml
project: local_rag
provider: local
registry: data/registry.db
online_store:
type: milvus
path: data/online_store.db
vector_enabled: true
embedding_dim: 384
index_type: "IVF_FLAT"
offline_store:
type: file
entity_key_serialization_version: 3
# By default, no_auth for authentication and authorization, other possible values kubernetes and oidc. Refer the documentation for more details.
auth:
type: no_auth
```
Run the following command in terminal to apply the feature store configuration:
```shell
feast apply
```
Note that when you run `feast apply` you are going to apply the following Feature View that we will use for retrieval later:
During inference (e.g., during when a user submits a chat message) we need to embed the input text. This can be thought of as a feature transformation of the input data. In this example, we'll do this with a small Sentence Transformer from Hugging Face.
```python
import torch
import torch.nn.functional as F
from feast import FeatureStore
from pymilvus import MilvusClient, DataType, FieldSchema
from transformers import AutoTokenizer, AutoModel
from example_repo import city_embeddings_feature_view, item
# And this will print the content. Look at the examples/rag/milvus-quickstart.ipynb for an end-to-end example.
print('\n'.join([c.message.content for c in response.choices]))
```
### Configuration and Installation
We offer [Milvus](https://milvus.io/), [PGVector](https://github.com/pgvector/pgvector), [SQLite](https://github.com/asg017/sqlite-vec), [Elasticsearch](https://www.elastic.co) and [Qdrant](https://qdrant.tech/) as Online Store options for Vector Databases.
Milvus offers a convenient local implementation for vector similarity search. To use Milvus, you can install the Feast package with the Milvus extra.
#### Installation with Milvus
```bash
pip install feast[milvus]
```
#### Installation with Elasticsearch
```bash
pip install feast[elasticsearch]
```
#### Installation with Qdrant
```bash
pip install feast[qdrant]
```
#### Installation with SQLite
If you are using `pyenv` to manage your Python versions, you can install the SQLite extension with the following command:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**Warning**: This is an _experimental_ feature. To our knowledge, this is stable, but there are still rough edges in the experience. Contributions are welcome!
## Overview
The Feast Web UI allows users to explore their feature repository through a Web UI. It includes functionality such as:
* Browsing Feast objects (feature views, entities, data sources, feature services, and saved datasets) and their relationships
* Searching and filtering for Feast objects by tags

## Usage
There are several ways to use the Feast Web UI.
### Feast CLI
The easiest way to get started is to run the `feast ui` command within a feature repository:
Output of `feast ui --help`:
```bash
Usage: feast ui [OPTIONS]
Shows the Feast UI over the current directory
Options:
-h, --host TEXT Specify a host for the server [default: 0.0.0.0]
-p, --port INTEGER Specify a port for the server [default: 8888]
-r, --registry_ttl_sec INTEGER Number of seconds after which the registry is refreshed. Default is 5 seconds.
--help Show this message and exit.
```
This will spin up a Web UI on localhost which automatically refreshes its view of the registry every `registry_ttl_sec`
### Importing as a module to integrate with an existing React App
This is the recommended way to use Feast UI for teams maintaining their own internal UI for their deployment of Feast.
Start with bootstrapping a React app with `create-react-app`
```
npx create-react-app your-feast-ui
```
Then, in your app folder, install Feast UI and optionally its peer dependencies. Assuming you use yarn
```
yarn add @feast-dev/feast-ui
# For custom UI using the Elastic UI Framework (optional):
yarn add @elastic/eui
# For general custom styling (optional):
yarn add @emotion/react
```
Edit `index.js` in the React app to use Feast UI.
```js
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import FeastUI from "@feast-dev/feast-ui";
import "@feast-dev/feast-ui/dist/feast-ui.css";
ReactDOM.render(
<React.StrictMode>
<FeastUI />
</React.StrictMode>,
document.getElementById("root")
);
```
When you start the React app, it will look for `projects-list.json` to find a list of your projects. The JSON should look something like this.
```json
{
"projects": [
{
"name": "Credit Score Project",
"description": "Project for credit scoring team and associated models.",
"id": "credit_score_project",
"registryPath": "/registry.json"
}
]
}
```
* **Note** - `registryPath` only supports a file location or a url.
Then start the React App
```bash
yarn start
```
#### Customization
The advantage of importing Feast UI as a module is in the ease of customization. The `<FeastUI>` component exposes a `feastUIConfigs` prop thorough which you can customize the UI. Currently it supports a few parameters.
##### Fetching the Project List
By default, the Feast UI fetches the project list from the app root path. You can use `projectListPromise` to provide a promise that overrides where it's fetched from.
```jsx
<FeastUI
feastUIConfigs={{
projectListPromise: fetch(SOME_PATH, {
headers: {
"Content-Type": "application/json",
},
}).then((res) => {
return res.json();
})
}}
/>
```
##### Custom Tabs
You can add custom tabs for any of the core Feast objects through the `tabsRegistry`.
```jsx
const tabsRegistry = {
RegularFeatureViewCustomTabs: [
{
label: "Custom Tab Demo", // Navigation Label for the tab
path: "demo-tab", // Subpath for the tab
Component: RFVDemoCustomTab, // a React Component
},
]
}
<FeastUI
feastUIConfigs={{
tabsRegistry: tabsRegistry,
}}
/>
```
Examples of custom tabs can be found in the `ui/custom-tabs` folder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Please see [Batch Materialization Engine](../../getting-started/components/batch-materialization-engine.md) for an explanation of batch materialization engines.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Add CLI, SDK, and API documentation page to Feast UI #5337
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
feat: Add CLI, SDK, and API documentation page to Feast UI #5337
Filter by extension
Only manifest files
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.