Skip to content

Commit 0fa28bc

Browse files
committed
feat: Add Pinecone online store integration
Signed-off-by: Siddhesh Khairnar <khairnarsiddhesh4057@gmail.com>
1 parent a57ea33 commit 0fa28bc

12 files changed

Lines changed: 2206 additions & 869 deletions

File tree

‎docs/SUMMARY.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@
167167
* [Aerospike](reference/online-stores/aerospike.md)
168168
* [Elasticsearch](reference/online-stores/elasticsearch.md)
169169
* [Qdrant](reference/online-stores/qdrant.md)
170+
* [Pinecone](reference/online-stores/pinecone.md)
170171
* [Faiss](reference/online-stores/faiss.md)
171172
* [Hybrid](reference/online-stores/hybrid.md)
172173
* [Registries](reference/registries/README.md)

‎docs/reference/alpha-vector-database.md‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Below are supported vector databases and implemented features:
1616
| SQLite | [x] | [ ] | [x] | [x] |
1717
| Qdrant | [x] | [x] | [] | [] |
1818
| ScyllaDB | [x] | [x] | [x] | [x] |
19+
| Pinecone | [x] | [x] | [x] | [x] |
1920

2021
*Note: V2 Support means the SDK supports retrieval of features along with vector embeddings from vector similarity search.
2122

@@ -190,7 +191,7 @@ print('\n'.join([c.message.content for c in response.choices]))
190191

191192
### Configuration and Installation
192193

193-
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.
194+
We offer [Milvus](https://milvus.io/), [PGVector](https://github.com/pgvector/pgvector), [SQLite](https://github.com/asg017/sqlite-vec), [Elasticsearch](https://www.elastic.co), [Qdrant](https://qdrant.tech/) and [Pinecone](https://www.pinecone.io/) as Online Store options for Vector Databases.
194195

195196
Milvus offers a convenient local implementation for vector similarity search. To use Milvus, you can install the Feast package with the Milvus extra.
196197

@@ -210,6 +211,12 @@ pip install feast[elasticsearch]
210211
```bash
211212
pip install feast[qdrant]
212213
```
214+
#### Installation with Pinecone
215+
216+
```bash
217+
pip install feast[pinecone]
218+
```
219+
213220
#### Installation with SQLite
214221

215222
If you are using `pyenv` to manage your Python versions, you can install the SQLite extension with the following command:

‎docs/reference/online-stores/README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ Please see [Online Store](../../getting-started/components/online-store.md) for
9090
[milvus.md](milvus.md)
9191
{% endcontent-ref %}
9292

93+
{% content-ref url="pinecone.md" %}
94+
[pinecone.md](pinecone.md)
95+
{% endcontent-ref %}
96+
9397
{% content-ref url="faiss.md" %}
9498
[faiss.md](faiss.md)
9599
{% endcontent-ref %}
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Pinecone online store
2+
3+
## Description
4+
5+
The [Pinecone](https://www.pinecone.io/) online store provides support for materializing feature values into a Pinecone vector database. It is particularly suited for AI workloads that require both low-latency feature serving and vector similarity search for RAG (Retrieval-Augmented Generation) applications.
6+
7+
## Getting started
8+
9+
In order to use this online store, you'll need to install the Pinecone extra (along with the dependency needed for the offline store of choice). E.g.
10+
11+
`pip install 'feast[pinecone]'`
12+
13+
You will also need a Pinecone account and API key. Set your API key via the `PINECONE_API_KEY` environment variable or directly in `feature_store.yaml`.
14+
15+
## Examples
16+
17+
{% code title="feature_store.yaml" %}
18+
```yaml
19+
project: my_feature_repo
20+
registry: data/registry.db
21+
provider: local
22+
online_store:
23+
type: pinecone
24+
api_key: ${PINECONE_API_KEY}
25+
index_name: feast-online
26+
embedding_dim: 384
27+
metric: cosine
28+
cloud: aws
29+
region: us-east-1
30+
vector_enabled: true
31+
```
32+
{% endcode %}
33+
34+
### Using a custom namespace
35+
36+
By default, Feast maps each feature view to a Pinecone namespace (`{project}_{feature_view_name}`). You can override this with a fixed namespace:
37+
38+
{% code title="feature_store.yaml" %}
39+
```yaml
40+
online_store:
41+
type: pinecone
42+
api_key: ${PINECONE_API_KEY}
43+
index_name: feast-online
44+
namespace: my-custom-namespace
45+
embedding_dim: 384
46+
```
47+
{% endcode %}
48+
49+
### Vector similarity search
50+
51+
Pinecone supports the `retrieve_online_documents_v2` API for vector similarity search:
52+
53+
```python
54+
from feast import FeatureStore
55+
56+
store = FeatureStore(repo_path=".")
57+
58+
results = store.retrieve_online_documents_v2(
59+
features=[
60+
"city_embeddings:vector",
61+
"city_embeddings:sentence_chunks",
62+
],
63+
query=query_embedding,
64+
top_k=5,
65+
distance_metric="cosine",
66+
).to_df()
67+
```
68+
69+
The full set of configuration options is available in [PineconeOnlineStoreConfig](https://rtd.feast.dev/en/latest/#feast.infra.online_stores.pinecone_online_store.pinecone.PineconeOnlineStoreConfig).
70+
71+
## Configuration options
72+
73+
| Option | Type | Default | Description |
74+
|:---|:---|:---|:---|
75+
| `type` | string | `"pinecone"` | Must be `pinecone` |
76+
| `api_key` | string | `None` | Pinecone API key (falls back to `PINECONE_API_KEY` env var) |
77+
| `index_name` | string | `"feast-online"` | Name of the Pinecone index |
78+
| `namespace` | string | `None` | Override namespace (default: `{project}_{fv_name}`) |
79+
| `embedding_dim` | int | `128` | Vector dimension |
80+
| `metric` | string | `"cosine"` | Distance metric: `cosine`, `euclidean`, or `dotproduct` |
81+
| `cloud` | string | `"aws"` | Cloud provider for serverless indexes |
82+
| `region` | string | `"us-east-1"` | Cloud region for serverless indexes |
83+
| `vector_enabled` | bool | `true` | Enable vector similarity search |
84+
| `batch_size` | int | `100` | Number of vectors per upsert batch |
85+
86+
## Functionality Matrix
87+
88+
The set of functionality supported by online stores is described in detail [here](overview.md#functionality).
89+
Below is a matrix indicating which functionality is supported by the Pinecone online store.
90+
91+
| | Pinecone |
92+
|:----------------------------------------------------------|:---------|
93+
| write feature values to the online store | yes |
94+
| read feature values from the online store | yes |
95+
| update infrastructure (e.g. tables) in the online store | yes |
96+
| teardown infrastructure (e.g. tables) in the online store | yes |
97+
| generate a plan of infrastructure changes | no |
98+
| support for on-demand transforms | yes |
99+
| readable by Python SDK | yes |
100+
| readable by Java | no |
101+
| readable by Go | no |
102+
| support for entityless feature views | yes |
103+
| support for concurrent writing to the same key | yes |
104+
| support for ttl (time to live) at retrieval | no |
105+
| support for deleting expired data | no |
106+
| collocated by feature view | no |
107+
| collocated by feature service | no |
108+
| collocated by entity key | no |
109+
| vector similarity search | yes |

0 commit comments

Comments
 (0)