Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.

Two other data-plane interfaces exist, and the way the index was created decides which one applies: an index created with the deprecated top-level vector arguments answers on index.upsert / index.query, and a legacy integrated index, created with pc.indexes.create_for_model(...), requires the legacy Records API: index.upsert_records / index.search. For new indexes that should embed text for you, give a document index a field with integrated embedding. See the quickstart and the rest of the documentation for the full picture.

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

API key

Pass the API key directly or set the PINECONE_API_KEY environment variable:

from pinecone import Pinecone

# Explicit API key
pc = Pinecone(api_key="your-api-key")

# From environment variable (PINECONE_API_KEY)
pc = Pinecone()

Custom host

Connect to a specific control plane host:

pc = Pinecone(api_key="your-api-key", host="https://api.pinecone.io")

Timeout

Configure request timeouts in seconds:

pc = Pinecone(api_key="your-api-key", timeout=30)

Debug logging

Enable debug logging by setting the PINECONE_DEBUG environment variable:

export PINECONE_DEBUG=1

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.

Some suites are opt-in because they hit a real backend and cost money. The live retry/throttle smoke tests in tests/integration/test_retry_smoke.py need PINECONE_API_KEY plus PINECONE_RETRY_SMOKE=1; run them before any release that touches retry logic, HTTP transport, the AIMD adaptive-concurrency limiter, or the batch-upsert path. Each module documents its own gate and cost.

License

Apache-2.0. See LICENSE for details.

Metadata

Release files for pinecone 10.1.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pinecone 10.1.0rc1
File Size Uploaded
pinecone-10.1.0rc1.tar.gz 533.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for pinecone 10.1.0rc1
File
pinecone-10.1.0rc1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
pinecone-10.1.0rc1-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details
pinecone-10.1.0rc1-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details
pinecone-10.1.0rc1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
pinecone-10.1.0rc1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
pinecone-10.1.0rc1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
pinecone-10.1.0rc1-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 23.4 MB

Release files / pinecone-10.1.0rc1.tar.gz

Download URL pinecone-10.1.0rc1.tar.gz
Size 533.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8997f33cc6aa25821273f77deba5417b37298528ec57cc2402d514847162b5a6
BLAKE2b-256 checksum
How to use checksums
f04c925d1829735d4ea59a74e2eb4493a9f6c26ff8742cf08648f5b2e5ae3919
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / pinecone-10.1.0rc1-cp310-abi3-win_amd64.whl

Download URL pinecone-10.1.0rc1-cp310-abi3-win_amd64.whl
Size 2.9 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2d3f3d5dfc6cfdf4ac8fda60045ba18f358880d3f8c9ce3073cf27143d02700e
BLAKE2b-256 checksum
How to use checksums
13fa347f531a9ea160c92220edac9f961f47aceceaf46e374f43e44daa6d6bbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / pinecone-10.1.0rc1-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL pinecone-10.1.0rc1-cp310-abi3-musllinux_1_2_x86_64.whl
Size 3.6 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
35b515e012a2cbd43a607d832c01945cad91724e976eb56e36195622e5c19fc1
BLAKE2b-256 checksum
How to use checksums
337f4a7edb3c8719b331eea95829d30fe8c68de102e7c125311cf6f1872afac8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / pinecone-10.1.0rc1-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL pinecone-10.1.0rc1-cp310-abi3-musllinux_1_2_aarch64.whl
Size 3.5 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
c223fd8ac9eb05061e9b5645255c07f3cbd11c01e2c07d0d210c898071ddfe0d
BLAKE2b-256 checksum
How to use checksums
daf3988f44599d168ae4fe4a29c78a1fdd9274e9491247aaf7ab7540cb548b45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / pinecone-10.1.0rc1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pinecone-10.1.0rc1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.3 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
8496681531216c2bbb4d859557c65ca0fd7e2153c64f16cc101f6433594bb4d8
BLAKE2b-256 checksum
How to use checksums
55b08fa3283211488c4a3e978d90c38b72f19cdad3fbab8a2538a00b1b81fc58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / pinecone-10.1.0rc1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL pinecone-10.1.0rc1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 3.4 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
7af6e6fb28540987319ac57bd5babbf55afe65180170f0809cec9f3b8168454f
BLAKE2b-256 checksum
How to use checksums
543a86a939d3cb13592d2c3852dd3a7c026cee52c7447029ac58c889a20d74c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / pinecone-10.1.0rc1-cp310-abi3-macosx_11_0_arm64.whl

Download URL pinecone-10.1.0rc1-cp310-abi3-macosx_11_0_arm64.whl
Size 3.0 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
afa2cb7c3e1778de21354c5e749ff38b16ce88b03855662203553a6bbe09a42d
BLAKE2b-256 checksum
How to use checksums
57ac410a0228b35a1de75f3f94860164118348d41025b4b61b13487c138727df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / pinecone-10.1.0rc1-cp310-abi3-macosx_10_12_x86_64.whl

Download URL pinecone-10.1.0rc1-cp310-abi3-macosx_10_12_x86_64.whl
Size 3.1 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
62ff0ddaa780faf1aca2bcea466d4e0e44db29d5d9d01c7891c9fbd91d7d3b29
BLAKE2b-256 checksum
How to use checksums
1959ae6f61b538ef6bf4a4dd55a12524df8a03cd9a52af1bf5afa9fef24a280b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

10.1.0rc1 This release

8 release files

9.1.0

8 release files

9.0.1

8 release files

9.0.0

8 release files

8.1.2

2 release files

8.1.1

2 release files

8.1.0

2 release files

8.0.1

2 release files

8.0.0

2 release files

7.3.0

2 release files

7.2.0

2 release files

7.1.0

2 release files

7.0.2

2 release files

7.0.1

2 release files

7.0.0

2 release files

6.0.2

2 release files

6.0.1

2 release files

6.0.0

2 release files

5.4.2

2 release files

5.4.1

2 release files

5.4.0

2 release files

5.3.1

2 release files

5.3.0

2 release files

5.2.0

2 release files

5.1.0

2 release files

5.0.1

2 release files

5.0.0

2 release files

4.1.2

2 release files

4.1.1

2 release files

4.1.0

2 release files

4.0.0

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

0.1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page