You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Problem
Some examples in the README contained errors
## Solution
Fix broken examples, tidy up the text.
## Type of Change
- [x] Non-code change (docs, etc)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Major README overhaul for clarity and correctness.
>
> - Adds badges, feature list, and a structured Table of Contents
> - Clarifies installation with base vs optional extras, adds `uv`, and
notes API key configuration
> - Fixes and expands Quickstart examples: BYOV flow (`create_index`,
`Index`, `upsert`, `query`) and integrated inference
(`create_index_for_model`, `IndexEmbed`, `upsert_records`,
`search_records`); corrects variable names/usages
> - Adds Pinecone Assistant note (bundled by default) and reorganizes
"More information" links into Index Management, Data Operations, and
Advanced Features sections
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f34ba4e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
The official Pinecone Python SDK for building vector search applications with AI/ML.
5
+
6
+
Pinecone is a vector database that makes it easy to add vector search to production applications. Use Pinecone to store, search, and manage high-dimensional vectors for applications like semantic search, recommendation systems, and RAG (Retrieval-Augmented Generation).
7
+
8
+
## Features
9
+
10
+
-**Vector Operations**: Store, query, and manage high-dimensional vectors with metadata filtering
11
+
-**Serverless & Pod Indexes**: Choose between serverless (auto-scaling) or pod-based (dedicated) indexes
12
+
-**Integrated Inference**: Built-in embedding and reranking models for end-to-end search workflows
13
+
-**Async Support**: Full asyncio support with `PineconeAsyncio` for modern Python applications
14
+
-**GRPC Support**: Optional GRPC transport for improved performance
15
+
-**Type Safety**: Full type hints and type checking support
16
+
17
+
## Table of Contents
18
+
19
+
-[Documentation](#documentation)
20
+
-[Prerequisites](#prerequisites)
21
+
-[Installation](#installation)
22
+
-[Quickstart](#quickstart)
23
+
-[Bringing your own vectors](#bringing-your-own-vectors-to-pinecone)
24
+
-[Bring your own data using Pinecone integrated inference](#bring-your-own-data-using-pinecone-integrated-inference)
25
+
-[Pinecone Assistant](#pinecone-assistant)
26
+
-[More Information](#more-information-on-usage)
27
+
-[Issues & Bugs](#issues--bugs)
28
+
-[Contributing](#contributing)
5
29
6
30
## Documentation
7
31
@@ -24,12 +48,21 @@ For notes on changes between major versions, see [Upgrading](./docs/upgrading.md
24
48
25
49
## Installation
26
50
27
-
The Pinecone Python SDK is distributed on PyPI using the package name `pinecone`. By default the `pinecone` has a minimal set of dependencies, but you can install some extras to unlock additional functionality.
51
+
The Pinecone Python SDK is distributed on PyPI using the package name `pinecone`. The base installation includes everything you need to get started with vector operations, but you can install optional extras to unlock additional functionality.
- Index management (create, list, describe, delete)
57
+
- Metadata filtering
58
+
- Pinecone Assistant plugin
59
+
60
+
**Optional extras:**
28
61
29
-
Available extras:
62
+
-`pinecone[asyncio]` - Adds `aiohttp` dependency and enables `PineconeAsyncio` for async/await support. Use this if you're building applications with FastAPI, aiohttp, or other async frameworks.
63
+
-`pinecone[grpc]` - Adds `grpcio` and related libraries for GRPC transport. Provides modest performance improvements for data operations like `upsert` and `query`. See the guide on [tuning performance](https://docs.pinecone.io/docs/performance-tuning).
30
64
31
-
-`pinecone[asyncio]` will add a dependency on `aiohttp` and enable usage of `PineconeAsyncio`, the asyncio-enabled version of the client for use with highly asynchronous modern web frameworks such as FastAPI.
32
-
-`pinecone[grpc]` will add dependencies on `grpcio` and related libraries needed to make pinecone data calls such as `upsert` and `query` over [GRPC](https://grpc.io/) for a modest performance improvement. See the guide on [tuning performance](https://docs.pinecone.io/docs/performance-tuning).
65
+
**Configuration:** The SDK can read your API key from the `PINECONE_API_KEY` environment variable, or you can pass it directly when instantiating the client.
This example shows how to create an index, add vectors with embeddings you've generated, and query them. This approach gives you full control over your embedding model and vector generation process.
69
104
70
105
```python
71
106
from pinecone import (
@@ -77,8 +112,12 @@ from pinecone import (
77
112
)
78
113
79
114
# 1. Instantiate the Pinecone client
115
+
# Option A: Pass API key directly
80
116
pc = Pinecone(api_key='YOUR_API_KEY')
81
117
118
+
# Option B: Use environment variable (PINECONE_API_KEY)
119
+
# pc = Pinecone()
120
+
82
121
# 2. Create an index
83
122
index_config = pc.create_index(
84
123
name="index-name",
@@ -112,20 +151,25 @@ idx.query(
112
151
)
113
152
```
114
153
115
-
## Bring your own data using Pinecone integrated inference
154
+
### Bring your own data using Pinecone integrated inference
155
+
156
+
This example demonstrates using Pinecone's integrated inference capabilities. You provide raw text data, and Pinecone handles embedding generation and optional reranking automatically. This is ideal when you want to focus on your data and let Pinecone handle the ML complexity.
116
157
117
158
```python
118
159
from pinecone import (
119
160
Pinecone,
120
161
CloudProvider,
121
162
AwsRegion,
122
163
EmbedModel,
164
+
IndexEmbed,
123
165
)
124
166
125
167
# 1. Instantiate the Pinecone client
126
-
pc = Pinecone(api_key="<<PINECONE_API_KEY>>")
168
+
# The API key can be passed directly or read from PINECONE_API_KEY environment variable
169
+
pc = Pinecone(api_key='YOUR_API_KEY')
127
170
128
-
# 2. Create an index configured for use with a particular model
171
+
# 2. Create an index configured for use with a particular embedding model
172
+
# This sets up the index with the right dimensions and configuration for your chosen model
# 3. Instantiate an Index client for data operations
140
184
idx = pc.Index(host=index_config.host)
141
185
142
-
# 4. Upsert records
186
+
# 4. Upsert records with raw text data
187
+
# Pinecone will automatically generate embeddings using the configured model
143
188
idx.upsert_records(
144
189
namespace="my-namespace",
145
190
records=[
@@ -170,10 +215,11 @@ idx.upsert_records(
170
215
],
171
216
)
172
217
173
-
# 5. Search for similar records
218
+
# 5. Search for similar records using text queries
219
+
# Pinecone handles embedding the query and optionally reranking results
174
220
from pinecone import SearchQuery, SearchRerank, RerankModel
175
221
176
-
response =index.search_records(
222
+
response =idx.search_records(
177
223
namespace="my-namespace",
178
224
query=SearchQuery(
179
225
inputs={
@@ -199,15 +245,18 @@ For more information on Pinecone Assistant, see the [Pinecone Assistant document
199
245
200
246
## More information on usage
201
247
202
-
Detailed information on specific ways of using the SDK are covered in these other pages.
248
+
Detailed information on specific ways of using the SDK are covered in these guides:
249
+
250
+
**Index Management:**
251
+
-[Serverless Indexes](./docs/db_control/serverless-indexes.md) - Learn about auto-scaling serverless indexes that scale automatically with your workload
252
+
-[Pod Indexes](./docs/db_control/pod-indexes.md) - Understand dedicated pod-based indexes for consistent performance
0 commit comments