Official Python SDK for the Pinecone vector database
Repo pinecone-io/python-sdk, read from GitHub 11 h ago. pinecone-io has not joined Take My Repo.
10.3.0 adds two integrated-embedding settings for document indexes, from Silas Smith (@ssmith-pc): a per-search query task and a processing location. It also fixes gRPC through authenticating proxies. Nothing is removed or renamed; the API version is still 2026-07.
Act only if you give the gRPC client a proxy_url that isn't http:// (see Behavior change), or your logs captured a PineconeConfig or Config repr with a proxy password (rotate it).
Set the query task per search: EmbedQuery.parameters (docs, 3b6923e)
EmbedQuery(field=..., query=..., parameters: dict[str, Any] | None = None) overrides the field's read_parameters for one search.gemini-embedding-2 field indexed for retrieval can also answer fact-checking queries, with no second index or re-embedding.task_type can be set today; the server validates it. pc.inference.list_models() lists the models that accept it.read_parameters apply and the key is not sent. SparseEmbedQuery does not take it.from pinecone import EmbedQuery, Pinecone pc = Pinecone() facts = pc.index("fact-checks") # "body" embeds with gemini-embedding-2 results = facts.documents.search( namespace="claims-en", top_k=5, score_by=[ EmbedQuery( field="body", query="Is the Eiffel Tower taller than 300 m?", parameters={"task_type": "fact_verification"}, ) ], )
Choose where your text is processed: FieldEmbedConfig.processing_location (8396d55)
FieldEmbedConfig(..., processing_location: str | None = None), such as "us", sets where the model processes your documents and queries.embed={"model": ..., "processing_location": "us"}). Like the rest of embed, it cannot change later.pc.indexes.describe(name).schema.fields["body"].embed.processing_location reports it; 10.2.0 dropped it.embed only; FieldSparseEmbedConfig does not take it.from pinecone import FieldEmbedConfig, Pinecone, SchemaBuilder pc = Pinecone() schema = ( SchemaBuilder() .add_string_field( "body", embed=FieldEmbedConfig(model="text-embedding-3-large", processing_location="us"), ) .build() ) pc.indexes.create(name="support-articles-us", schema=schema)
Search guide organized by kind of search (docs only) (Search documents, d6e79e1)
# Clauses available before 10.3.0; the guide maps each to a kind of search. from pinecone import DenseVectorQuery, EmbedQuery, SparseEmbedQuery, SparseValues, SparseVectorQuery, TextQuery # Semantic: by meaning EmbedQuery(field="body", query="how did Rome move water") # Pinecone embeds the text DenseVectorQuery(field="body_vector", values=[0.012, -0.087, 0.153]) # you pass the vector # Sparse-vector: by weighted term overlap SparseEmbedQuery(field="body", query="roman aqueduct") SparseVectorQuery(field="body_sparse_vector", sparse_values=SparseValues(indices=[3, 41], values=[0.6, 0.4])) # Full-text: by the words themselves TextQuery(fields=["title"], query="roman aqueduct")
http:// proxy URLsGrpcIndex(..., proxy_url=...) and pc.index(..., grpc=True) when proxy_url starts with https://, socks5:// or socks5h:// (10.2.0 accepted these), or has no scheme.pc.index raises before it looks up the host):PineconeValueError: gRPC supports only http:// proxies; got 'https://***@proxy'; use an http:// proxy URL (traffic inside the tunnel is still TLS) or use REST (grpc=False), which also supports https:// and SOCKS proxies
http://. If gRPC worked with your URL in 10.2.0, keep its host and port: 10.2.0 already spoke plain HTTP there.https:// proxy: pc.index(..., grpc=True) reuses Pinecone(proxy_url=...) and has no per-call override. Keep https:// on Pinecone and give GrpcIndex its own http:// URL:from pinecone import GrpcIndex, Pinecone pc = Pinecone(proxy_url="https://user:pass@proxy.corp:443") # REST keeps TLS to the proxy idx = GrpcIndex(host=pc.indexes.describe("my-index").host, proxy_url="http://user:pass@proxy.corp:3128")
grpc=True and use REST.Pinecone, AsyncPinecone, pc.index(...) without grpc=True) still accepts http://, https://, socks5:// and socks5h://. Don't switch a shared Pinecone(proxy_url=...) to http:// for gRPC's sake: REST would then send its proxy credentials in plaintext too.proxy_url credentials (see Fixes), and would send them unencrypted to an https:// proxy. No earlier release sent them at all. (653d62b)Skip this section if you don't set proxy_url.
proxy_url="http://user:pass@proxy:3128", gRPC sends Proxy-Authorization: Basic on CONNECT; before, an authenticating proxy refused the tunnel. gRPC ignores proxy_headers, so put gRPC credentials in the URL. REST proxy_headers are unchanged. (736bfb6)proxy_url fails at construction with a masked error. Pinecone, AsyncPinecone, Index, AsyncIndex and Admin raise PineconeValueError("Invalid proxy URL '***@proxy.corp:3128': it has no scheme; start it with http:// or https://"), naming the problem. GrpcIndex raises the gRPC error above. Before, httpx raised ValueError or httpx.InvalidURL with text that could include the password. PineconeValueError is a ValueError; except httpx.InvalidURL no longer matches. Percent-encode #, /, ? and @ in credentials (Authentication). (653d62b)repr() of PineconeConfig and Config used to print the password in proxy_url. They now print http://***@host:port. If your logs captured one, rotate the proxy password. (d895c1d, c180469)PINECONE_DEBUG_CURL shell-quotes its output. A URL, header or body containing ' no longer breaks the logged curl command. (d895c1d)None that reach users: runtime Python dependencies and the crates in the Rust extension match 10.2.0.
pip install --upgrade pinecone # or uv add "pinecone>=10.3,<11"
Full Changelog: v10.2.0...v10.3.0
Version 10.2.0 fixes a TLS certificate-verification flaw in the gRPC client and adds full-text match operators to the Field filter builder. It targets the same 2026-07 API as 10.1.0 and removes or renames nothing.
What to do:
certifi to 2026.10.19 or later.gRPC users: upgrade to 10.2.0 (RUSTSEC-2026-0382, CVE-2026-111943, 7ecd4b0)
pc.index(..., grpc=True), PineconeGRPC, or GrpcIndex/GRPCIndex.rustls-webpki can accept certificates chained through emSign intermediates whose private keys are now public. An attacker with those keys and a position on your network path could impersonate your index and read your API key and data.rustls-webpki 0.103.16, which rejects those chains.Everyone, gRPC users included: upgrade certifi (GHSA-6q48-6c7w-9gw2)
certifi is installed in your environment.certifi releases before 2026.10.19 trust the same compromised emSign roots.pinecone isn't enough: the SDK deliberately doesn't pin certifi, so it stays compatible with the other packages in your environment.pip install --upgrade "certifi>=2026.10.19" (or uv add "certifi>=2026.10.19") and keep that floor in your own dependencies.ssl_ca_certs or set SSL_CERT_FILE or SSL_CERT_DIR, make sure that bundle no longer trusts the emSign roots.No action needed for tokio: the bundled tokio moves to 1.51.6 for RUSTSEC-2026-0386. The SDK never calls the affected API.
Full-text match filters for documents (docs, 9fc62f4)
Narrow document search and fetch results by the words in a text field, not only by exact values. Field gains three methods:
match_phrase: the words, in ordermatch_all: every word, in any ordermatch_any: at least one of the wordsThings to know:
string fields declared with full_text_search, or with embed/sparse_embed unless you set store_text=False.filter of documents.search and documents.fetch. The server rejects them in documents.delete and documents.update.Field filter, pass the result's .to_dict().from pinecone import EmbedQuery, Field, Pinecone pc = Pinecone() index = pc.index("articles") # "body" is a string field declared with embed=True # Semantic search, limited to documents whose body contains "roman aqueduct" # and whose year metadata is 100 or later. results = index.documents.search( namespace="en", top_k=5, score_by=[EmbedQuery(field="body", query="how did Rome move water")], filter=(Field("body").match_phrase("roman aqueduct") & Field("year").gte(100)).to_dict(), )
index.create_namespace(name="__default__") still raises "reserved and cannot be created", but the message no longer claims the namespace always exists. It now explains that this holds only on an index created with dimension/metric, and that on a document index you create it by upserting documents into it. (bbe1282)New guides for document indexes:
pip install --upgrade pinecone "certifi>=2026.10.19" # or uv add "pinecone>=10.2,<11" "certifi>=2026.10.19"
Full Changelog: v10.1.0...v10.2.0
Version 10.1.0 lets a document index embed text for you. It targets the same 2026-07 API as 10.0.0 and removes or renames nothing.
Pinecone can embed your text: mark a string field embed=True or sparse_embed=True. (docs, f32f4e2)
from pinecone import EmbedQuery, Pinecone, SchemaBuilder # Reads the API key from the PINECONE_API_KEY environment variable. pc = Pinecone() # Declare a string field that Pinecone embeds for you. schema = SchemaBuilder().add_string_field("body", embed=True).build() pc.indexes.create(name="articles", schema=schema) index = pc.index("articles") # Write plain-text documents; Pinecone embeds each body. index.documents.upsert( namespace="en", documents=[ {"_id": "a1", "body": "Aqueducts carried water by gravity"}, {"_id": "a2", "body": "The Colosseum seated 50,000 people"}, {"_id": "a3", "body": "Hypocausts heated the public baths"}, {"_id": "a4", "body": "Roman roads were built in layers"}, ], ) # Search with plain text; Pinecone embeds the query too. results = index.documents.search( namespace="en", top_k=2, score_by=[ EmbedQuery(field="body", query="how did Rome move water"), ], ) for doc in results.matches: print(doc.id, doc.score)
batch_upsert size of 50 fits.EmbedQuery or SparseEmbedQuery must be the only clause in score_by.FieldEmbedConfig or FieldSparseEmbedConfig; skip storing text with store_text=False.usage.embed_total_tokens. (6ff91fd)documents.batch_upsert splits a batch the server rejects as too large, instead of failing it. (8f1f96c)
documents.fetch takes a limit of up to 10,000 for filtered fetches. (6ea0da1)
HTTP 413 raises PayloadTooLargeError, a subclass of ApiError. (445d520)
Python 3.15 is supported, with prebuilt wheels. (04e7125)
These are subtle changes that clarify or fix how the SDK handles error cases and invalid input. For a working integration the real-world impact should be minimal. The 10.0 to 10.1 upgrade docs shows before and after for each.
documents.search, not documents.fetch; only search reports is_reconciled. (recipe, 203cf92)score_by clause raise PineconeValueError; deleting them leaves results unchanged. (70a44c5)ValueErrors are now PineconeTypeError; catch PineconeError or TypeError. (481b7f9)filter=; call .to_dict() on a filter-builder Condition. (01a6ef3)http:// index host warns, because it sends your API key unencrypted. (8478ce1)timeout or total_timeout raises PineconeValueError. (0c95d26)PineconeTypeError instead of splitting into characters. (5c815cc)score_by, top_k, or limit raises PineconeTypeError. (dc490db)timeout on indexes.create or indexes.delete raises; -1 still skips waiting. (04fc0c6)PineconeTypeError; pass str(...). (481b7f9)pc.indexes.create(schema={...}). (86583ac)PINECONE_ADDITIONAL_HEADERS is no longer logged; if you set it, check old logs and rotate exposed credentials. (607c574)GrpcIndex users: upgrade for the rustls fix to RUSTSEC-2026-0285. (1447100, why 0346 to 0349 don't apply)pinecone.db_data and pinecone.exceptions work again. (570f591)BatchResult, BatchError, and Condition import from pinecone. (970b229)fields=["name"]. (c94296f)SparseValues object works as a document field value. (4404dfe)DenseVectorQuery and SparseVectorQuery accept NumPy arrays. (9ee5fa3)metric, such as "Cosine", is lowercased before it is sent. (de7d145)IndexModel.dimension, .metric, and .vector_type work for an embed field's dense vector. (6dc91ef)additional_headers entry replaces the SDK's same-named header, whatever its case. (2c23e7d)EmbedConfig.to_dict() keeps dimension. (bc48c1c)admin.projects.delete_with_cleanup() deletes every page of backups, so the project delete succeeds. (e55f503)AGENTS.md now await AsyncPinecone.index(host=...). (fb7d5d3)pip install --upgrade pinecone # or uv add 'pinecone>=10.1,<11'
Migrating to V10 still covers upgrades from 9.x. Coming from 10.0? See Upgrading from 10.0 to 10.1.
Full Changelog: v10.0.0...v10.1.0
Version 10.0.0 is the SDK for the Pinecone 2026-07 API. It runs on Python 3.10 through 3.14 and sends 2026-07 on every plane by default. The release graduates the schema-based document interface, SchemaBuilder, and the rest of the 2026-07 API out of pinecone.preview onto the main client objects. There are breaking changes: a short list of the most important changes are outlined below, and Migrating to V10 is the complete accounting.
If your workload upserts and queries an existing index, upgrading does not change what your code means. upsert, query, fetch, update, delete, list, and describe_index_stats take the same arguments and return the same shapes they did on 9.x; pc.Index("movies") and pc.index("movies") both still hand you an index, though only pc.index() narrows its return type, so reach index.documents through that one; and none of those operations is deprecated or scheduled for removal. Indexes you created before 2026-07 go on being served by them. Three things do change on that path, each covered below: a batched upsert paces itself differently, some invalid calls now raise locally instead of being refused by the server, and gRPC upsert_from_dataframe collects partial failures rather than raising on the first one.
The breaking changes are concentrated in pc.indexes.create's arguments and return model, and in the surfaces that graduated out of pinecone.preview. Flat create_index(...) with dimension=, metric=, or spec= needs no edits: it takes its 9.1.0 parameters in the 9.1.0 order, positionally or by keyword. Which family of operations serves an index follows the index itself, not the SDK version — an index created before 2026-07 is addressed through the vector operations above, and one created with a 2026-07 document schema through index.documents.
Documents API. Records are addressed as documents: a JSON object with an _id, the fields you declared in the index schema, and any metadata alongside them. Upsert, search, fetch, list, update, and delete all live on index.documents, on the sync and async clients alike, and index.documents.batch_upsert handles large loads with the same admission gate and partial-failure reporting the vector path uses. See Quickstart.
from pinecone import DenseVectorQuery, Pinecone index = Pinecone().index("quickstart") index.documents.upsert( namespace="movies", documents=[ { "_id": "movie-001", "embedding": [0.1, 0.2, 0.3], "title": "Arrival", }, ], ) results = index.documents.search( namespace="movies", top_k=3, score_by=[DenseVectorQuery(field="embedding", values=[0.1, 0.2, 0.3])], )
SchemaBuilder. An index's fields are declared as a schema, and SchemaBuilder builds that schema in Python instead of by hand-assembling nested dicts. Every add_* method returns the builder, and build() returns a plain {"fields": {...}} dict you hand straight to pc.indexes.create(schema=...). See Schema Builder.
from pinecone import Pinecone, SchemaBuilder schema = ( SchemaBuilder() .add_dense_vector_field("embedding", dimension=1024, metric="cosine") .add_string_field("title", full_text_search={"language": "en"}) .build() ) pc = Pinecone() pc.indexes.create( name="product-search", schema=schema, deployment={ "deployment_type": "managed", "cloud": "aws", "region": "us-east-1", }, )
Full-text search configuration. String fields carry their own full-text search config: language, stemming, stop words, and character n-grams for substring and autocomplete matching, set per field at index creation. NgramConfig and FullTextSearchConfig are exported from pinecone for building the config as typed objects; n-grams cannot be combined with stemming or stop words. See Schema Builder.
schema = ( SchemaBuilder() .add_string_field( "title", full_text_search={"ngram": {"min_gram": 2, "max_gram": 4}}, ) .build() )
Backup schedules. Attach a recurring cadence to an index and backups keep happening without a caller. Schedules live on pc.backup_schedules, with create, list, describe, update, delete, and a per-schedule run history. frequency takes exactly daily, weekly, or monthly; there is no cron support, and only one enabled schedule per index is allowed. See Backups and restore.
schedule = pc.backup_schedules.create( index_name="product-search", name="daily-backup", frequency="daily", retention_days=90, ) for run in pc.backup_schedules.iter_history(schedule_id=schedule.schedule_id): print(run.backup_id, run.status, run.record_count)
Organization management on the Admin client. Admin was OAuth, organizations, projects, and API keys. It now also manages the people and machines in an organization: admin.users, admin.invites, admin.service_accounts, and admin.role_bindings. Role bindings are the whole authorization model: one role, one principal, one scope, and nothing else confers permissions. See Admin.
from pinecone.admin import Admin admin = Admin(client_id="...", client_secret="...") admin.invites.create( email="newhire@acme.com", role_bindings=[ {"resource_type": "organization", "role": "OrgMember"}, ], ) created = admin.service_accounts.create( name="ci-deploy", role_bindings=[ { "resource_type": "project", "resource_id": project_id, "role": "ProjectEditor", }, ], ) print(created.client_secret) # returned exactly once
Assistant operations API. Assistant file writes are asynchronous server-side, and the operations behind them are now first-class and can be listed and described, so a job started with timeout=-1 can be followed rather than inferred from file status. Successes and failures are both kept for 30 days. See Assistant.
operation = pc.assistants.describe_operation( assistant_name="my-assistant", operation_id="op-1234-abcd-5678" ) print(operation.status, operation.percent_complete, operation.error) stuck = pc.assistants.list_operations( assistant_name="my-assistant", operation_type="upload_file", status="Processing", ).to_list()
Dedicated read capacity. An index can be provisioned on dedicated read nodes instead of on-demand capacity, at create time, on configure, and on a restore. One top-level read_capacity= argument covers managed and BYOC indexes, and it reads back from IndexModel.read_capacity. pc.create_index_from_backup(..., read_capacity=...) applies the same configuration to a restored index in one call. See Backups and restore.
pc.indexes.create( name="product-search", schema=schema, deployment={ "deployment_type": "managed", "cloud": "aws", "region": "us-east-1", }, read_capacity={ "mode": "Dedicated", "dedicated": { "node_type": "t1", "scaling": "Manual", "manual": {"shards": 2, "replicas": 2}, }, }, )
Bulk ingest deadlines and concurrency. Batched upserts take a total_timeout, a deadline for the whole call rather than for one attempt of one batch. When it expires the SDK stops submitting; batches in flight finish, and everything unsent comes back as failed items to retry. max_concurrency defaults to 8 and is capped by an adaptive per-host admission gate, so a backend under pressure gets backpressure instead of every batch at once. Identical on REST sync, asyncio, and gRPC. See How Bulk Ingest Behaves.
response = index.upsert( vectors=vectors, batch_size=200, max_concurrency=16, total_timeout=1800, ) # Batch counters and errors carry information only when batch_size is set. print(response.upserted_count, response.failed_item_count) print([(e.disposition, e.retryable) for e in response.errors])
upsert_from_dataframe built for large ingests. The DataFrame path has the same signature on REST, asyncio, and gRPC, and it now gets the full bulk-ingest toolkit: a per-batch timeout, a max_concurrency ceiling, a total_timeout deadline for the whole job, and on_error to choose between collecting partial failures into the response or raising. max_concurrency is unset by default here, unlike upsert, which defaults to 8. Rows that did not land come back in response.failed_items, ready to wrap in a new DataFrame and feed back in. See Reliable Large Ingests with upsert_from_dataframe.
response = index.upsert_from_dataframe( df, namespace="movies", batch_size=500, max_concurrency=8, total_timeout=1800, ) if response.failed_items: leftovers = pd.DataFrame(response.failed_items) index.upsert_from_dataframe(leftovers, namespace="movies", on_error="raise")
Python 3.14. The SDK is tested and classified on 3.10 through 3.14; the requires-python floor stays at 3.10.
This is the headline list, not the complete one. Read Migrating to V10 for every change, including the ones that affect only narrow call shapes.
pinecone.preview is removed with no shim. Preview, AsyncPreview, and every preview.* module are gone. Each call site maps onto the main client:
| 9.x | 10.0.0 |
|---|---|
pc.preview.indexes |
pc.indexes |
pc.preview.index(name=...) / (host=...) |
pc.index(name=...) / (host=...), or pc.index("my-index") |
pc.preview.index(...).documents.upsert(...) |
pc.index(...).documents.upsert(...) |
pc.preview.close() |
pc.close() |
from pinecone.preview import SchemaBuilder |
from pinecone import SchemaBuilder |
AsyncPinecone.index() also became a coroutine — AsyncPreview.index() resolved its host lazily, so it needs an await now.
IndexModel is built from schema and deployment. .created_at is gone. .spec, .embed, .dimension, .metric, and .vector_type still work as deprecated views computed from the new fields, including through index["..."] and to_dict(), but they raise when the schema gives them no single field to resolve to — more than one vector field, or none — and the message names the fields it found.
Bulk ingest defaults changed. max_concurrency went from 4 to 8 on every upsert path, an adaptive admission gate can hold batches back or abandon the rest of a call against a dead backend, and total_timeout bounds the whole call. Pass max_concurrency=4 for the old cap, and inspect response.errors rather than assuming a call that returned did all the work.
GrpcIndex.upsert_from_dataframe no longer raises on partial failure. Failures are collected into the response, so an existing except block around it goes dead. Pass on_error="raise" to restore the previous behavior. Partial failures on gRPC upsert_from_dataframe covers what the response carries and how to retry from it.
pc.indexes.list() returns a Paginator[IndexModel], not an IndexList, so .names() is not available on that path. pc.list_indexes() is unchanged.
Client-side validation raises before the request is sent. top_k outside 1-10000, a page limit out of range, an id over 512 characters, an empty filter={}, mutually exclusive arguments, and malformed namespace names now raise PineconeValueError or PineconeTypeError locally, where 9.x let the server refuse them. Neither is an ApiError subclass, so an except ApiError handler will not see them; except PineconeError covers both.
Assistant file progress fields moved to the operations API. AssistantFileModel.percent_done and .error_message are removed; call pc.assistants.describe_operation(...) and read status, percent_complete, and error.
BackupModel.dimension and .metric are removed. Read .schema instead.
The default API version header is now 2026-07 on every plane. To pin an older version, set it yourself: additional_headers={"X-Pinecone-Api-Version": "2026-01"}.
These paths still work and are not scheduled for removal in 10.x.
dimension=, metric=, vector_type=, and spec= on create_index and pc.indexes.create. Pass schema= and deployment= instead. replicas=, pod_type=, and serverless_read_capacity= on configure are deprecated the same way, translated into deployment= and read_capacity=.IndexModel.spec, .embed, .dimension, .metric, and .vector_type, along with the IndexSpec, ServerlessSpecInfo, PodSpecInfo, ByocSpecInfo, and ModelIndexEmbed classes. Read .deployment and .schema.fields instead; that is where the server reports them and the only place they appear for an index with several vector fields.pool_threads on the client and async_req=True on data-plane methodv9.1.0 is the retry-resilience release. It overhauls how the SDK behaves under throttling: decorrelated jitter on every transport, plus automatic per-host concurrency back-off that shrinks in-flight bulk requests during a 429 storm and recovers as pressure eases. A new RateLimitError lets callers catch throttling distinctly, and a dedicated retries guide documents the full model. Secondary changes round out GrpcIndex parity with the REST clients and restore the v8 search(query={...}) request shape.
AsyncIndex.query_namespaces no longer fires one unbounded request per namespace — a common cause of self-inflicted 429 storms. It's now capped at 10 in-flight.RateLimitError for HTTP 429. Rate-limit responses raise a dedicated pinecone.errors.RateLimitError, so you can catch throttling distinctly from other server errors.docs/guides/retries.md — defaults, jitter math, the adaptive-concurrency ceiling, and the limits of in-process retries under multi-process / serverless deployment.GrpcIndex parity with the REST clients. query_namespaces, query_namespaces_async, fetch_by_metadata, and the full bulk-import API now exist on GrpcIndex, so switching to grpc=True for throughput no longer loses functionality.search(query={...}) syntax from v8 has been restored. Thanks to @pragnyanramtha, the single-argument request-body form that v9.0.x rejected works again on Index, AsyncIndex, and GrpcIndex.REST and gRPC retries now use decorrelated jitter — each delay is drawn from a window that grows with the previous delay, capped at max_wait. This replaces the previous fixed full-jitter backoff and spreads retries from many clients across time instead of bunching them at the same instant. See the retries guide for the exact formula and defaults.
Bulk operations now self-tune their concurrency under throttling. When the backend rate-limits a host (HTTP 429/503, or gRPC RESOURCE_EXHAUSTED), the SDK reduces the number of in-flight requests it allows to that host, then recovers after a streak of successes — the same AIMD (additive-increase / multiplicative-decrease) approach used by TCP congestion control. It's per host, automatic, and requires no configuration; max_concurrency remains the ceiling the SDK tunes beneath.
RateLimitErrorHTTP 429 responses now raise RateLimitError, a subclass of ApiError, so throttling can be caught distinctly from other server errors:
from pinecone.errors import RateLimitError try: pc.indexes.describe("my-index") except RateLimitError: # back off and retry, or surface to your orchestrator ...
Exported from pinecone.errors and the top-level pinecone namespace; a RateLimitException alias matches the existing exception-naming pattern.
The retry and concurrency layers emit namespaced log records with consistent key=value fields, so you can diagnose throttling from logs without adding instrumentation:
pinecone._internal.http_client — DEBUG on each throttled retry attempt (status, host, attempt N/total, computed delay).pinecone._internal.adaptive — DEBUG on each concurrency adjustment; INFO the first time a host is throttled, with an actionable message.Enable these by setting the log level on the namespaces above. See the retries guide for examples.
These affect callers who set explicit RetryConfig values. Default-config callers get the new behavior transparently.
RetryConfig.max_retries on REST now counts retries, not total attemptsPreviously the REST transport treated max_retries as the total attempt count, while gRPC counted retries only — so the same RetryConfig(max_retries=N) behaved differently across transports. REST now matches gRPC: max_retries=N means N retries after the initial attempt (up to N+1 total requests). A caller passing max_retries=3 will now see 4 total requests on a persistent failure instead of 3.
RetryConfig.backoff_factor default: 2.0 → 0.25backoff_factor is no longer an exponential multiplier — it's the minimum delay floor in the decorrelated-jitter formula. The default dropped from 2.0 to 0.25, giving a first-retry mean of ~0.5s — substantially shorter than v8, whose 2.0 default produced roughly 4× longer waits. Callers who set backoff_factor explicitly should re-read its docstring and the migration note in the retries guide; a v8 backoff_factor=2.0 maps to roughly 0.5 under the new semantics for a comparable first-retry delay.
GrpcIndex parityGrpcIndex was missing surface area that Index and AsyncIndex already had in v9.0.x. Switching to grpc=True for throughput should not silently lose functionality.
query_namespaces and query_namespaces_asyncMulti-namespace fan-out queries, with the same validation and aggregation semantics as the REST path.
grpc_index = pc.index("my-index", grpc=True) results = grpc_index.query_namespaces( vector=[0.1, 0.2, ...], namespaces=["a", "b", "c"], top_k=10, metric="cosine", )
fetch_by_metadataSame signature as Index.fetch_by_metadata.
start_import, describe_import, cancel_import, list_imports, and list_imports_paginated are now available on GrpcIndex.
GrpcIndex.search dense-vector fixGrpcIndex.search() sent bare list[float] queries in the wrong wire shape, so dense-vector queries failed. It now matches Index.search / AsyncIndex.search, and dense-vector queries via GrpcIndex.search() work.
search(query={...}) request body on all surfaces (#668)This release shape was contributed by the community — thanks to @pragnyanramtha for the PR.
Index.search, AsyncIndex.search, and GrpcIndex.search accept a single query= argument carrying the request body (a SearchQuery or a plain Mapping) as an alternative to the flat keyword form — restoring a v8 shape that v9.0.x rejected. The contracts are tight:
query= and direct kwargs (e.g. vector=, top_k=) raises TypeError, listing the conflicting names.query= (e.g. an int) raises a clear TypeError instead of a confusing downstream error.Fixes #661.
docs/guides/retries.md — defaults (REST vs gRPC), RetryConfig fields, the jitter formula with examples, adaptive concurrency, transport differences, and honest limitations under multi-process / serverless deployment. See the rendered docs page at Retries and Resiliencedocs/guides/error-handling.md now cross-references the new guide instead of duplicating it (the ## Retries heading is preserved so existing anchors resolve). See the rendered docs page at Error handlingstart_import docstring error_mode default corrected from "abort" to "continue".create_index_from_backup docstrings now point to backups.create / backups.list as the sources for a backup_id.GrpcIndex.upsert_records namespace docstring no longer suggests "", which validation rejects.Please file issues at https://github.com/pinecone-io/python-sdk/issues — include the SDK version (pinecone.__version__), Python version, and a minimal reproduction. For throttle / retry behavior, attach DEBUG logs from pinecone._internal.http_client and pinecone._internal.adaptive if possible.
Full Changelog: v9.0.1...v9.1.0
v9.0.1 is a polish release. It rolls up two weeks of fixes against backend response shapes, new client-side validation, completes the gRPC namespace API, widens public input types for ergonomic flexibility, and lands a deep pass on docstrings and migration guidance.
create_namespace, describe_namespace, delete_namespace, list_namespaces, list_namespaces_paginated), sparse/hybrid vector queries on Index.search / AsyncIndex.search, pc.preview.indexes.describe_backup, pc.indexes.configure(serverless_read_capacity=...), pc.assistants.create(..., environment=...), and several response fields the backend was returning but the SDK was dropping. See Filling v9.0.0 gaps.read_capacity are correctly forwarded everywhere. Several v9.0.0 paths (BYOC, IntegratedSpec, ServerlessSpec, async creation, the create_index shim, configure) silently dropped these fields; all are now end-to-end correct.list[T] now accept any Sequence[T]; dict[str, str] and dict[str, Any] parameters now accept Mapping. Existing call sites are unaffected, but tuple, generator-backed sequences, and Mapping subclasses now type-check and work without conversion.pinecone/__init__.pyi stub fixes type resolution in Spyder, Eric, Cython, and other editors that don't follow from … import * re-exports. mypy and Pyright/Pylance users are unaffected.A handful of methods and fields that should have shipped in v9.0.0 were inadvertently left out. They are restored in v9.0.1.
These methods exist on the REST Index but were missing from GrpcIndex in v9.0.0:
grpc_index = pc.index("my-index", grpc=True) grpc_index.create_namespace("orders") ns = grpc_index.describe_namespace("orders") for ns in grpc_index.list_namespaces(): # auto-paginating generator print(ns.name) page = grpc_index.list_namespaces_paginated(limit=50) grpc_index.delete_namespace("orders")
Index.search / AsyncIndex.search: sparse and hybrid queriesThe REST search surface accepts sparse and hybrid vector queries, but v9.0.0 only plumbed dense list[float] through Index.search / AsyncIndex.search. Sparse and hybrid inputs are now accepted as a dict alongside dense lists:
index.search( namespace="docs", query={"vector": {"values": [0.1, 0.2, ...], "indices": [3, 17, 42, ...]}}, top_k=10, )
Keys are validated and normalized client-side; invalid combinations (e.g. values without indices on sparse) raise ValidationError before the HTTP call.
describe_backuppc.preview.indexes.describe_backup(...) and its async counterpart were omitted from v9.0.0 and are now present.
The backend accepts these parameters on preview index create / configure, but the SDK wasn't forwarding them:
PreviewIndexes.create(..., source_collection=..., source_backup_id=..., cmek_id=...)PreviewIndexes.configure(..., deployment=...) (pod index patching)PreviewIndexModel now exposes private_host, source_collection, source_backup_id, and cmek_id on the response sideenvironment parameterpc.assistants.create(..., environment=...) — the backend accepted it; the SDK was not forwarding it.
pc.indexes.configure(serverless_read_capacity=...) — the parameter existed on the REST surface but was not plumbed through the SDK.IndexModel.private_host — surfaces private-endpoint hosts the backend was already returning.ByocSpecInfo.schema — was being dropped during response decoding.The public surface now accepts the broadest reasonable type at every input parameter. This is purely an extension — existing list / dict call sites continue to work — but it removes a class of "I have to convert to a list first" friction:
list[T] → Sequence[T] on input parameters (DX-0140), including embed, rerank, and assistant messages/roles (pc.assistants.chat, etc.)dict[str, str] → Mapping[str, str] for headers and tagsdict[str, Any] → Mapping[str, Any] for read-only params on Index operations (DX-0141)This also unblocks downstream type-checked callers that already had widened parameter types and were forced into cast() or list(...) conversions.
pinecone/__init__.pyi stub for Jedi-based IDEs (DX-0145)Editors that use the Jedi static analyzer (Spyder, Eric, Cython, some older VS Code setups) don't traverse from … import * re-exports, so from pinecone import Pinecone showed no autocomplete in those environments. A new pinecone/__init__.pyi stub enumerates the public surface explicitly. mypy, Pyright, and modern Pylance users are unaffected (they already resolved through the runtime module); Jedi users now see full autocomplete and go-to-definition.
A CI typecheck-drift gate (DX-0146) ensures the stub stays in sync with the runtime pinecone/__init__.py.
PreviewTextQuery: field renamed to fieldsPreviewTextQuery.field is renamed to fields so it can accept multiple field names for multi-field text search. The v9.0.0 field= kwarg continues to work as a deprecated alias and will be removed in a future release. pc.preview is not covered by SemVer; see the v9.0.0 release notes.
These are not breaking under SemVer (they reject inputs the backend was already rejecting), but a few new client-side checks may surface as ValidationError where v9.0.0 surfaced as a server-side error. If your code wraps these calls in try/except, no changes are needed — ValidationError is a subclass of PineconeException — but the error class and message will differ.
top_k > 10000 on GrpcIndex.query is now rejected client-side. REST had this check already.top_n < 1 on pc.inference.rerank(...) is now rejected client-side.limit < 1 on Index.fetch_by_metadata is now rejected client-side (AGT-0044).upsert_records rejects records with an invalid _id field (non-string, empty, or containing null bytes) before the HTTP call.pc.collections.create(name=...) validates the resource name client-side (length, character set).Projects.create/update validates the project name (length ≤ 50, no null bytes) and refuses negative max_pods.ApiKeys.create enforces the 80-character name length cap.PreviewDocuments.fetch(ids=...) rejects empty ids lists.Two PreviewDocuments parameters that were never functional were removed:
PreviewDocuments.fetch(..., filter=...) — the filter parameter was dropped; it had no effect on the backend.PreviewDocuments.delete(..., filter=...) — same.If you were passing filter= to either of these on v9.0.0, the call will now raise TypeError. The argument was never being sent, so removing it does not change observable behavior.
fix(grpc): Cancelled + "Timeout expired" from the gRPC backend is now raised as PineconeTimeoutError instead of bubbling as the lower-level grpc.RpcError (CI-0052). Code that caught PineconeTimeoutError already handles this; code that caught only grpc.RpcError will no longer see those specific timeouts.
A number of v9.0.0 response structs had fields typed as non-optional that the backend in fact returns as null in some states, causing decode failures. These have been widened:
IndexModel.host — optional (null during creation / Terminating states)BackupModel.tags — dict[str, Any] (was dict[str, str])BackupModel.schema — real schema field (was an always-None stub)BackupModel.metric — removed (never returned by the backend)PodSpecInfo.replicas, .shards, .pods — optionalRestoreJobModel.created_at — optionalAPIKeyModel.name — str | None; the dead description field is removedStreamMessageEnd.usage — optional (handles null from streaming responses)PreviewBackupModel.tags — dict[str, Any] (was dict[str, str])PreviewIndexModel.host — optionalPreviewManagedDeployment.environment — optionalPreviewReadCapacityStatus.error_message — new field for failure statesModelInfoSupportedParameter.min / .max — int | float | None (v9.0.0 declared float, but the backend returns ints for some parameters)ByocSpecInfo.schema — newly surfacedIf you were destructuring these fields and bypassing None handling, add a guard. mypy will surface the new None possibilities under --strict.
schema and read_capacity through every index-creation path: integrated (pc.indexes.create_for_model), BYOC (build_byoc_body), ServerlessSpec, IntegratedSpec, the async creation path, and the create_index backcompat shim. On v9.0.0 these fields were dropped at the boundary depending on which path you called.pc.indexes.configure(...): stop pre-merging tags client-side; the backend handles tag merges, and the client-side step was overwriting partial updates. Same job, fewer bugs.pc.indexes.configure(...): relax validate_read_capacity to allow partial Dedicated patches (e.g. changing min_replicas without re-specifying max_replicas).configure boundary so that schema={"fields": {...}} and the shorter schema={"my_field": ...} are both accepted.IndexTerminatedError when an index enters Terminating or Disabled during a poll, instead of looping until the operator's timeout.EmbedConfig: include dimension in the create request (was silently dropped).pc.assistants.create(...): omit metadata from the request body when not provided. v9.0.0 sent metadata: null, which a stricter backend rejected.pc.assistants.list_page / list_files_page: upgrade to API version v202604, fix query-parameter names and pagination-token parsing, add page_size.metadata field as multipart form data (was being sent as a query param, which silently dropped the value).ChatCompletionMessage: role and content are now optional (matches the streaming assistant-role chunk shape where these arrive on a later chunk).ChatCompletionStreamChunk: expose the usage field, which had been dropped during struct decoding.EntailmentResult.reasoning: populate from the evaluate_alignment response (was always empty on v9.0.0).OperationModel.error: map from the JSON field error_message (was empty for failed operations).PINECONE_PLUGIN_ASSISTANT_CONTROL_HOST / PINECONE_PLUGIN_ASSISTANT_DATA_HOST env vars at client construction (legacy plugin compatibility).Terminated and Terminating as terminal states in _poll_until_ready, so creation polling exits promptly when an assistant transitions to a terminal failure state.Index.search / AsyncIndex.search: validate and normalize sparse/hybrid vector dict keys; wrap dense vector queries in {"values": ...} for backend serde compatibility.query_namespaces: preserve input namespace order in the result so ties break deterministically.upsert_records: drop the redundant id key when _id is present (the backend treats either, but sending both caused a 400).pc.backups.create(...): omit description from the request body when not provided.pc.indexes.create_from_backup(timeout=-1): return CreateIndexFromBackupResponse directly instead of attempting to poll with a negative timeout.limit=10 default on Backups.list / RestoreJobs.list so backend-default pagination is used.PreviewIndexes.create and configure: full tag validation (was incomplete on v9.0.0).PreviewIndexes.configure: validate schema fields are semantic_text only.PreviewIndexes.list_backups: forward limit to the server in fetch_page (was hardcoded).PreviewBooleanField and PreviewLegacyIntegerField are now in the schema union; v9.0.0 rejected schemas containing them.Projects.create / update: client-side name length and null-byte validation.Projects.update: reject negative max_pods before the HTTP call.ApiKeys.create: enforce the 80-character name length cap.ApiKeys.create: remove the dead description parameter (server doesn't accept it).rerank(...): validate top_n >= 1 before the HTTP call.list_models(...): reject type=rerank combined with a vector_type argument.ModelInfoSupportedParameter.min/max typing widened to int | float | None.import_data(...): omit errorMode from the wire payload when error_mode is not specified (was sending null, which the backend rejected).schema and read_capacity through async index-creation shims so that v8-style positional calls continue to behave correctly.AssistantModel.context shim to accept a messages= argument (matches the deprecated v8 signature).A broad pass over docstrings, RST formatting, and the v9 migration guide. Highlights:
pc.index() rather than the deprecated shim:meta private: so they no longer clutter generated docsPinecone.index, Pinecone.config, Pinecone.close, Pinecone.assistant, Pinecone.backups, Pinecone.collections, Pinecone.assistants: complete Args, Returns, Raises, and Examples sections where missingupsert_from_dataframe max_concurrency claim corrected in performance guidegrpc extra_AssistantNamespaceProxy; build remains warnings-as-errors cleanquery=, spec_embed=, field=), unsafe .get() calls, deprecated import paths, false immutability claimsThe Sphinx docs build remains green with -W (warnings-as-errors).
pytest-xdist (-n 6 --dist=loadfile); the release-readiness job's timeout was raised from 60 → 90 min as a margin.abi3audit pass runs on every wheel produced by the cross-platform matrix; catches stable-ABI violations before publish (the multi-Python smoke job is the runtime complement).abi3audit and auditwheel in their own venvs so they no longer leak into the verify Python's pip check.pinecone/ tree before running so the installed wheel is actually exercised.dev-version resolution now uses the artifacts API directly rather than walking workflow runs (avoids missing the most recent real publish when intermediate runs are no-op skips).If something worked on v9.0.0 and doesn't on v9.0.1, please open an issue at https://github.com/pinecone-io/python-sdk/issues with the same details requested in the v9.0.0 notes (versions, minimal repro, expected vs actual). Compatibility regressions are prioritized.
Full Changelog: v9.0.0...v9.0.1