Skip to content

Commit 804ff38

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

11 files changed

Lines changed: 1311 additions & 2 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
@@ -15,6 +15,7 @@ Below are supported vector databases and implemented features:
1515
| Faiss | [ ] | [ ] | [] | [] |
1616
| SQLite | [x] | [ ] | [x] | [x] |
1717
| Qdrant | [x] | [x] | [] | [] |
18+
| Pinecone | [x] | [x] | [x] | [x] |
1819

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

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

190191
### Configuration and Installation
191192

192-
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.
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), [Qdrant](https://qdrant.tech/) and [Pinecone](https://www.pinecone.io/) as Online Store options for Vector Databases.
193194

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

@@ -209,6 +210,12 @@ pip install feast[elasticsearch]
209210
```bash
210211
pip install feast[qdrant]
211212
```
213+
#### Installation with Pinecone
214+
215+
```bash
216+
pip install feast[pinecone]
217+
```
218+
212219
#### Installation with SQLite
213220

214221
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 |

‎pyproject.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ postgres = ["psycopg[binary,pool]>=3.2.5"]
118118
# https://www.psycopg.org/psycopg3/docs/basic/install.html#local-installation
119119
postgres-c = ["psycopg[c,pool]>=3.2.5"]
120120
pytorch = ["torch>=2.7.0", "torchvision>=0.22.1"]
121+
pinecone = ["pinecone>=5.0"]
121122
qdrant = ["qdrant-client>=1.12.0"]
122123
rag = [
123124
"transformers>=4.36.0",
@@ -161,7 +162,7 @@ test = [
161162
]
162163

163164
ci = [
164-
"feast[test, aws, azure, cassandra, clickhouse, couchbase, delta, docling, duckdb, elasticsearch, faiss, gcp, ge, go, grpcio, hazelcast, hbase, ibis, image, k8s, mcp, milvus, mlflow, mongodb, mssql, mysql, openlineage, opentelemetry, oracle, spark, trino, postgres, pytorch, qdrant, rag, ray, redis, singlestore, snowflake, sqlite_vec]",
165+
"feast[test, aws, azure, cassandra, clickhouse, couchbase, delta, docling, duckdb, elasticsearch, faiss, gcp, ge, go, grpcio, hazelcast, hbase, ibis, image, k8s, mcp, milvus, mlflow, mongodb, mssql, mysql, openlineage, opentelemetry, oracle, pinecone, spark, trino, postgres, pytorch, qdrant, rag, ray, redis, singlestore, snowflake, sqlite_vec]",
165166
"build",
166167
"virtualenv==20.23.0",
167168
"dbt-artifacts-parser",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from feast.infra.online_stores.pinecone_online_store.pinecone import (
2+
PineconeOnlineStore,
3+
PineconeOnlineStoreConfig,
4+
)
5+
6+
__all__ = ["PineconeOnlineStore", "PineconeOnlineStoreConfig"]

0 commit comments

Comments
 (0)