pinecone 10.3.0


pip install pinecone

  Latest version

Released: Nov 03, 2026


Meta
Author: Pinecone Systems, Inc.
Requires Python: >=3.10

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers
  • Information Technology
  • Science/Research
  • System Administrators

Operating System
  • OS Independent

Programming Language
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14
  • Python :: 3.15

Topic
  • Database
  • Software Development
  • Software Development :: Libraries
  • Software Development :: Libraries :: Application Frameworks
  • Software Development :: Libraries :: Python Modules

Pinecone Python SDK

The Pinecone Python SDK provides a client for the Pinecone vector database. Use it to create and manage indexes, upsert and query records, and run inference operations from Python.

Requires Python 3.10+.

Upgrading from 9.x? create and configure moved from spec=/dimension= to schema=/deployment=; see the v10 migration guide for the field-by-field mapping.

Installation

pip install pinecone

Quick start

An index declares its fields as a schema. Declaring a schema makes it a document index: you read and write it through index.documents, and each record is a JSON document whose fields you named yourself.

from pinecone import DenseVectorQuery, Pinecone

pc = Pinecone(api_key="your-api-key")  # or omit and set PINECONE_API_KEY

# Create an index. This blocks until the index is ready.
pc.indexes.create(
    name="movie-recommendations",
    schema={"fields": {"your_vector": {"type": "dense_vector", "dimension": 3, "metric": "cosine"}}},
    deployment={"deployment_type": "managed", "cloud": "aws", "region": "us-east-1"},
)

# Get a data-plane handle for that index
index = pc.index("movie-recommendations")

# Upsert documents. Each one needs an `_id`; every other key is either a field
# you declared in the schema or arbitrary metadata.
index.documents.upsert(
    namespace="movies-en",
    documents=[
        {"_id": "movie-001", "your_vector": [0.1, 0.2, 0.3], "title": "Arrival"},
        {"_id": "movie-002", "your_vector": [0.4, 0.5, 0.6], "title": "Interstellar"},
    ],
)

# Search. `score_by` names the field to compare against.
results = index.documents.search(
    namespace="movies-en",
    top_k=5,
    score_by=[DenseVectorQuery(field="your_vector", values=[0.1, 0.2, 0.3])],
    include_fields=["title"],
)
for doc in results.matches:
    print(doc.id, doc.score)

Upserts apply asynchronously, so a document may not be visible to the next search immediately.

Indexes created another way use other methods: an index created with the deprecated top-level dimension=/metric= uses index.upsert / index.query, and a legacy integrated index (pc.indexes.create_for_model(...)) uses index.upsert_records / index.search. For new indexes that embed text for you, give a document index a field with integrated embedding. See the quickstart and the documentation.

Async usage

The SDK provides an async client for use with asyncio. Its index() is a coroutine, and the handle it returns is a context manager:

import asyncio

from pinecone import AsyncPinecone, DenseVectorQuery


async def main():
    async with AsyncPinecone(api_key="your-api-key") as pc:
        index = await pc.index("movie-recommendations")
        async with index:
            results = await index.documents.search(
                namespace="movies-en",
                top_k=5,
                score_by=[DenseVectorQuery(field="your_vector", values=[0.1, 0.2, 0.3])],
                include_fields=["title"],
            )
            for doc in results.matches:
                print(doc.id, doc.score)


asyncio.run(main())

Configuration

from pinecone import Pinecone

pc = Pinecone(
    api_key="your-api-key",  # or omit and set PINECONE_API_KEY
    timeout=60,  # request timeout in seconds; index handles inherit it
)

Setting PINECONE_DEBUG=1 before importing pinecone sets the pinecone logger to DEBUG. The SDK installs no log handler, so configure one to see the output:

import logging

logging.basicConfig()

Development

Clone the repository and install the dev dependency group with uv, which is what CI does:

uv sync --group dev
uv run pytest tests/unit/ -x -v      # tests
uv run mypy --strict pinecone/       # type checking
uv run ruff check --fix              # linting
uv run ruff format                   # formatting

The unit suite must leave the working tree clean: git status is expected to report no changes after a bare uv run pytest tests/unit. Use tmp_path / tmp_path_factory if a test genuinely needs a file on disk.

Integration suites that hit a real backend are opt-in because they cost money; each module documents its own gate. Before any release that touches retry logic, HTTP transport, the AIMD adaptive-concurrency limiter, or the batch-upsert path, run tests/integration/test_retry_smoke.py with PINECONE_API_KEY and PINECONE_RETRY_SMOKE=1 set.

License

Apache-2.0. See LICENSE for details.

10.3.0 Nov 03, 2026
10.2.0 Oct 23, 2026
10.1.0 Oct 20, 2026
10.1.0rc1 Oct 07, 2026
10.0.0 Sep 03, 2026
10.0.0rc1 Aug 26, 2026
9.1.0 Jun 03, 2026
9.0.1 May 19, 2026
9.0.1rc1 May 18, 2026
9.0.0 May 04, 2026
9.0.0rc2 May 04, 2026
9.0.0rc1 May 04, 2026
8.2.0rc2 May 04, 2026
8.2.0rc1 May 04, 2026
8.1.2 Apr 08, 2026
8.1.1 Apr 02, 2026
8.1.0 Feb 19, 2026
8.1.0rc1 Feb 17, 2026
8.0.1 Feb 11, 2026
8.0.0 Nov 18, 2025
7.3.1a1 Oct 03, 2025
7.3.1.dev8 Oct 01, 2025
7.3.1.dev7 Oct 01, 2025
7.3.1.dev6 Oct 01, 2025
7.3.1.dev5 Oct 01, 2025
7.3.1.dev4 Sep 30, 2025
7.3.1.dev3 Sep 25, 2025
7.3.1.dev2 Sep 24, 2025
7.3.1.dev1 Sep 24, 2025
7.3.0 Jun 27, 2025
7.2.0 Jun 18, 2025
7.1.0 Jun 16, 2025
7.1.0rc1 Jun 16, 2025
7.0.2 May 28, 2025
7.0.2.dev1 May 27, 2025
7.0.1 May 21, 2025
7.0.1.dev1 May 21, 2025
7.0.0 May 20, 2025
7.0.0.dev3 May 16, 2025
7.0.0.dev2 May 15, 2025
7.0.0.dev1 May 15, 2025
6.0.3.dev1 May 21, 2025
6.0.2 Mar 13, 2025
6.0.2.dev1 Mar 13, 2025
6.0.1 Feb 10, 2025
6.0.1.dev1 Feb 10, 2025
6.0.0 Feb 07, 2025
6.0.0rc2 Oct 22, 2024
6.0.0rc1 Oct 21, 2024
6.0.0.dev9 Feb 03, 2025
6.0.0.dev8 Jan 31, 2025
6.0.0.dev7 Jan 30, 2025
6.0.0.dev6 Dec 17, 2024
6.0.0.dev5 Dec 17, 2024
6.0.0.dev4 Dec 13, 2024
6.0.0.dev3 Oct 25, 2024
6.0.0.dev2 Oct 25, 2024
6.0.0.dev1 Oct 18, 2024
5.4.2 Dec 09, 2024
5.4.1 Nov 26, 2024
5.4.0 Nov 13, 2024
5.4.0.dev5 Nov 13, 2024
5.4.0.dev4 Oct 25, 2024
5.4.0.dev3 Oct 25, 2024
5.4.0.dev2 Oct 25, 2024
5.4.0.dev1 Oct 22, 2024
5.3.1 Sep 19, 2024
5.3.0 Sep 18, 2024
5.2.0 Sep 17, 2024
5.2.0.dev10 Sep 17, 2024
5.2.0.dev9 Sep 17, 2024
5.2.0.dev8 Sep 17, 2024
5.2.0.dev7 Sep 09, 2024
5.2.0.dev6 Sep 06, 2024
5.2.0.dev5 Sep 05, 2024
5.2.0.dev4 Sep 05, 2024
5.2.0.dev3 Sep 05, 2024
5.2.0.dev2 Aug 30, 2024
5.2.0.dev1 Aug 30, 2024
5.2.0.dev0 Aug 30, 2024
5.1.0 Aug 29, 2024
5.1.0rc1 Aug 28, 2024
5.1.0.dev1 Aug 29, 2024
5.0.1 Aug 12, 2024
5.0.0 Jul 31, 2024
4.1.2 Jul 31, 2024
4.1.1 Jul 31, 2024
4.1.0 Jul 31, 2024
4.0.0 May 03, 2024
3.2.2 Jul 31, 2024
3.2.1 Jul 31, 2024
3.2.0 Jul 31, 2024
3.1.0 Jul 31, 2024
3.0.3 Jul 31, 2024
3.0.2 Jul 31, 2024
3.0.1 Jul 31, 2024
3.0.0 Jul 31, 2024
2.2.4 Jul 31, 2024
2.2.3 Jul 31, 2024
2.2.2 Jul 31, 2024
Extras:
Dependencies:
httpx[http2] (<1.0,>=0.27)
msgspec (<0.23,>=0.19)
orjson (<4,>=3.11)
anyio (>=4.0)