Skip to main content

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.

Metadata

Release files for pinecone 10.3.0

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.3.0
File Size Uploaded Provenance Actions
pinecone-10.3.0.tar.gz 556.8 kB With provenance Details for pinecone-10.3.0.tar.gz

Built distributions (wheels)

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

Total release size: 23.6 MB

Release files / pinecone-10.3.0.tar.gz

Download URL pinecone-10.3.0.tar.gz
Size 556.8 kB
Tags Source
SHA-256 checksum
How to use checksums
46887083d9c42f2208c8e0c61ee1a4f212788d5d452b9f67aa60e2e0b32be60d
BLAKE2b-256 checksum
How to use checksums
f3e7f4e71ee0bd4ce48cec272eb0faa877e7e3c4fa4564e78133a7cc4027c9c3
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 Nov 3, 2026.

Transparency log

Release files / pinecone-10.3.0-cp310-abi3-win_amd64.whl

Download URL pinecone-10.3.0-cp310-abi3-win_amd64.whl
Size 3.0 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
725b7f5fe52e8d90fe62f93321bbaa0f6c5b2bb68130d9638e5a5ba21baf4902
BLAKE2b-256 checksum
How to use checksums
d6125be66cf49125140e5f7d8db8fcef2277b9101eae5ebaff8ff3ee5cc1e57e
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 Nov 3, 2026.

Transparency log

Release files / pinecone-10.3.0-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL pinecone-10.3.0-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
618a3d0d7f7e66efc81e6a9ef0a144e6b9a4a4e7ddc026bceab360c61e332a48
BLAKE2b-256 checksum
How to use checksums
249807e4d1d36c484fe2a1fee8e132eab9b4ebe2c52447bd74cf60e185bc7beb
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 Nov 3, 2026.

Transparency log

Release files / pinecone-10.3.0-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL pinecone-10.3.0-cp310-abi3-musllinux_1_2_aarch64.whl
Size 3.6 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
dc38ee7941a7b7ef58bc95e2dd4cd21baf25c53ed4c7c4074205e4ccebadf7e2
BLAKE2b-256 checksum
How to use checksums
036a8fadf6d15b309eac92b2bed9656f3decf58e227ef5d5e31a6686eac23105
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 Nov 3, 2026.

Transparency log

Release files / pinecone-10.3.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL pinecone-10.3.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_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
50838bdb516eb6c096746ff69cd503b1b0685b5ed436b7c507654a6265b19d99
BLAKE2b-256 checksum
How to use checksums
979a817f9de28528bf4d1a0042b0cf7f0e6d504dccdee9c0dd7842ae2d6da164
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 Nov 3, 2026.

Transparency log

Release files / pinecone-10.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL pinecone-10.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 3.4 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
a5dbcda8e8a30cf045a9500921adccad26ba93250552fd3663f108fa735890d0
BLAKE2b-256 checksum
How to use checksums
ab5ebad4914e82d9eefeaca3752b4ed87b951cd57a46fce2976fe33623038a77
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 Nov 3, 2026.

Transparency log

Release files / pinecone-10.3.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL pinecone-10.3.0-cp310-abi3-macosx_11_0_arm64.whl
Size 3.1 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
938f600778372e74e815efc91fc54a1e886150aea9edde11287f4e3061f30629
BLAKE2b-256 checksum
How to use checksums
ae496b8f406bb885c79de57c528f2330c48b84d2907bc601bf54b4209b88a74a
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 Nov 3, 2026.

Transparency log

Release files / pinecone-10.3.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL pinecone-10.3.0-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
2739dd946442266a42f2deb48219d2eb5d73335a0bb1cb379e86316d5982ee83
BLAKE2b-256 checksum
How to use checksums
1b00baed4b82ee90016eb61026fed782de8ef6df953c6c16ed374c6eeef7d84a
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 Nov 3, 2026.

Transparency log

Security for pinecone 10.3.0

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.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for pinecone-10.3.0.tar.gz

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 Nov 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

10.3.0 This release

8 release files Full provenance

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