-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: Add vector database doc #4165
New issue
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,96 @@ | ||||||||||
| # [Alpha] Vector Database | ||||||||||
| **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: | ||||||||||
|
|
||||||||||
| | Vector Database | Retrieval | Indexing | | ||||||||||
| |-----------------|-----------|----------| | ||||||||||
| | Pgvector | [x] | [ ] | | ||||||||||
| | Elasticsearch | [ ] | [ ] | | ||||||||||
| | Milvus | [ ] | [ ] | | ||||||||||
| | Faiss | [ ] | [ ] | | ||||||||||
|
|
||||||||||
|
|
||||||||||
| ## Example | ||||||||||
|
|
||||||||||
| See [https://github.com/feast-dev/feast-workshop/blob/rag/module_4_rag](https://github.com/feast-dev/feast-workshop/blob/rag/module_4_rag) for an example on how to use vector database. | ||||||||||
|
|
||||||||||
| ### **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_tore.yaml file to initialize the feature store. This will use the data as offline store, and Pgvector as online store. | ||||||||||
|
|
||||||||||
| ```yaml | ||||||||||
| project: feast_demo_local | ||||||||||
| provider: local | ||||||||||
| registry: | ||||||||||
| registry_type: sql | ||||||||||
| path: postgresql://@localhost:5432/feast | ||||||||||
| online_store: | ||||||||||
| type: postgres | ||||||||||
| pgvector_enabled: true | ||||||||||
| vector_len: 384 | ||||||||||
| host: 127.0.0.1 | ||||||||||
| port: 5432 | ||||||||||
| database: feast | ||||||||||
| user: "" | ||||||||||
| password: "" | ||||||||||
|
|
||||||||||
|
|
||||||||||
| offline_store: | ||||||||||
| type: file | ||||||||||
| entity_key_serialization_version: 2 | ||||||||||
| ``` | ||||||||||
| Run the following command to apply the feature store configuration: | ||||||||||
|
|
||||||||||
| ```shell | ||||||||||
| feast apply | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| Then run the following command to materialize the data to the online store: | ||||||||||
|
||||||||||
| Then run the following command to materialize the data to the online store: | |
| Then run the following command in the terminal to materialize the data to the online store: |
Outdated
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would suggest the below so time doesn't impact this
Suggested change
| !feast materialize 2024-04-01T00:00:00 2024-04-17T00:00:00 | |
| ```shell | |
| CURRENT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%S") | |
| feast materialize-incremental $CURRENT_TIME |
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.
Uh oh!
There was an error while loading. Please reload this page.