Skip to main content
Pre-release

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

Records API plugin for Pinecone python SDK

Installation

The plugin is distributed separately from the core python SDK.

# Install the base python SDK, version 5.4.0 or higher
pip install pinecone

# And also the plugin functionality
pip install pinecone-plugin-records

Usage

This plugin extends the functionality of the pinecone SDK to allow creating indexes for specific embedding models, and upserting and searching records in these indexes. These operations are added to the existing Pinecone and Index classes.

Models currently supported:

The following example highlights how to use the Pinecone class to create a new index for an embedding model, and then uses Index to upsert and query some records.

from pinecone import Pinecone

pc = Pinecone(api_key="<<PINECONE_API_KEY>>")

# Create an index for your embedding model
index_model = pc.create_index_for_model(
    model="multilingual-e5-large",
    field_map={"text": "my_text_field"},
    name="my-model-index",
    cloud="aws",
    region="us-east-1",
)

# establish an index connection
index = pc.Index(host=index_model.host)

# upsert records
index.upsert_records(
    "my-namespace",
    [
        {
            "_id": "test1",
            "my_text_field": "Apple is a popular fruit known for its sweetness and crisp texture.",
        },
        {
            "_id": "test2",
            "my_text_field": "The tech company Apple is known for its innovative products like the iPhone.",
        },
        {
            "_id": "test3",
            "my_text_field": "Many people enjoy eating apples as a healthy snack.",
        },
        {
            "_id": "test4",
            "my_text_field": "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces.",
        },
        {
            "_id": "test5",
            "my_text_field": "An apple a day keeps the doctor away, as the saying goes.",
        },
        {
            "_id": "test6",
            "my_text_field": "Apple Computer Company was founded on April 1, 1976, by Steve Jobs, Steve Wozniak, and Ronald Wayne as a partnership.",
        },
    ],
)

# search for similar records
response = index.search_records(
    namespace="test-namespace", inputs={"text": "Apple corporation"}, top_k=3
)

Metadata

Release files for pinecone-plugin-records 0.1.0.dev20241029074314

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-plugin-records 0.1.0.dev20241029074314
File Size Uploaded
pinecone_plugin_records-0.1.0.dev20241029074314.tar.gz 108.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pinecone-plugin-records 0.1.0.dev20241029074314
File Interpreter ABI Platform
pinecone_plugin_records-0.1.0.dev20241029074314-py3-none-any.whl Python 3 none any Details

Total release size: 376.5 kB

Release files / pinecone_plugin_records-0.1.0.dev20241029074314.tar.gz

Download URL pinecone_plugin_records-0.1.0.dev20241029074314.tar.gz
Size 108.4 kB
Tags Source
SHA-256 checksum
How to use checksums
76d8e125faa1da6da111d227a3034dc1d5a2f19232e397a228a7e350224c1971
BLAKE2b-256 checksum
How to use checksums
9dcab253443f9f60cde95182ac6286662ba2105d8634fbbffec9091cedc4aba4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

Release files / pinecone_plugin_records-0.1.0.dev20241029074314-py3-none-any.whl

Download URL pinecone_plugin_records-0.1.0.dev20241029074314-py3-none-any.whl
Size 268.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
455309442e179d406aa94b2947c60a8101018e8d78631eda617d8cfa42621df0
BLAKE2b-256 checksum
How to use checksums
13cd3503970704ce815ef2165489cbf9c9d6d69d645bebbd86ab8fc67a1657d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure
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