pinecone
. By default, the pinecone
package has a minimal set of dependencies and interacts with Pinecone via HTTP requests. However, you can install the following extras to unlock additional functionality:
pinecone[grpc]
adds dependencies on grpcio
and related libraries needed to run data operations such as upserts and queries over gRPC for a modest performance improvement.
pinecone[asyncio]
adds a dependency on aiohttp
and enables usage of async
methods for use with asyncio. For more details, see Asyncio support.
API version | SDK version |
---|---|
2025-04 (latest) | v7.x |
2025-01 | v6.x |
2024-10 | v5.3.x |
2024-07 | v5.0.x-v5.2.x |
2024-04 | v4.x |
pinecone-plugin-assistant
package is included by default. It is only necessary to install the package if you are using a version of the Python SDK prior to v7.0.0.
v6.0.0
, update all relevant code to account for the breaking changes explained here.Also, make sure to upgrade using the pinecone
package name instead of pinecone-client
; upgrading with the latter will not work as of v6.0.0
.ServerlessSpec
or PodSpec
class as well:
proxy_url
: The location of your proxy. This could be an HTTP or HTTPS URL depending on your proxy setup.proxy_headers
: Accepts a python dictionary which can be used to pass any custom headers required by your proxy. If your proxy is protected by authentication, use this parameter to pass basic authentication headers with a digest of your username and password. The make_headers
utility from urllib3
can be used to help construct the dictionary. Note: Not supported with Asyncio.ssl_ca_certs
: By default, the client will perform SSL certificate verification using the CA bundle maintained by Mozilla in the certifi
package. If your proxy is using self-signed certicates, use this parameter to specify the path to the certificate (PEM format).ssl_verify
: SSL verification is enabled by default, but it is disabled when set to False
. It is not recommened to go into production with SSL verification disabled.async
methods for use with asyncio. Asyncio support makes it possible to use Pinecone with modern async web frameworks such as FastAPI, Quart, and Sanic, and should significantly increase the efficiency of running requests in parallel.
Use the PineconeAsyncio
class to create and manage indexes and the IndexAsyncio
class to read and write index data. To ensure that sessions are properly closed, use the async with
syntax when creating PineconeAsyncio
and IndexAsyncio
objects.
query_namespaces
utility method to run a query in parallel across multiple namespaces in an index and then merge the result sets into a single ranked result set with the top_k
most relevant results.
The query_namespaces
method accepts most of the same arguments as query
with the addition of a required namespaces
parameter.
pool_threads
and connection_pool_maxsize
properties on the index client. The pool_threads
setting is the number of threads available to execute requests, while connection_pool_maxsize
is the number of cached http connections that will be held. Since these tasks are not computationally heavy and are mainly i/o bound, it should be okay to have a high ratio of threads to cpus.The combined results include the sum of all read unit usage used to perform the underlying queries for each namespace.upsert_from_dataframe
method. The method includes retry logic andbatch_size
, and is performant especially with Parquet file data sets.
The following example upserts the uora_all-MiniLM-L6-bm25
dataset as a dataframe.