Cone-documents / train (4).jsonl
seansullivan's picture
Upload train (4).jsonl
3b8610a
{"id": "03cd7e06b3cc-0", "text": "This document contains details about Pinecone releases. For information about using specific features, see our API reference.\nJune 21, 2023\nThe new gcp-starter region is now in public preview. This region has distinct limitations from other Starter Plan regions. gcp-starter is the default region for some new users. \nApril 26, 2023\nIndexes in the starter plan now support approximately 100,000 1536-dimensional embeddings with metadata. Capacity is proportional for other dimensionalities.\nApril 3, 2023\nPinecone now supports new US and EU cloud regions.\nMarch 21, 2023\nPinecone now supports enterprise SSO. Contact us at support@pinecone.io to set up your integration.\nMarch 1, 2023\nPinecone now supports 40kb of metadata per vector.\nFebruary 22, 2023\nSparse-dense embeddings are now in Public Preview.\nPinecone now supports vectors with sparse and dense values. To use sparse-dense embeddings in Python, upgrade to Python client version 2.2.0. \nPinecone Python client version 2.2.0 is available\nPython client version 2.2.0 with support for sparse-dense embeddings is now available on GitHub and PYPI.\nFebruary 15, 2023\nNew Node.js client is now available in public preview", "source": "https://docs.pinecone.io/docs/release-notes"}
{"id": "03cd7e06b3cc-1", "text": "You can now try out our new Node.js client for Pinecone.\nFebruary 14, 2023\nNew usage reports in the Pinecone console\nYou can now monitor your current and projected Pinecone usage with the Usage dashboard.\nJanuary 31, 2023\nPinecone is now available in AWS Marketplace\nYou can now sign up for Pinecone billing through Amazon Web Services Marketplace.\nJanuary 3, 2023\nPinecone Python client version 2.1.0 is now available on GitHub.\nThe latest release of the Python client makes the following changes:", "source": "https://docs.pinecone.io/docs/release-notes"}
{"id": "03cd7e06b3cc-2", "text": "Fixes \"Connection Reset by peer\" error after long idle periods\nAdds typing and explicit names for arguments in all client operations\nAdds docstrings to all client operations\nAdds Support for batch upserts by passing batch_size to the upsert method\nImproves gRPC query results parsing performance\n\nDecember 22, 2022\nPinecone is now available in GCP Marketplace\nYou can now sign up for Pinecone billing through Google Cloud Platform Marketplace.\nDecember 6, 2022\nOrganizations are generally available\nPinecone now features organizations, which allow one or more users to control billing and project settings across multiple projects owned by the same organization.\np2 pod type is generally available\nThe p2 pod type is now generally available and ready for production workloads. p2 pods are now available in the Starter plan and support the dotproduct distance metric.\nPerformance improvements\n\n\nBulk vector_deletes are now up to 10x faster in many circumstances.\n\n\nCreating collections is now faster.", "source": "https://docs.pinecone.io/docs/release-notes"}
{"id": "03cd7e06b3cc-3", "text": "October 31, 2022\nHybrid search (Early access)\nPinecone now supports keyword-aware semantic search with the new hybrid search indexes and endpoints. Hybrid search enables improved relevance for semantic search results by combining them with keyword search.\nThis is an early access feature and is available only by signing up.\nOctober 17, 2022\nStatus page\nThe new Pinecone Status Page displays information about the status of the Pinecone service, including the status of individual cloud regions and a log of recent incidents.\nSeptember 16, 2022\nPublic collections\nYou can now create indexes from public collections, which are collections containing public data from real-world data sources. Currently, public collections include the Glue - SSTB collection, the TREC Question classification collection, and the SQuAD collection.\nAugust 16, 2022\nCollections (Public Preview)(\"Beta\")\nYou can now make static copies of your index using collections. After you create a collection from an index, you can create a new index from that collection. The new index can use any pod type and any number of pods. Collections only consume storage.\nThis is a public preview feature and is not appropriate for production workloads.\nVertical scaling", "source": "https://docs.pinecone.io/docs/release-notes"}
{"id": "03cd7e06b3cc-4", "text": "Vertical scaling\nYou can now change the size of the pods for a live index to accommodate more vectors or queries without interrupting reads or writes. The p1 and s1 pod types are now available in 4 different sizes: 1x, 2x, 4x, and 8x. Capacity and compute per pod double with each size increment.\np2 pod type (Public Preview)(\"Beta\")\nThe new p2 pod type provides search speeds of around 5ms and throughput of 200 queries per second per replica, or approximately 10x faster speeds and higher throughput than the p1 pod type, depending on your data and network conditions. \nThis is a public preview feature and is not appropriate for production workloads.\nImproved p1 and s1 performance\nThe s1 and p1 pod types now offer approximately 50% higher query throughput and 50% lower latency, depending on your workload.\nJuly 26, 2022\nYou can now specify a metadata filter to get results for a subset of the vectors in your index by calling describe_index_stats with a filter object.\nThe describe_index_stats operation now uses the POST HTTP request type. The filter parameter is only accepted by describe_index_stats calls using the POST request type. Calls to describe_index_stats using the GET request type are now deprecated. \nJuly 12, 2022\nPinecone Console Guided Tour", "source": "https://docs.pinecone.io/docs/release-notes"}
{"id": "03cd7e06b3cc-5", "text": "Pinecone Console Guided Tour\nYou can now choose to follow a guided tour in the Pinecone Console. This interactive tutorial walks you through creating your first index, upserting vectors, and querying your data. The purpose of the tour is to show you all the steps you need to start your first project in Pinecone.\nJune 24, 2022\nUpdated response codes\nThe create_index, delete_index, and scale_index operations now use more specific HTTP response codes that describe the type of operation that succeeded.\nJune 7, 2022\nSelective metadata indexing\nYou can now store more metadata and more unique metadata values! Select which metadata fields you want to index for filtering and which fields you only wish to store and retrieve. When you index metadata fields, you can filter vector search queries using those fields. When you store metadata fields without indexing them, you keep memory utilization low, especially when you have many unique metadata values, and therefore can fit more vectors per pod.\nSingle-vector queries\nYou can now specify a single query vector using the vector input. We now encourage all users to query using a single vector rather than a batch of vectors, because batching queries can lead to long response messages and query times, and single queries execute just as fast on the server side.\nQuery by ID", "source": "https://docs.pinecone.io/docs/release-notes"}
{"id": "03cd7e06b3cc-6", "text": "Query by ID\nYou can now query your Pinecone index using only the ID for another vector. This is useful when you want to search for the nearest neighbors of a vector that is already stored in Pinecone. \nImproved index fullness accuracy\nThe index fullness metric in describe_index_stats() results is now more accurate.\nApril 25, 2022\nPartial updates (Public Preview)\nYou can now perform a partial update by ID and individual value pairs. This allows you to update individual metadata fields without having to upsert a matching vector or update all metadata fields at once. \nNew metrics\nUsers on all plans can now see metrics for the past one (1) week in the Pinecone console. Users on the Enterprise and Enterprise Dedicated plan now have access to the following metrics via the Prometheus metrics endpoint:", "source": "https://docs.pinecone.io/docs/release-notes"}
{"id": "03cd7e06b3cc-7", "text": "pinecone_vector_count\npinecone_request_count_total\npinecone_request_error_count_total\npinecone_request_latency_seconds\npinecone_index_fullness (Public Preview)\n\nNote: The accuracy of the pinecone_index_fullness metric is improved. This may result in changes from historic reported values. This metric is in public preview.\nSpark Connector\nSpark users who want to manage parallel upserts into Pinecone can now use the official Spark connector for Pinecone to upsert their data from a Spark dataframe.\nSupport for Boolean and float metadata in Pinecone indexes\nYou can now add Boolean and float64 values to metadata JSON objects associated with a Pinecone index. \nNew state field in describe_index results\nThe describe_index operation results now contain a value for state, which describes the state of the index. The possible values for state are Initializing, ScalingUp, ScalingDown, Terminating, and Ready.\nDelete by metadata filter\nThe Delete operation now supports filtering my metadata.Updated 10 days ago LimitsArchitectureDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/release-notes"}
{"id": "155b13a20033-0", "text": "Overview\nThis document describes the security protocols and practices in use by Pinecone.\nAPI keys\nEach Pinecone project has one or more API keys. In order to make calls to the Pinecone API, a user must provide a valid API key for the relevant Pinecone project.\nRole-based access controls (RBAC)\nEach Pinecone organization can assign users roles with respect to the organization and projects within the organization. These roles determine what permissions users have to make changes to the organization's billing, projects, and other users. To learn more, see organization roles.\nOrganization single sign-on (SSO)\nSSO allows organizations to manage their teams' access to Pinecone through their identity management solution. Once your integration is configured, you can require that users from your domain sign in through SSO, and you can specify a default role for teammates when they sign up. Only organizations in the enterprise tier can set up SSO. To set up your SSO integration, contact Pinecone support at support@pinecone.io.\nEnd-to-end encryption (E2EE)\nPinecone provides end-to-end encryption for user data, including encryption in transit and at rest.\nEncryption in transit", "source": "https://docs.pinecone.io/docs/security"}
{"id": "155b13a20033-1", "text": "Encryption in transit\nPinecone uses standard protocols to encrypt user data in transit. Clients open HTTPS or gRPC connections to the Pinecone API; the Pinecone API gateway uses gRPC connections to user deployments in the cloud. These HTTPS and gRPC connections use the TLS 1.2 protocol with 256-bit Advanced Encryption Standard (AES-256) encryption. See Fig. 1 below. \nFigure 1: Pinecone encryption in transit\n \nTraffic is also encrypted in transit between the Pinecone backend and cloud infrastructure services, such as S3 and GCS. For more information, see Google Cloud Platform and AWS security documentation.\nEncryption at rest\nPinecone encrypts stored data using the 256-bit Advanced Encryption Standard (AES-256) encryption algorithm.Updated about 1 month ago ArchitectureDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/security"}
{"id": "8ef910d61d8e-0", "text": "This page provides installation instructions, usage examples, and a reference for the Pinecone Node.JS client.\n\u26a0\ufe0fWarningThis is a public preview (\"Beta\") client. Test thoroughly before\n\nusing this client for production workloads. No SLAs or technical support\n\ncommitments are provided for this client. Expect potential breaking\n\nchanges in future releases.\nGetting Started\nInstallation\nUse the following shell command to install the Node.JS client for use with Node.JS versions 17 and above:\nShellnpm install @pinecone-database/pinecone\n\nAlternatively, you can install Pinecone with Yarn:\nShellyarn add @pinecone-database/pinecone\n\nUsage\nInitialize the client\nTo initialize the client, instantiate the PineconeClient class and call the init method. The init method takes an object with the apiKey and environment properties:\nJavaScriptimport { PineconeClient } from \"@pinecone-database/pinecone\";\n\nconst pinecone = new PineconeClient();\nawait pinecone.init({\n environment: \"YOUR_ENVIRONMENT\",\n apiKey: \"YOUR_API_KEY\",\n});\n\nCreate index\nThe following example creates an index without a metadata configuration. By default, Pinecone indexes all metadata.\nJavaScriptawait pinecone.createIndex({\n createRequest: {\n name: \"example-index\",\n dimension: 1024,\n },\n});", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-1", "text": "The following example creates an index that only indexes the \"color\" metadata field. Queries against this index cannot filter based on any other metadata field.\nJavaScriptawait pinecone.createIndex({\n createRequest: {\n name: \"example-index-2\",\n dimension: 1024,\n metadataConfig: {\n indexed: [\"color\"],\n },\n },\n});\n\nList indexes\nThe following example logs all indexes in your project.\nJavaScriptconst indexesList = await pinecone.listIndexes();\n\nDescribe index\nThe following example logs information about the index example-index.\nJavaScriptconst indexDescription = await pinecone.describeIndex({\n indexName: \"example-index\",\n});\n\nDelete index\nThe following example deletes example-index.\nJavaScriptawait pinecone.deleteIndex({\n indexName: \"example-index\",\n});\n\nScale replicas\nThe following example sets the number of replicas and pod type for example-index.\nJavaScriptawait pinecone.configureIndex({\n indexName: \"example-index\",\n patchRequest: {\n replicas: 2,\n podType: \"p2\",\n },\n});\n\nDescribe index statistics\nThe following example returns statistics about the index example-index.\nJavaScriptconst index = pinecone.Index(\"example-index\");\nconst indexStats = index.describeIndexStats({\n describeIndexStatsRequest: {\n filter: {},\n },\n});", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-2", "text": "Upsert vectors\nThe following example upserts vectors to example-index.\nJavaScriptconst index = pinecone.Index(\"example-index\");\nconst upsertRequest = {\n vectors: [\n {\n id: \"vec1\",\n values: [0.1, 0.2, 0.3, 0.4],\n metadata: {\n genre: \"drama\",\n },\n },\n {\n id: \"vec2\",\n values: [0.2, 0.3, 0.4, 0.5],\n metadata: {\n genre: \"action\",\n },\n },\n ],\n namespace: \"example-namespace\",\n};\nconst upsertResponse = await index.upsert({ upsertRequest });\n\nQuery an index\nThe following example queries the index example-index with metadata filtering.\nJavaScriptconst index = pinecone.Index(\"example-index\");\nconst queryRequest = {\n vector: [0.1, 0.2, 0.3, 0.4],\n topK: 10,\n includeValues: true,\n includeMetadata: true,\n filter: {\n genre: { $in: [\"comedy\", \"documentary\", \"drama\"] },\n },\n namespace: \"example-namespace\",\n};\nconst queryResponse = await index.query({ queryRequest });", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-3", "text": "Delete vectors\nThe following example deletes vectors by ID.\nJavaScriptconst index = pinecone.Index(\"example-index\");\nawait index.delete1({\n ids: [\"vec1\", \"vec2\"],\n namespace: \"example-namespace\",\n});\n\nFetch vectors\nThe following example fetches vectors by ID.\nJavaScriptconst index = pinecone.Index(\"example-index\");\nconst fetchResponse = await index.fetch({\n ids: [\"vec1\", \"vec2\"],\n namespace: \"example-namespace\",\n});\n\nUpdate vectors\nThe following example updates vectors by ID.\nJavaScriptconst index = pinecone.Index(\"example-index\");\nconst updateRequest = {\n id: \"vec1\",\n values: [0.1, 0.2, 0.3, 0.4],\n setMetadata: { genre: \"drama\" },\n namespace: \"example-namespace\",\n};\nconst updateResponse = await index.update({ updateRequest });\n\nCreate collection\nThe following example creates the collection example-collection from example-index.\nJavaScriptconst createCollectionRequest = {\n name: \"example-collection\",\n source: \"example-index\",\n};\n\nawait pinecone.createCollection({\n createCollectionRequest,\n});\n\nList collections\nThe following example returns a list of the collections in the current project.\nJavaScriptconst collectionsList = await pinecone.listCollections();", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-4", "text": "Describe a collection\nThe following example returns a description of the collection example-collection.\nJavaScriptconst collectionDescription = await pinecone.describeCollection({\n collectionName: \"example-collection\",\n});\n\nDelete a collection\nThe following example deletes the collection example-collection.\nJavaScriptawait pinecone.deleteCollection({\n collectionName: \"example-collection\",\n});\n\nReference\nFor the REST API or other clients, see the API reference.\ninit()\npinecone.init(configuration: PineconeClientConfiguration)\nInitialize the Pinecone client.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionconfigurationPineconeClientConfigurationThe configuration for the Pinecone client.\nTypes\nPineconeClientConfiguration\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionapiKeystringThe API key for the Pinecone service.environmentstringThe cloud environment of your Pinecone project.\nExample:\nJavaScriptimport { PineconeClient } from \"@pinecone-database/pinecone\";\nconst pinecone = new PineconeClient();\nawait pinecone.init({\n apiKey: \"YOUR_API_KEY\",\n environment: \"YOUR_ENVIRONMENT\",\n});\n\nconfigureIndex()\npinecone.configure_index(indexName: string, patchRequest?: PatchRequest)\nConfigure an index to change pod type and number of replicas.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionrequestParametersConfigureIndexRequestIndex configuration parameters.\nTypes\nConfigureIndexRequest", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-5", "text": "ParametersTypeDescriptionindexNamestringThe name of the index.patchRequestPatchRequest(Optional) Patch request parameters.\nPatchRequest\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionreplicasnumber(Optional) The number of replicas to configure for this index.podTypestring(Optional) The new pod type for the index. One of s1, p1, or p2 appended with . and one of x1, x2, x4, or x8.\nExample:\nJavaScriptconst newNumberOfReplicas = 4;\nconst newPodType = \"s1.x4\";\nawait pinecone.configureIndex({\n indexName: \"example-index\",\n patchRequest: {\n replicas: newNumberOfReplicas,\n podType: newPodType,\n },\n});\n\ncreateCollection()\npinecone.createCollection(requestParameters: CreateCollectionOperationRequest)\nCreate a collection from an index.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionrequestParametersCreateCollectionOperationRequestCreate collection operation wrapper\nTypes\nCreateCollectionOperationRequest\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptioncreateCollectionRequestCreateCollectionRequestCollection request parameters.\nCreateCollectionRequest", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-6", "text": "ParametersTypeDescriptionnamestringThe name of the collection to be created.sourcestringThe name of the source index to be used as the source for the collection.\nExample:\nJavaScriptawait pinecone.createCollection({\n createCollectionRequest: {\n name: \"example-collection\",\n source: \"example-index\",\n },\n});\n\ncreateIndex()\npinecone.createIndex(requestParameters?: CreateIndexRequest)\nCreate an index.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionrequestParametersCreateIndexRequestCreate index operation wrapper\nTypes\nCreateIndexRequest\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptioncreateRequestCreateRequestCreate index request parameters\nCreateRequest", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-7", "text": "ParametersTypeDescriptionnamestrThe name of the index to be created. The maximum length is 45 characters.dimensionintegerThe dimensions of the vectors to be inserted in the index.metricstr(Optional) The distance metric to be used for similarity search: 'euclidean', 'cosine', or 'dotproduct'.podsint(Optional) The number of pods for the index to use, including replicas.replicasint(Optional) The number of replicas.pod_typestr(Optional) The new pod type for the index. One of s1, p1, or p2 appended with . and one of x1, x2, x4, or x8.metadata_configobject(Optional) Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when metadata_config is present, only specified metadata fields are indexed. To specify metadata fields to index, provide a JSON object of the following form: {\"indexed\": [\"example_metadata_field\"]}source_collectionstr(Optional) The name of the collection to create an index from.\nExample:\nJavaScript// The following example creates an index without a metadata\n// configuration. By default, Pinecone indexes all metadata.\nawait pinecone.createIndex({\n createRequest: {\n name: \"pinecone-index\",\n dimension: 1024,\n },\n});", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-8", "text": "// The following example creates an index that only indexes\n// the 'color' metadata field. Queries against this index\n// cannot filter based on any other metadata field.\n\nawait pinecone.createIndex({\n createRequest: {\n name: \"example-index-2\",\n dimension: 1024,\n metadata_config: {\n indexed: [\"color\"],\n },\n },\n});\n\ndeleteCollection()\npinecone.deleteCollection(requestParameters: DeleteCollectionRequest)\nDelete an existing collection.\nTypes\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionrequestParametersDeleteCollectionRequestDelete collection request parameters\nDeleteCollectionRequest\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptioncollectionNamestringThe name of the collection to delete.\nExample:\nJavaScriptawait pinecone.deleteCollection({\n collectionName: \"example-collection\",\n});\n\ndeleteIndex()\npinecone.deleteIndex(requestParameters: DeleteIndexRequest)\nDelete an index.\nTypes\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionrequestParametersDeleteIndexRequestDelete index request parameters\nDeleteIndexRequest\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionindexNamestringThe name of the index to delete.\nExample:\nJavaScriptawait pinecone.deleteIndex({\n indexName: \"example-index\",\n});\n\ndescribeCollection()\npinecone.describeCollection(requestParameters: DescribeCollectionRequest)\nGet a description of a collection.\nTypes\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionrequestParametersDescribeCollectionRequestDescribe collection request parameters\nDescribeCollectionRequest", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-9", "text": "ParametersTypeDescriptioncollectionNamestringThe name of the collection.\nExample:\nJavaScriptconst collectionDescription = await pinecone.describeCollection({\n collectionName: \"example-collection\",\n});\n\nReturn:\n\ncollectionMeta : object Configuration information and deployment status of the collection.\n\nname : string The name of the collection.\nsize: integer The size of the collection in bytes.\nstatus: string The status of the collection.\n\n\n\ndescribeIndex()\npinecone.describeIndex(requestParameters: DescribeIndexRequest)\nGet a description of an index.\nTypes\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionrequestParametersDescribeIndexRequestDescribe index request parameters\nDescribeIndexRequest\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionindexNamestringThe name of the index.\nTypes\nReturns:", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-10", "text": "database : object\nname : string The name of the index.\ndimension : integer The dimensions of the vectors to be inserted in the index.\nmetric : string The distance metric used for similarity search: 'euclidean', 'cosine', or 'dotproduct'.\npods : integer The number of pods the index uses, including replicas.\nreplicas : integer The number of replicas.\npod_type : string The pod type for the index. One of s1, p1, or p2 appended with . and one of x1, x2, x4, or x8.\nmetadata_config: object Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when metadata_config is present, only specified metadata fields are indexed. To specify metadata fields to index, provide a JSON object of the following form: {\"indexed\": [\"example_metadata_field\"]} \nstatus : object\nready : boolean Whether the index is ready to serve queries.\nstate : string One of Initializing, ScalingUp, ScalingDown, Terminating, or Ready.\n\nExample:\nJavaScriptconst indexDescription = await pinecone.describeIndex({\n indexName: \"example-index\",\n});\n\nlistCollections\npinecone.listCollections()\nReturn a list of the collections in your project.\nExample:\nJavaScriptconst collections = await pinecone.listCollections();\n\nReturns:\n\narray of strings The names of the collections in your project.", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-11", "text": "listIndexes\npinecone.listIndexes()\nReturn a list of your Pinecone indexes.\nReturns:\n\narray of strings The names of the indexes in your project.\n\nExample:\nJavaScriptconst indexesList = await pinecone.listIndexes();\n\nIndex()\npinecone.Index(indexName: string)\nConstruct an Index object.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionindexNamestringThe name of the index.\nExample:\nJavaScriptconst index = pinecone.Index(\"example-index\");\n\nIndex.delete1()\nindex.delete(requestParameters: Delete1Request)\nDelete items by their ID from a single namespace.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionrequestParametersDelete1RequestDelete request parameters\nTypes\nDelete1Request\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionidsArray(Optional) The IDs of the items to delete.deleteAllboolean(Optional) Indicates that all vectors in the index namespace should be deleted.namespacestr(Optional) The namespace to delete vectors from, if applicable.\nTypes\nExample:\nJavaScriptawait index.delete1({\n ids: [\"example-id-1\", \"example-id-2\"],\n namespace: \"example-namespace\",\n});\n\nIndex.describeIndexStats()\nindex.describeIndexStats(requestParameters: DescribeIndexStatsOperationRequest)\nReturns statistics about the index's contents, including the vector count per namespace and the number of dimensions.", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-12", "text": "ParametersTypeDescriptionrequestParametersDescribeIndexStatsOperationRequestDescribe index stats request wrapper\nTypes\nDescribeIndexStatsOperationRequest\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptiondescribeIndexStatsRequestDescribeIndexStatsRequestDescribe index stats request parameters\nDescribeIndexStatsRequest\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nparameterTypeDescriptionfilterobject(Optional) A metadata filter expression.\nReturns:\n\nnamespaces : object A mapping for each namespace in the index from the namespace name to a\n\nsummary of its contents. If a metadata filter expression is present, the summary will reflect only vectors matching that expression.\ndimension : int64 The dimension of the indexed vectors.\nindexFullness : float The fullness of the index, regardless of whether a metadata filter expression was passed. The granularity of this metric is 10%.\ntotalVectorCount : int64 The total number of vectors in the index.\n\nExample:\nJavaScriptconst indexStats = await index.describeIndexStats({\n describeIndexStatsRequest: {},\n});\n\nRead more about filtering for more detail.\nIndex.fetch()\nindex.fetch(requestParameters: FetchRequest)\nThe Fetch operation looks up and returns vectors, by ID, from a single namespace. The returned vectors include the vector data and metadata.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionrequestParametersFetchRequestFetch request parameters\nTypes\nFetchRequest", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-13", "text": "ParametersTypeDescriptionidsArrayThe vector IDs to fetch. Does not accept values containing spaces.namespacestring(Optional) The namespace containing the vectors.\nReturns:\n\nvectors : object Contains the vectors.\nnamespace : string The namespace of the vectors.\n\nExample:\nJavaScriptconst fetchResponse = await index.fetch({\n ids: [\"example-id-1\", \"example-id-2\"],\n namespace: \"example-namespace\",\n});\n\nIndex.query()\nindex.query(requestParameters: QueryOperationRequest)\nSearch a namespace using a query vector. Retrieves the ids of the most similar items in a namespace, along with their similarity scores.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionrequestParametersQueryOperationRequestThe query operation request wrapper.\nTypes\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionqueryRequestQueryRequestThe query operation request.\nQueryRequest", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-14", "text": "ParameterTypeDescriptionnamespacestring(Optional) The namespace to query.topKnumberThe number of results to return for each query.filterobject(Optional) The filter to apply. You can use vector metadata to limit your search. See https://www.pinecone.io/docs/metadata-filtering/.includeValuesboolean(Optional) Indicates whether vector values are included in the response. Defaults to false.includeMetadataboolean(Optional) Indicates whether metadata is included in the response as well as the ids. Defaults to false.vectorArray(Optional) The query vector. This should be the same length as the dimension of the index being queried. Each query() request can contain only one of the parameters id or vector.idstring(Optional) The unique ID of the vector to be used as a query vector. Each query() request can contain only one of the parameters vector or id.\nExample:\nJavaScriptconst queryResponse = await index.query({\n queryRequest: {\n namespace: \"example-namespace\",\n topK: 10,\n filter: {\n genre: { $in: [\"comedy\", \"documentary\", \"drama\"] },\n },\n includeValues: true,\n includeMetadata: true,\n vector: [0.1, 0.2, 0.3, 0.4],\n },\n});", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-15", "text": "Index.update()\nindex.update(requestParameters: UpdateOperationRequest)\nUpdates vectors in a namespace. If a value is included, it will overwrite the previous value.\n\nIf setMetadata is included in the updateRequest, the values of the fields specified in it will be added or overwrite the previous value.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionrequestParametersUpdateOperationRequestThe update operation wrapper\nTypes\nUpdateOperationRequest\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionupdateRequestUpdateRequestThe update request.\nUpdateRequest\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParameterTypeDescriptionidstringThe vector's unique ID.valuesArray(Optional) Vector data.setMetadataobject(Optional) Metadata to set for the vector.namespacestring(Optional) The namespace containing the vector.\nExample:\nJavaScriptconst updateResponse = await index.update({\n updatedRequest: {\n id: \"vec1\",\n values: [0.1, 0.2, 0.3, 0.4],\n setMetadata: {\n genre: \"drama\",\n },\n namespace: \"example-namespace\",\n },\n});\n\nIndex.upsert()\nindex.upsert(requestParameters: UpsertOperationRequest)\nWrites vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value.", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-16", "text": "ParametersTypeDescriptionrequestParametersUpsertOperationRequestUpsert operation wrapper\nTypes\nUpsertOperationRequest\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionupsertRequestUpsertRequestThe upsert request.\nUpsertRequest\n| Parameter | Type | Description |\n\n| vectors | Array | An array containing the vectors to upsert. Recommended batch limit is 100 vectors.\nid (str) - The vector's unique id.\nvalues ([float]) - The vector data.\nmetadata (object) - (Optional) Metadata for the vector. |\n\n| namespace | string | (Optional) The namespace name to upsert vectors. |\nVector\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParameterTypeDescriptionidstringThe vector's unique ID.valuesArrayVector data.metadataobject(Optional) Metadata for the vector.\nReturns:\n\nupsertedCount : int64 The number of vectors upserted.", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "8ef910d61d8e-17", "text": "Example:\nJavaScriptconst upsertResponse = await index.upsert({\n upsertRequest: {\n vectors: [\n {\n id: \"vec1\",\n values: [0.1, 0.2, 0.3, 0.4],\n metadata: {\n genre: \"drama\",\n },\n },\n {\n id: \"vec2\",\n values: [0.1, 0.2, 0.3, 0.4],\n metadata: {\n genre: \"comedy\",\n },\n },\n ],\n namespace: \"example-namespace\",\n },\n});\nUpdated about 1 month ago Python ClientLimitsDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/node-client"}
{"id": "cc60f5f5e4a7-0", "text": "This page provides installation instructions, usage examples, and a reference for the Pinecone Python client.\nGetting Started\nInstallation\nUse the following shell command to install the Python client for use with Python versions 3.6+:\nPythonpip3 install pinecone-client\n\nAlternatively, you can install Pinecone in a Jupyter notebook:\nPython!pip3 install pinecone-client\n\nWe strongly recommend installing Pinecone in a virtual environment. For more information on using Python virtual environments, see:\n\nPyPA Python Packaging User Guide\nPython Virtual Environments: A Primer\n\nThere is a gRPC flavor of the client available, which comes with more dependencies in return for faster upload speeds. To install it, use the following command:\nPythonpip3 install \"pinecone-client[grpc]\"\n\nFor the latest development version:\nPythonpip3 install git+https://git@github.com/pinecone-io/pinecone-python-client.git\n\nFor a specific development version:\nPythonpip3 install git+https://git@github.com/pinecone-io/pinecone-python-client.git\npip3 install git+https://git@github.com/pinecone-io/pinecone-python-client.git@example-branch-name\npip3 install git+https://git@github.com/pinecone-io/pinecone-python-client.git@259deff\n\nUsage\nCreate index\nThe following example creates an index without a metadata configuration. By default, Pinecone indexes all metadata.\nPythonimport pinecone", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-1", "text": "pinecone.init(api_key=\"YOUR_API_KEY\",\n environment=\"YOUR_ENVIRONMENT\")\n\npinecone.create_index(\"example-index\", dimension=1024)\n\nThe following example creates an index that only indexes the \"color\" metadata field. Queries against this index cannot filter based on any other metadata field.\nPythonmetadata_config = {\n \"indexed\": [\"color\"]\n}\n\npinecone.create_index(\"example-index-2\", dimension=1024,\n metadata_config=metadata_config)\n\nList indexes\nThe following example returns all indexes in your project.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\n\nactive_indexes = pinecone.list_indexes()\n\nDescribe index\nThe following example returns information about the index example-index.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\n\nindex_description = pinecone.describe_index(\"example-index\")\n\nDelete index\nThe following example deletes example-index.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\n\npinecone.delete_index(\"example-index\")\n\nScale replicas\nThe following example changes the number of replicas for example-index.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\n\nnew_number_of_replicas = 4\npinecone.configure_index(\"example-index\", replicas=new_number_of_replicas)", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-2", "text": "Describe index statistics\nThe following example returns statistics about the index example-index.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\nindex = pinecone.Index(\"example-index\")\n\nindex_stats_response = index.describe_index_stats()\n\nUpsert vectors\nThe following example upserts dense vectors to example-index.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\nindex = pinecone.Index(\"example-index\")\n\nupsert_response = index.upsert(\n vectors=[\n (\n \"vec1\", # Vector ID \n [0.1, 0.2, 0.3, 0.4], # Dense vector values\n {\"genre\": \"drama\"} # Vector metadata\n ),\n (\n \"vec2\", \n [0.2, 0.3, 0.4, 0.5], \n {\"genre\": \"action\"}\n )\n ],\n namespace=\"example-namespace\"\n)\n\nQuery an index\nThe following example queries the index example-index with metadata filtering.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\nindex = pinecone.Index(\"example-index\")", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-3", "text": "query_response = index.query(\n namespace=\"example-namespace\",\n top_k=10,\n include_values=True,\n include_metadata=True,\n vector=[0.1, 0.2, 0.3, 0.4],\n filter={\n \"genre\": {\"$in\": [\"comedy\", \"documentary\", \"drama\"]}\n }\n)\n\nDelete vectors\nThe following example deletes vectors by ID.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\nindex = pinecone.Index(\"example-index\")\n\ndelete_response = index.delete(ids=[\"vec1\", \"vec2\"], namespace=\"example-namespace\")\n\nFetch vectors\nThe following example fetches vectors by ID.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\nindex = pinecone.Index(\"example-index\")\n\nfetch_response = index.fetch(ids=[\"vec1\", \"vec2\"], namespace=\"example-namespace\")\n\nUpdate vectors\nThe following example updates vectors by ID.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\nindex = pinecone.Index(\"example-index\")\n\nupdate_response = index.update(\n id=\"vec1\",\n values=[0.1, 0.2, 0.3, 0.4],\n set_metadata={\"genre\": \"drama\"},\n namespace=\"example-namespace\"\n)", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-4", "text": "Create collection\nThe following example creates the collection example-collection from example-index.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\",\n environment=\"YOUR_ENVIRONMENT\")\n\npinecone.create_collection(\"example-collection\", \"example-index\")\n\nList collections\nThe following example returns a list of the collections in the current project.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\n\nactive_collections = pinecone.list_collections()\n\nDescribe a collection\nThe following example returns a description of the collection example-collection.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\n\ncollection_description = pinecone.describe_collection(\"example-collection\")\n\nDelete a collection\nThe following example deletes the collection example-collection.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\n\npinecone.delete_collection(\"example-collection\")\n\nReference\nFor the REST API or other clients, see the API reference.\ninit()\npinecone.init(**kwargs)\nInitialize Pinecone.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionapi_keystrYour Pinecone API key.environmentstrThe cloud environment of your Pinecone project.\nExample:\nPythonimport pinecone\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-5", "text": "configure_index()\npinecone.configure_index(index_name, **kwargs)\nConfigure an index to change pod type and number of replicas.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionindex_namestrThe name of the indexreplicasint(Optional) The number of replicas to configure for this index.pod_typestr(Optional) The new pod type for the index. One of s1, p1, or p2 appended with . and one of x1, x2, x4, or x8.\nExample:\nPythonimport pinecone\n\npinecone.init(api_key='YOUR_API_KEY', environment='YOUR_ENVIRONMENT')\n\nnew_number_of_replicas = 4\npinecone.configure_index('example-index', replicas=new_number_of_replicas)\n\ncreate_collection()\npinecone.create_collection(**kwargs)\nCreate a collection from an index.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionnamestrThe name of the collection to be created.sourcestrThe name of the source index to be used as the source for the collection.\nExample:\nPythonimport pinecone\n\npinecone.init(api_key='YOUR_API_KEY', environment='YOUR_ENVIRONMENT')\n\npinecone.create_collection('example-collection', 'example-index')\n\ncreate_index()\npinecone.create_index(**kwargs)\nCreate an index.", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-6", "text": "ParametersTypeDescriptionnamestrThe name of the index to be created. The maximum length is 45 characters.dimensionintegerThe dimensions of the vectors to be inserted in the index.metricstr(Optional) The distance metric to be used for similarity search: 'euclidean', 'cosine', or 'dotproduct'.podsint(Optional) The number of pods for the index to use, including replicas.replicasint(Optional) The number of replicas.pod_typestr(Optional) The new pod type for the index. One of s1, p1, or p2 appended with . and one of x1, x2, x4, or x8.metadata_configobject(Optional) Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when metadata_config is present, only specified metadata fields are indexed. To specify metadata fields to index, provide a JSON object of the following form: {\"indexed\": [\"example_metadata_field\"]}source_collectionstr(Optional) The name of the collection to create an index from.\nExample:\nPythonimport pinecone\n\npinecone.init(api_key='YOUR_API_KEY', environment='YOUR_ENVIRONMENT')\n\n## The following example creates an index without a metadata\n## configuration. By default, Pinecone indexes all metadata.\n\npinecone.create_index('example-index', dimension=1024)", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-7", "text": "## The following example creates an index that only indexes\n## the 'color' metadata field. Queries against this index\n## cannot filter based on any other metadata field.\n\nmetadata_config = {\n 'indexed': ['color']\n}\n\npinecone.create_index('example-index-2', dimension=1024,\n metadata_config=metadata_config)\n\ndelete_collection()\npinecone.delete_collection('example-collection')\nDelete an existing collection.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptioncollectionNamestrThe name of the collection to delete.\nExample:\nPythonimport pinecone\n\npinecone.init(api_key='YOUR_API_KEY', environment='YOUR_ENVIRONMENT')\npinecone.delete_collection('example-collection')\n\ndelete_index()\npinecone.delete_index(indexName)\nDelete an existing index.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionindex_namestrThe name of the index.\nExample:\nPythonimport pinecone\n\npinecone.init(api_key='YOUR_API_KEY', environment='YOUR_ENVIRONMENT')\n\npinecone.delete_index('example-index')\n\ndescribe_collection()\npinecone.describe_collection(collectionName)\nGet a description of a collection.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptioncollection_namestrThe name of the collection.\nExample:\nPythonimport pinecone\n\npinecone.init(api_key='YOUR_API_KEY', environment='YOUR_ENVIRONMENT')\n\ncollection_description = pinecone.describe_collection('example-collection')\n\nReturns:\n\ncollectionMeta : object Configuration information and deployment status of the collection.", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-8", "text": "name : string The name of the collection.\nsize: integer The size of the collection in bytes.\nstatus: string The status of the collection.\n\n\n\ndescribe_index()\npinecone.describe_index(indexName)\nGet a description of an index.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionindex_namestrThe name of the index.\nReturns:\n\ndatabase : object\nname : string The name of the index.\ndimension : integer The dimensions of the vectors to be inserted in the index.\nmetric : string The distance metric used for similarity search: 'euclidean', 'cosine', or 'dotproduct'.\npods : integer The number of pods the index uses, including replicas.\nreplicas : integer The number of replicas.\npod_type : string The pod type for the index. One of s1, p1, or p2 appended with . and one of x1, x2, x4, or x8.\nmetadata_config: object Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when metadata_config is present, only specified metadata fields are indexed. To specify metadata fields to index, provide a JSON object of the following form: {\"indexed\": [\"example_metadata_field\"]} \nstatus : object\nready : boolean Whether the index is ready to serve queries.\nstate : string One of Initializing, ScalingUp, ScalingDown, Terminating, or Ready.\n\nExample:\nPythonimport pinecone", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-9", "text": "Example:\nPythonimport pinecone\n\npinecone.init(api_key='YOUR_API_KEY', environment='YOUR_ENVIRONMENT')\n\nindex_description = pinecone.describe_index('example-index')\n\nlist_collections()\npinecone.list_collections()\nReturn a list of the collections in your project.\nReturns:\n\narray of strings The names of the collections in your project.\n\nExample:\nPythonimport pinecone\n\npinecone.init(api_key='YOUR_API_KEY', environment='us-east1-gcp')\n\nactive_collections = pinecone.list_collections()\n\nlist_indexes()\npinecone.list_indexes()\nReturn a list of your Pinecone indexes.\nReturns:\n\narray of strings The names of the indexes in your project.\n\nExample:\nPythonimport pinecone\n\npinecone.init(api_key='YOUR_API_KEY', environment='YOUR_ENVIRONMENT')\n\nactive_indexes = pinecone.list_indexes()\n\nIndex()\npinecone.Index(indexName)\nConstruct an Index object.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionindexNamestrThe name of the index.\nExample:\nPythonindex = pinecone.Index(\"example-index\")\n\nIndex.delete()\nIndex.delete(**kwargs)\nDelete items by their ID from a single namespace.", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-10", "text": "ParametersTypeDescriptionidsarray(Optional) array of strings vectors to delete.delete_allboolean(Optional) Indicates that all vectors in the index namespace should be deleted.namespacestr(Optional) The namespace to delete vectors from, if applicable.filterobject(Optional) If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See https://www.pinecone.io/docs/metadata-filtering/.\nExample:\nPythonimport pinecone\n\npinecone.init(api_key='YOUR_API_KEY', environment='YOUR_ENVIRONMENT')\nindex = pinecone.Index('example-index')\n\ndelete_response = index.delete(ids=['vec1', 'vec2'], namespace='example-namespace')\n\nIndex.describe_index_stats()\nIndex.describe_index_stats()\nReturns statistics about the index's contents, including the vector count per namespace and the number of dimensions.\nReturns:\n\nnamespaces : object A mapping for each namespace in the index from the namespace name to a\n\nsummary of its contents. If a metadata filter expression is present, the summary will reflect only vectors matching that expression.\ndimension : int64 The dimension of the indexed vectors.\nindexFullness : float The fullness of the index, regardless of whether a metadata filter expression was passed. The granularity of this metric is 10%.\ntotalVectorCount : int64 The total number of vectors in the index.", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-11", "text": "Example:\nPythonimport pinecone\n\npinecone.init(api_key='YOUR_API_KEY', environment='YOUR_ENVIRONMENT')\nindex = pinecone.Index('example-index')\n\nindex_stats_response = index.describe_index_stats()\n\nIndex.fetch()\nIndex.fetch(ids, **kwargs)\nThe Fetch operation looks up and returns vectors, by ID, from a single namespace. The returned vectors include the vector data and metadata.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionids[str]The vector IDs to fetch. Does not accept values containing spaces.namespacestr(Optional) The namespace containing the vectors.\nReturns:\n\nvectors : object Contains the vectors.\nnamespace : string The namespace of the vectors.\n\nExample:\nPythonimport pinecone\n\npinecone.init(api_key='YOUR_API_KEY', environment='YOUR_ENVIRONMENT')\nindex = pinecone.Index('example-index')\n\nfetch_response = index.fetch(ids=['vec1', 'vec2'], namespace='example-namespace')\n\nIndex.query()\nIndex.query(**kwargs)\nSearch a namespace using a query vector. Retrieves the ids of the most similar items in a namespace, along with their similarity scores.", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-12", "text": "ParametersTypeDescriptionnamespacestr(Optional) The namespace to query.top_kint64The number of results to return for each query.filterobject(Optional) The filter to apply. You can use vector metadata to limit your search. See https://www.pinecone.io/docs/metadata-filtering/.include_valuesboolean(Optional) Indicates whether vector values are included in the response. Defaults to false.include_metadataboolean(Optional) Indicates whether metadata is included in the response as well as the ids. Defaults to false.vector[floats](Optional) The query vector. This should be the same length as the dimension of the index being queried. Each query() request can contain only one of the parameters id or vector.sparse_vectordictionary(Optional) The sparse query vector. This must contain an array of integers named indices and an array of floats named values. These two arrays must be the same length.idstring(Optional) The unique ID of the vector to be used as a query vector. Each query() request can contain only one of the parameters vector or id.\nExample:\nPythonimport pinecone\n\n pinecone.init(api_key='YOUR_API_KEY', environment='YOUR_ENVIRONMENT')\n index = pinecone.Index('example-index')", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-13", "text": "query_response = index.query(\n namespace='example-namespace',\n top_k=10,\n include_values=True,\n include_metadata=True,\n vector=[0.1, 0.2, 0.3, 0.4],\n filter={\n 'genre': {'$in': ['comedy', 'documentary', 'drama']}\n }\n)\n\nThe following example queries the index example-index with a sparse-dense vector.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\nindex = pinecone.Index(\"example-index\")\n\nquery_response = index.query(\n namespace=\"example-namespace\",\n top_k=10,\n include_values=True,\n include_metadata=True,\n vector=[0.1, 0.2, 0.3, 0.4],\n sparse_vector={\n 'indices': [10, 45, 16],\n 'values': [0.5, 0.5, 0.2]\n },\n filter={\n \"genre\": {\"$in\": [\"comedy\", \"documentary\", \"drama\"]}\n }\n)\n\nIndex.update()\nIndex.update(**kwargs)\nUpdates vectors in a namespace. If a value is included, it will overwrite the previous value.\n\nIf set_metadata is included, the values of the fields specified in it will be added or overwrite the previous value.", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-14", "text": "ParametersTypeDescriptionidstrThe vector's unique ID.values[float](Optional) Vector data.set_metadataobject(Optional) Metadata to set for the vector.namespacestr(Optional) The namespace containing the vector.\nExample:\nPythonimport pinecone\n\npinecone.init(api_key='YOUR_API_KEY', environment='YOUR_ENVIRONMENT')\nindex = pinecone.Index('example-index')\n\nupdate_response = index.update(\n id='vec1',\n values=[0.1, 0.2, 0.3, 0.4],\n set_metadata={'genre': 'drama'},\n namespace='example-namespace'\n)\n\nIndex.upsert()\nIndex.upsert(**kwargs)\nWrites vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nParametersTypeDescriptionvectors[object]An array containing the vectors to upsert. Recommended batch limit is 100 vectors.\nid (str) - The vector's unique id.\nvalues ([float]) - The vector data.\nmetadata (object) - (Optional) Metadata for the vector.\nsparse_vector (object) - (Optional) A dictionary containing the index and values arrays containing the sparse vector values.namespacestr(Optional) The namespace name to upsert vectors.\nReturns:\n\nupsertedCount : int64 The number of vectors upserted.", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-15", "text": "Example:\nPythonimport pinecone\n\npinecone.init(api_key='YOUR_API_KEY', environment='YOUR_ENVIRONMENT')\nindex = pinecone.Index('example-index')\n\nupsert_response = index.upsert(\n vectors=[\n {'id': \"vec1\", \"values\":[0.1, 0.2, 0.3, 0.4], \"metadata\": {'genre': 'drama'}},\n {'id': \"vec2\", \"values\":[0.2, 0.3, 0.4, 0.5], \"metadata\": {'genre': 'action'}},\n ],\n namespace='example-namespace'\n)\n\nThe following example upserts vectors with sparse and dense values to example-index.\nPythonimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\nindex = pinecone.Index(\"example-index\")", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "cc60f5f5e4a7-16", "text": "upsert_response = index.upsert(\n vectors=[\n {'id': 'vec1',\n 'values': [0.1, 0.2, 0.3, 0.4],\n 'metadata': {'genre': 'drama'},\n 'sparse_values': {\n 'indices': [10, 45, 16],\n 'values': [0.5, 0.5, 0.2]\n }},\n {'id': 'vec2',\n 'values': [0.2, 0.3, 0.4, 0.5],\n 'metadata': {'genre': 'action'},\n 'sparse_values': {\n 'indices': [15, 40, 11],\n 'values': [0.4, 0.5, 0.2]\n }}\n ],\n namespace='example-namespace'\n)\nUpdated about 1 month ago LangChainNode.JS ClientDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/python-client"}
{"id": "eb05f2902f12-0", "text": "This document describes how to monitor the usage and costs for your Pinecone organization through the Pinecone console.\nTo view your Pinecone usage, you must be the organization owner for your organization. This feature is only available to organizations on the Standard or Enterprise plans.\nTo view your usage through the Pinecone console, follow these steps:\n\nLog in to the Pinecone console.\nIn the left menu, click Organizations.\nClick the USAGE tab.\n\nAll dates are given in UTC to match billing invoices.Updated about 1 month ago Understanding costManage billingDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/monitoring-usage"}
{"id": "20c69b6bb780-0", "text": "Overview\nThis category contains guides for tasks related to Pinecone billing.\nTasks\n\nSetting up GCP Marketplace billing\nSetting up AWS Marketplace billing\nChanging your billing plan\nUnderstanding subscription statuses\nUpdated 24 days ago Monitoring your usageUnderstanding subscription statusDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/manage-billing"}
{"id": "91092c370872-0", "text": "Overview\nThis topic provides guidance on managing the cost of Pinecone. For the latest pricing details, see our pricing page. For help estimating total cost, see Understanding total cost. To see a calculation of your current usage and costs, see the usage dashboard in the Pinecone console.\nThe total cost of Pinecone usage derives from pod type, the number of pods in use, pod size, the total time each pod is running, and the billing plan. This topic describes several ways you can manage your overall Pinecone cost by adjusting these variables.\nUse the Starter Plan for small projects or prototypes\nThe Starter Plan incurs no costs, and supports roughly 100,000 vectors with 1536 dimensions. If this meets the needs of your project, you can use Pinecone for free; if you decide to scale your index or move it to production, you can upgrade your billing plan later.\nChoose the right pod size for your application\nDifferent Pinecone pod sizes are designed for different applications, and some are more expensive than others. By choosing the appropriate pod type and size, you can pay for the resources you need. For example, the s1 pod type provides large storage capacity and lower overall costs with slightly higher query latencies than p1 pods. By switching to a different pod type, you may be able to reduce costs while still getting the performance your application needs.\nBack up inactive indexes", "source": "https://docs.pinecone.io/docs/managing-cost"}
{"id": "91092c370872-1", "text": "Back up inactive indexes\nWhen a specific index is not in use, back it up using collections and delete the inactive index. When you're ready to use these vectors again, you can create a new index from the collection. This new index can also use a different index type or size. Because it's relatively cheap to store collections, you can reduce costs by only running an index when it's in use.\nUse namespaces for multitenancy\nIf your application requires you to separate users into groups, consider using namespaces to isolate segments of vectors within a single index. Depending on your application requirements, this may allow you to reduce the total number of active indexes. \nCommit to annual spend\nUsers who commit to an annual contract may qualify for discounted rates. To learn more, contact Pinecone sales.\nTalk to support\nUsers on the Standard and Enterprise plans can contact support for help in optimizing costs.\nNext steps", "source": "https://docs.pinecone.io/docs/managing-cost"}
{"id": "91092c370872-2", "text": "Learn about choosing index type and size\nLearn about monitoring usage\nUpdated about 1 month ago Understanding organizationsUnderstanding costDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/managing-cost"}
{"id": "97a99c842e81-0", "text": "Overview\nThis topic describes the calculation of total cost for Pinecone, including an example. All prices are examples; for the latest pricing details, please see our pricing page. While our pricing page lists rates on an hourly basis for ease of comparison, this topic lists prices per minute, as this is how Pinecone calculates billing.\nHow does Pinecone calculate costs?\nFor each index, billing is determined by the per-minute price per pod and the number of pods the index uses, regardless of index activity. The per-minute price varies by pod type, pod size, account plan, and cloud region.\nTotal cost depends on a combination of factors:\n\nPod type. Each pod type has different per-minute pricing.\nNumber of pods. This includes replicas, which duplicate pods.\nPod size. Larger pod sizes have proportionally higher costs per minute.\nTotal pod-minutes. This includes the total time each pod is running, starting at pod creation and rounded up to 15-minute increments.\nCloud provider. The cost per pod-type and pod-minute varies depending on the cloud provider you choose for your project. \nCollection storage. Collections incur costs per GB of data per minute in storage, rounded up to 15-minute increments.\nPlan. The free plan incurs no costs; the Standard or Enterprise plans incur different costs per pod-type, pod-minute, cloud provider, and collection storage.", "source": "https://docs.pinecone.io/docs/understanding-cost"}
{"id": "97a99c842e81-1", "text": "The following equation calculates the total costs accrued over time:\n(Number of pods) * (pod size) * (number of replicas) * (minutes pod exists) * (pod price per minute) \n\n(collection storage in GB) * (collection storage time in minutes) * (collection storage price per GB per minute)\n\nTo see a calculation of your current usage and costs, see the usage dashboard in the Pinecone console.\nExample total cost calculation\nAn example application has the following requirements:\n\n1,000,000 vectors with 1536 dimensions\n150 queries per second with top_k = 10\nDeployment in an EU region\nAbility to store 1GB of inactive vectors\n\nBased on these requirements, the organization chooses to configure the project to use the Standard billing plan to host one p1.x2 pod with two replicas and a collection containing 1 GB of data. This project runs continuously for the month of January on the Standard plan. The components of the total cost for this example are given in Table 1 below:\nTable 1: Example billing components", "source": "https://docs.pinecone.io/docs/understanding-cost"}
{"id": "97a99c842e81-2", "text": "Billing componentValueNumber of pods1Number of replicas3Pod sizex2Total pod count6Minutes in January44,640Pod-minutes (pods * minutes)267,840Pod price per minute$0.0012Collection storage1 GBCollection storage minutes44,640Price per storage minute$0.00000056\nThe invoice for this example is given in Table 2 below:\nTable 2: Example invoice\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nProductQuantityPrice per unitChargeCollections44,640$0.00000056$0.025P2 Pods (AWS)0$0.00P2 Pods (GCP)0$0.00S1 Pods0$0.00P1 Pods267,840$0.0012$514.29\nAmount due $514.54 \nCost controls\nPinecone offers tools to help you understand and control your costs. \n\n\nMonitoring usage. Using the usage dashboard in the Pinecone console, you can monitor your Pinecone usage and costs as these accrue.\n\n\nPod limits. Pinecone project owners can set limits for the total number of pods across all indexes in the project. The default pod limit is 5.\n\n\nNext steps", "source": "https://docs.pinecone.io/docs/understanding-cost"}
{"id": "97a99c842e81-3", "text": "Next steps\n\nLearn about choosing index type and size\nLearn about monitoring usage\nUpdated about 1 month ago Managing costMonitoring your usageDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/understanding-cost"}
{"id": "13b908d24904-0", "text": "Overview\nA Pinecone organization is a set of projects that use the same billing. Organizations allow one or more users to control billing and project permissions for all of the projects belonging to the organization. Each project belongs to an organization. \nFor a guide to adding users to an organization, see Add users to a project or organization.\nProjects in an organization\nEach organization contains one or more projects that share the same organization owners and billing settings. Each project belongs to exactly one organization. If you need to move a project from one organization to another, contact Pinecone support. \nBilling settings\nAll of the projects in an organization share the same billing method and settings. The billing settings for the organization are controlled by the organization owners.\nOrganization roles\nThere are two organization roles: organization owner and organization user.\nOrganization owners\nOrganization owners manage organization billing, users, and projects. Organization owners are also project owners for every project belonging to the organization. This means that organization owners have all permissions to manage project members, API keys, and quotas for these projects.\nOrganization users\nUnlike organization owners, organization users cannot edit billing settings or invite new users to the organization. Organization users can create new projects, and project owners can add organization members to a project. New users have whatever role the organization owners and project owners grant them. Project owners can add users to a project if those users belong to the same organization as the project.\nTable 1: Organization roles and permissions", "source": "https://docs.pinecone.io/docs/organizations"}
{"id": "13b908d24904-1", "text": "Organization rolePermissions in organizationOrganization ownerProject owner for all projectsCreate projectsManage billingManags organization membersOrganization memberCreate projectsJoin projects when invitedRead access to billing\nOrganization single sign-on (SSO)\nSSO allows organizations to manage their teams' access to Pinecone through their identity management solution. Once your integration is configured, you can require that users from your domain sign in through SSO, and you can specify a default role for teammates when they sign up. Only organizations in the enterprise tier can set up SSO. To set up your SSO integration, contact Pinecone support at support@pinecone.io.\nNext steps\n\nAdd users to an organization\nUpdated 29 days ago Choosing index type and sizeManaging costDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/organizations"}
{"id": "b05ea8e9b206-0", "text": "You can limit your vector search based on metadata. Pinecone lets you attach metadata key-value pairs to vectors in an index, and specify filter expressions when you query the index.\nSearches with metadata filters retrieve exactly the number of nearest-neighbor results that match the filters. For most cases, the search latency will be even lower than unfiltered searches.\nSearches without metadata filters do not consider metadata. To combine keywords with semantic search, see sparse-dense embeddings.\nFor more background information on metadata filtering, see: The Missing WHERE Clause in Vector Search.\n\nSupported metadata types\nYou can associate a metadata payload with each vector in an index, as key-value pairs in a JSON object where keys are strings and values are one of:\n\nString\nNumber (integer or floating point, gets converted to a 64 bit floating point)\nBooleans (true, false)\nList of String\n\n\u2139\ufe0fNoteHigh cardinality consumes more memory: Pinecone indexes metadata to allow\n\nfor filtering. If the metadata contains many unique values \u2014 such as a unique\n\nidentifier for each vector \u2014 the index will consume significantly more\n\nmemory. Consider using selective metadata indexing to avoid indexing\n\nhigh-cardinality metadata that is not needed for filtering.\n\u26a0\ufe0fWarningNull metadata values are not supported. Instead of setting a key to hold a", "source": "https://docs.pinecone.io/docs/metadata-filtering"}
{"id": "b05ea8e9b206-1", "text": "null value, we recommend you remove that key from the metadata payload.\nFor example, the following would be valid metadata payloads:\nJSON{\n \"genre\": \"action\",\n \"year\": 2020,\n \"length_hrs\": 1.5\n}\n\n{\n \"color\": \"blue\",\n \"fit\": \"straight\",\n \"price\": 29.99,\n \"is_jeans\": true\n}\n\nSupported metadata size\nPinecone supports 40kb of metadata per vector.\nMetadata query language\n\u2139\ufe0fNotePinecone's filtering query language is based on MongoDB's query and projection operators. We\n\ncurrently support a subset of those selectors.\nThe metadata filters can be combined with AND and OR:\n\n$eq - Equal to (number, string, boolean)\n$ne - Not equal to (number, string, boolean)\n$gt - Greater than (number)\n$gte - Greater than or equal to (number)\n$lt - Less than (number)\n$lte - Less than or equal to (number)\n$in - In array (string or number)\n$nin - Not in array (string or number)\n\nUsing arrays of strings as metadata values or as metadata filters\nA vector with metadata payload...\nJSON{ \"genre\": [\"comedy\", \"documentary\"] }", "source": "https://docs.pinecone.io/docs/metadata-filtering"}
{"id": "b05ea8e9b206-2", "text": "...means the \"genre\" takes on both values.\nFor example, queries with the following filters will match the vector:\nJSON{\"genre\":\"comedy\"}\n\n{\"genre\": {\"$in\":[\"documentary\",\"action\"]}}\n\n{\"$and\": [{\"genre\": \"comedy\"}, {\"genre\":\"documentary\"}]}\n\nQueries with the following filter will not match the vector:\nJSON{ \"$and\": [{ \"genre\": \"comedy\" }, { \"genre\": \"drama\" }] }\n\nAnd queries with the following filters will not match the vector because they are invalid. They will result in a query compilation error:\n# INVALID QUERY:\n{\"genre\": [\"comedy\", \"documentary\"]}\n\n# INVALID QUERY:\n{\"genre\": {\"$eq\": [\"comedy\", \"documentary\"]}}\n\nInserting metadata into an index\nMetadata can be included in upsert requests as you insert your vectors.\nFor example, here's how to insert vectors with metadata representing movies into an index:\nPythonJavaScriptcurlimport pinecone\n\npinecone.init(api_key=\"your-api-key\", environment=\"us-west1-gcp\")\nindex = pinecone.Index(\"example-index\")", "source": "https://docs.pinecone.io/docs/metadata-filtering"}
{"id": "b05ea8e9b206-3", "text": "index.upsert([\n (\"A\", [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1], {\"genre\": \"comedy\", \"year\": 2020}),\n (\"B\", [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2], {\"genre\": \"documentary\", \"year\": 2019}),\n (\"C\", [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3], {\"genre\": \"comedy\", \"year\": 2019}),\n (\"D\", [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4], {\"genre\": \"drama\"}),\n (\"E\", [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], {\"genre\": \"drama\"})\n])\nawait index.upsert({", "source": "https://docs.pinecone.io/docs/metadata-filtering"}
{"id": "b05ea8e9b206-4", "text": "])\nawait index.upsert({\n vectors: [\n {\n id: \"A\",\n values: [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1],\n metadata: { genre: \"comedy\", year: 2020 },\n },\n {\n id: \"B\",\n values: [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2],\n metadata: { genre: \"documentary\", year: 2019 },\n },\n {\n id: \"C\",\n values: [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],\n metadata: { genre: \"comedy\", year: 2019 },\n },\n {\n id: \"D\",\n values: [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4],", "source": "https://docs.pinecone.io/docs/metadata-filtering"}
{"id": "b05ea8e9b206-5", "text": "metadata: { genre: \"drama\" },\n },\n {\n id: \"E\",\n values: [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5],\n metadata: { genre: \"drama\" },\n },\n ],\n});\ncurl -i -X POST https://YOUR_INDEX-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/vectors/upsert \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"vectors\": [\n {\n \"id\": \"A\",\n \"values\": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1],\n \"metadata\": {\"genre\": \"comedy\", \"year\": 2020}\n },\n {\n \"id\": \"B\",\n \"values\": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2],", "source": "https://docs.pinecone.io/docs/metadata-filtering"}
{"id": "b05ea8e9b206-6", "text": "\"metadata\": {\"genre\": \"documentary\", \"year\": 2019}\n },\n {\n \"id\": \"C\",\n \"values\": [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],\n \"metadata\": {\"genre\": \"comedy\", \"year\": 2019}\n },\n {\n \"id\": \"D\",\n \"values\": [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4],\n \"metadata\": {\"genre\": \"drama\"}\n },\n {\n \"id\": \"E\",\n \"values\": [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5],\n \"metadata\": {\"genre\": \"drama\"}\n }\n ]\n }'", "source": "https://docs.pinecone.io/docs/metadata-filtering"}
{"id": "b05ea8e9b206-7", "text": "Projects on the gcp-starter environment do not support metadata strings containing the character \u0394.\nQuerying an index with metadata filters\nMetadata filter expressions can be included with queries to limit the search to only vectors matching the filter expression.\nFor example, we can search the previous movies index for documentaries from the year 2019. This also uses the include_metadata flag so that vector metadata is included in the response.\n\u26a0\ufe0fWarningFor performance reasons, do not return vector data and metadata when\n\ntop_k>1000. Queries with top_k over 1000 should not contain\n\ninclude_metadata=True or include_data=True.\nPythonJavaScriptindex.query(\n vector=[0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1],\n filter={\n \"genre\": {\"$eq\": \"documentary\"},\n \"year\": 2019\n },\n top_k=1,\n include_metadata=True\n)", "source": "https://docs.pinecone.io/docs/metadata-filtering"}
{"id": "b05ea8e9b206-8", "text": "# Returns:\n# {'matches': [{'id': 'B',\n# 'metadata': {'genre': 'documentary', 'year': 2019.0},\n# 'score': 0.0800000429,\n# 'values': []}],\n# 'namespace': ''}\nconst queryResponse = await index.query({\n vector: [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1],\n filter: { genre: { $in: [\"comedy\", \"documentary\", \"drama\"] } },\n topK: 1,\n includeMetadata: true,\n});\nconsole.log(queryResponse.data);\n// Returns:\n// {'matches': [{'id': 'B',\n// 'metadata': {'genre': 'documentary', 'year': 2019.0},\n// 'score': 0.0800000429,\n// 'values': []}],\n// 'namespace': ''}", "source": "https://docs.pinecone.io/docs/metadata-filtering"}
{"id": "b05ea8e9b206-9", "text": "curlcurl -i -X POST https://YOUR_INDEX-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/query \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"vector\": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1],\n \"filter\": {\"genre\": {\"$in\": [\"comedy\", \"documentary\", \"drama\"]}},\n \"topK\": 1,\n \"includeMetadata\": true\n }'\n\n# Output:\n# {\n# \"matches\": [\n# {\n# \"id\": \"B\",\n# \"score\": 0.0800000429,\n# \"values\": [],\n# \"metadata\": {\n# \"genre\": \"documentary\",\n# \"year\": 2019\n# }\n# }\n# ],\n# \"namespace\": \"\"\n# }\n\nMore example filter expressions\nA comedy, documentary, or drama:\nJSON{\n \"genre\": { \"$in\": [\"comedy\", \"documentary\", \"drama\"] }\n}\n\nA drama from 2020:\nJSON{\n \"genre\": { \"$eq\": \"drama\" },\n \"year\": { \"$gte\": 2020 }\n}", "source": "https://docs.pinecone.io/docs/metadata-filtering"}
{"id": "b05ea8e9b206-10", "text": "A drama from 2020 (equivalent to the previous example):\nJSON{\n \"$and\": [{ \"genre\": { \"$eq\": \"drama\" } }, { \"year\": { \"$gte\": 2020 } }]\n}\n\nA drama or a movie from 2020:\nJSON{\n \"$or\": [{ \"genre\": { \"$eq\": \"drama\" } }, { \"year\": { \"$gte\": 2020 } }]\n}", "source": "https://docs.pinecone.io/docs/metadata-filtering"}
{"id": "b05ea8e9b206-11", "text": "Deleting vectors by metadata filter\nTo specify vectors to be deleted by metadata values, pass a metadata filter expression to the delete operation. This deletes all vectors matching the metadata filter expression.\nProjects in the gcp-starter region do not support deleting by metadata.\nExample\nThis example deletes all vectors with genre \"documentary\" and year 2019 from an index.\nPythonJavaScriptcurlindex.delete(\n filter={\n \"genre\": {\"$eq\": \"documentary\"},\n \"year\": 2019\n }\n)\nawait index._delete({\n filter: {\n genre: { $eq: \"documentary\" },\n year: 2019,\n },\n});\ncurl -i -X POST https://YOUR_INDEX-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/vectors/delete \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"filter\": {\"genre\": {\"$in\": [\"comedy\", \"documentary\", \"drama\"]}}\n }'\nUpdated 4 days ago Query dataUsing namespacesDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/metadata-filtering"}
{"id": "ff471843e1bb-0", "text": "After your data is indexed, you can start sending queries to Pinecone.\nThe Query operation searches the index using a query vector. It retrieves the IDs of the most similar vectors in the index, along with their similarity scores. t can optionally include the result vectors' values and metadata too. You specify the number of vectors to retrieve each time you send a query. They are always ordered by similarity from most similar to least similar.\nThe similarity score for a vector represents its distance to the query vector, calculated according to the distance metric for the index. The significance of the score depends on the similarity metric: for example, for indexes using the euclidean distance metric, scores with lower values are more similar, while for indexes using the dotproduct metric, higher scores are more similar.\nSending a query\nWhen you send a query, you provide a vector and retrieve the top-k most similar vectors for each query. For example, this example sends a query vector and retrieves three matching vectors:\nPythonJavaScriptcurlindex.query(\n vector=[0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],\n top_k=3,\n include_values=True\n)", "source": "https://docs.pinecone.io/docs/query-data"}
{"id": "ff471843e1bb-1", "text": "# Returns:\n# {'matches': [{'id': 'C',\n# 'score': -1.76717265e-07,\n# 'values': [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]},\n# {'id': 'B',\n# 'score': 0.080000028,\n# 'values': [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]},\n# {'id': 'D',\n# 'score': 0.0800001323,\n# 'values': [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]}],\n# 'namespace': ''}\nconst index = pinecone.index(\"example-index\");\nconst queryResponse = await Index.query({\n query: {\n vector: [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],", "source": "https://docs.pinecone.io/docs/query-data"}
{"id": "ff471843e1bb-2", "text": "topK: 3,\n includeValues: true,\n },\n namespace: \"example-namespace\",\n});\n// Returns:\n// {'matches': [{'id': 'C',\n// 'score': -1.76717265e-07,\n// 'values': [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]},\n// {'id': 'B',\n// 'score': 0.080000028,\n// 'values': [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]},\n// {'id': 'D',\n// 'score': 0.0800001323,\n// 'values': [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]}],\n// 'namespace': ''}\ncurl -i -X POST https://hello-pinecone-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/query \\\n -H 'Api-Key: YOUR_API_KEY' \\", "source": "https://docs.pinecone.io/docs/query-data"}
{"id": "ff471843e1bb-3", "text": "-H 'Content-Type: application/json' \\\n -d '{\n \"vector\":[0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],\n \"topK\": 3,\n \"includeValues\": true\n }'", "source": "https://docs.pinecone.io/docs/query-data"}
{"id": "ff471843e1bb-4", "text": "# Output:\n# {\n# \"matches\":[\n# {\n# \"id\": \"C\",\n# \"score\": -1.76717265e-07,\n# \"values\": [0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3]\n# },\n# {\n# \"id\": \"B\",\n# \"score\": 0.080000028,\n# \"values\": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]\n# },\n# {\n# \"id\": \"D\",\n# \"score\": 0.0800001323,\n# \"values\": [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]\n# }\n# ],\n# \"namespace\": \"\"\n# }", "source": "https://docs.pinecone.io/docs/query-data"}
{"id": "ff471843e1bb-5", "text": "Depending on your data and your query, you may not get top_k results. This happens when top_k is larger than the number of possible matching vectors for your query.\nQuerying by namespace\nYou can organize the vectors added to an index into partitions, or \"namespaces,\" to limit queries and other vector operations to only one such namespace at a time. For more information, see: Namespaces.\nUsing metadata filters in queries\nYou can add metadata to document embeddings within Pinecone, and then filter for those criteria when sending the query. Pinecone will search for similar vector embeddings only among those items that match the filter. For more information, see: Metadata Filtering.\nPythonJavaScriptcurlindex.query(\n vector=[0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1],\n filter={\n \"genre\": {\"$eq\": \"documentary\"},\n \"year\": 2019\n },\n top_k=1,\n include_metadata=True\n)\nconst index = pinecone.index(\"example-index\")\nconst queryResponse = await index.query({\n query: {\n vector: [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1],", "source": "https://docs.pinecone.io/docs/query-data"}
{"id": "ff471843e1bb-6", "text": "topK: 1,\n includeMetadata: true\n filters: {\n \"genre\": {\"$eq\": \"documentary\"}\n },\n }\n})", "source": "https://docs.pinecone.io/docs/query-data"}
{"id": "ff471843e1bb-7", "text": "curl -i -X POST https://YOUR_INDEX-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/query \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"vector\": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1],\n \"filter\": {\"genre\": {\"$in\": [\"comedy\", \"documentary\", \"drama\"]}},\n \"topK\": 1,\n \"includeMetadata\": true\n }'\n\nQuerying vectors with sparse and dense values\nWhen querying an index containing sparse and dense vectors, use the query() operation with the sparse_vector parameter present.\n\u26a0\ufe0fWarningThe Update operation does not validate the existence of ids within an\n\nindex. If a non-existent id is given then no changes are made and a 200 OK", "source": "https://docs.pinecone.io/docs/query-data"}
{"id": "ff471843e1bb-8", "text": "will be returned.\nExamples\nThe following example queries the index example-index with a sparse-dense vector.\nPythoncurlquery_response = index.query(\n namespace=\"example-namespace\",\n top_k=10,\n vector=[0.1, 0.2, 0.3, 0.4],\n sparse_vector={\n 'indices': [10, 45, 16],\n 'values': [0.5, 0.5, 0.2]\n }\n)\ncurl --request POST \\\n --url https://index_name-project_id.svc.environment.pinecone.io/query \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --data '\n{\n \"includeValues\": \"false\",\n \"includeMetadata\": \"false\",\n \"vector\": [\n 0.1,\n 0.2,\n 0.3,\n 0.4\n ],\n \"sparseVector\": {\n \"indices\": [\n 10,\n 45,\n 16\n ],\n \"values\": [\n 0.5,\n 0.5,\n 0.2\n ]\n },\n \"topK\": 10,\n \"namespace\": \"example-namespace\"\n}\n'", "source": "https://docs.pinecone.io/docs/query-data"}
{"id": "ff471843e1bb-9", "text": "Limitations\nAvoid returning vector data and metadata when top_k is greater than 1000. This means queries with top_k over 1000 should not contain include_metadata=True or include_data=True. For more limitations, see: Limits.Updated 5 days ago Sparse-dense embeddingsFiltering with metadataDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/query-data"}
{"id": "089cf6017e8f-0", "text": "In addition to inserting and querying data, there are other ways you can interact with vector data in a Pinecone index. This section walks through the various vector operations available.\n\nConnect to an index\nIf you're using a Pinecone client library to access an index, you'll need to open a session with the index:\nPythonJavaScriptcurl# Connect to the index\nindex = pinecone.Index(\"pinecone-index\")\nconst index = pinecone.Index(\"pinecone-index\");\n# Not applicable\n\nSpecify an index endpoint\nPinecone indexes each have their own DNS endpoint. For cURL and other direct\n\nAPI calls to a Pinecone index, you'll need to know the dedicated endpoint for\n\nyour index.\nIndex endpoints take the following form:\nhttps://{index-name}-{project-name}.svc.YOUR_ENVIRONMENT.pinecone.io\n\n{index-name} is the name you gave your index when you created it.\n{project-name} is the Pinecone project name that your API key is associated\n\nwith. This can be retrieved using the whoami operation below.\nYOUR_ENVIRONMENT is the cloud region for your Pinecone project..\n\nCall whoami to retrieve your project name.\nThe following command retrieves your Pinecone project name.\nPythoncurlpinecone.whoami()\ncurl -i https://controller.YOUR_ENVIRONMENT.pinecone.io/actions/whoami -H 'Api-Key: YOUR_API_KEY'", "source": "https://docs.pinecone.io/docs/manage-data"}
{"id": "089cf6017e8f-1", "text": "Describe index statistics\nGet statistics about an index, such as vector count per namespace:\nPythonJavaScriptcurlindex.describe_index_stats()\nconst index = pinecone.Index(\"pinecone-index\");\nconst indexStats = await index.describeIndexStats();\nconsole.log(indexStats.data);\ncurl -i -X GET https://YOUR_INDEX-PROJECT_NAME.svc.YOUR_ENVIRONMENT.pinecone.io/describe_index_stats \\\n -H 'Api-Key: YOUR_API_KEY'\n\nFetching vectors\nThe Fetch operation looks up and returns vectors, by id, from an index. The returned vectors include the vector data and/or metadata. Typical fetch latency is under 5ms.\nFetch items by their ids:\nPythonJavaScriptcurlindex.fetch([\"id-1\", \"id-2\"])", "source": "https://docs.pinecone.io/docs/manage-data"}
{"id": "089cf6017e8f-2", "text": "# Returns:\n# {'namespace': '',\n# 'vectors': {'id-1': {'id': 'id-1',\n# 'values': [0.568879, 0.632687092, 0.856837332, ...]},\n# 'id-2': {'id': 'id-2',\n# 'values': [0.00891787093, 0.581895, 0.315718859, ...]}}}\nconst fetchedVectors = await index.fetch([\"id-1\", \"id-2\"]);\n// Returns:\n// {'namespace': '',\n// 'vectors': {'id-1': {'id': 'id-1',\n// 'values': [0.568879, 0.632687092, 0.856837332, ...]},\n// 'id-2': {'id': 'id-2',\n// 'values': [0.00891787093, 0.581895, 0.315718859, ...]}}}\ncurl -i -X GET \"https://YOUR_INDEX-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/vectors/fetch?ids=id-1&ids=id-2\" \\\n -H 'Api-Key: YOUR_API_KEY'\n# Output:\n# {\n# \"vectors\": {", "source": "https://docs.pinecone.io/docs/manage-data"}
{"id": "089cf6017e8f-3", "text": "# \"vectors\": {\n# \"id-1\": {\n# \"id\": \"id-1\",\n# \"values\": [0.568879, 0.632687092, 0.856837332, ...]\n# },\n# \"id-2\": {\n# \"id\": \"id-2\",\n# \"values\": [0.00891787093, 0.581895, 0.315718859, ...]\n# }\n# },\n# \"namespace\": \"\"\n# }", "source": "https://docs.pinecone.io/docs/manage-data"}
{"id": "089cf6017e8f-4", "text": "Updating vectors\nThere are two methods for updating vectors and metadata, using full or partial updates.\nFull update\nFull updates modify the entire item, that is vectors and metadata. Updating an item by id is done the same way as inserting items. (Write operations in Pinecone are idempotent.)\nThe Upsert operation writes vectors into an index.\n\u2139\ufe0fNoteIf a new value is upserted for an existing vector id, it will overwrite the\n\nprevious value.\n\nUpdate the value of the item (\"id-3\", [3.3, 3.3]):\n\nPythonJavaScriptcurlindex.upsert([(\"id-3\", [3.3, 3.3])])\nawait index.upsert({\n vectors: [\n {\n id: \"id-0\",\n values: [3.3, 3.3],\n },\n ],\n});\ncurl -i -X POST https://YOUR_INDEX-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/vectors/upsert \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"vectors\": [\n {\n \"id\": \"id-0\",\n \"values\": [3.3, 3.3]\n }\n ]\n }'\n\n\nFetch the item again. We should get (\"id-3\", [3.3, 3.3]):", "source": "https://docs.pinecone.io/docs/manage-data"}
{"id": "089cf6017e8f-5", "text": "PythonJavaScriptcurlindex.fetch([\"id-3\"])\nconst fetchedVectors = await index.fetch([\"id-3\"]);\ncurl -i -X GET https://YOUR_INDEX-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/vectors/fetch?ids=id-3 \\\n -H 'Api-Key: YOUR_API_KEY'\n\nPartial update\nThe Update operation performs partial updates that allow changes to part of an item. Given an id, we can update the vector value with the values argument or update metadata with the set_metadata argument.\n\u26a0\ufe0fWarningThe Update operation does not validate the existence of ids within an\n\nindex. If a non-existent id is given then no changes are made and a 200 OK", "source": "https://docs.pinecone.io/docs/manage-data"}
{"id": "089cf6017e8f-6", "text": "will be returned.\nTo update the value of item (\"id-3\", [3., 3.], {\"type\": \"doc\", \"genre\": \"drama\"}):\nPythonJavaScriptcurlindex.update(id=\"id-3\", values=[4., 2.])\nawait index.update({\n id: \"id-3\",\n values: [4, 2],\n});\ncurl -i -X POST https://YOUR_INDEX-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/vectors/update \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"id\": \"id-3\",\n \"values\": [\n 3.3,\n 3.3\n ]\n }'\n\nThe updated item would now be (\"id-3\", [4., 2.], {\"type\": \"doc\", \"genre\": \"drama\"}).\nWhen updating metadata only specified fields will be modified. If a specified field does not exist, it is added.\n\u2139\ufe0fNoteMetadata updates apply only to fields passed to the set_metadata", "source": "https://docs.pinecone.io/docs/manage-data"}
{"id": "089cf6017e8f-7", "text": "argument. Any other fields will remain unchanged.\nTo update the metadata of item (\"id-3\", [4., 2.], {\"type\": \"doc\", \"genre\": \"drama\"}):\nPythonJavaScriptcurlindex.update(id=\"id-3\", set_metadata={\"type\": \"web\", \"new\": \"true\"})\nawait index.update({\n id: \"id-3\",\n setMetadata: {\n type: \"web\",\n new: \"true\",\n },\n});\ncurl -i -X POST https://YOUR_INDEX-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/vectors/update \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"id\": \"id-3\",\n \"setMetadata\": {\n \"type\": \"web\",\n \"new\": \"true\"\n }\n }'", "source": "https://docs.pinecone.io/docs/manage-data"}
{"id": "089cf6017e8f-8", "text": "The updated item would now be (\"id-3\", [4., 2.], {\"type\": \"web\", \"genre\": \"drama\", \"new\": \"true\"}).\nBoth vector and metadata can be updated at once by including both values and set_metadata arguments. To update the \"id-3\" item we write:\nPythonJavaScriptcurlindex.update(id=\"id-3\", values=[1., 2.], set_metadata={\"type\": \"webdoc\"})\nawait index.update({\n id: \"id-3\",\n values: [1, 2],\n setMetadata: {\n type: \"webdoc\",\n },\n});\ncurl -i -X POST https://YOUR_INDEX-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/vectors/update \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"id\": \"id-3\",\n \"values\": [1., 2.],\n \"set_metadata\": {\"type\": \"webdoc\"}\n }\n }'", "source": "https://docs.pinecone.io/docs/manage-data"}
{"id": "089cf6017e8f-9", "text": "The updated item would now be (\"id-3\", [1., 2.], {\"type\": \"webdoc\", \"genre\": \"drama\", \"new\": \"true\"}).\nDeleting vectors\nThe Delete operation deletes vectors, by ID, from an index.\nAlternatively, it can also delete all vectors from an index or namespace.\nWhen deleting large numbers of vectors, limit the scope of delete operations to hundreds of vectors per operation.\nInstead of deleting all vectors in an index, delete the index and recreate it.\nDelete vectors by ID\nTo delete vectors by their IDs, specify an ids parameter to delete. The ids parameter is an array of strings containing vector IDs.\nExample\nPythonJavaScriptcurlindex.delete(ids=[\"id-1\", \"id-2\"], namespace='example-namespace')\nawait index.delete1([\"id-1\", \"id-2\"], false, \"example-namespace\");\ncurl -i -X DELETE \"https://YOUR_INDEX-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io.pinecone.io/vectors/delete?ids=id-1&ids=id-2&namespace=example-namespace\" \\\n -H 'Api-Key: YOUR_API_KEY'\n\nDelete vectors by namespace\nTo delete all vectors from a namespace, specify deleteAll='true' and provide a\n\nnamespace parameter.\n\u2139\ufe0fNoteIf you delete all vectors from a single namespace, it will also delete the", "source": "https://docs.pinecone.io/docs/manage-data"}
{"id": "089cf6017e8f-10", "text": "namespace.\nProjects on the gcp-starter environment do not support the deleteAll parameter.\nExample:\nPythonJavaScriptcurlindex.delete(deleteAll='true', namespace='example-namespace')\nawait index.delete1([], true, \"example-namespace\");\ncurl -i -X DELETE \"https://YOUR_INDEX-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/vectors/delete?deleteAll=true&namespace=example-namespace\" \\\n -H 'Api-Key: YOUR_API_KEY'\n\nDelete vectors by metadata\nTo delete vectors by metadata, pass a metadata filter expression to the delete operation.Updated 19 days ago Insert dataSparse-dense embeddingsDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/manage-data"}
{"id": "b55bd8ef143b-0", "text": "After creating a Pinecone index, you can start inserting vector embeddings and metadata into the index.\n\nInserting the vectors\n\nConnect to the index:\n\nPythoncurlindex = pinecone.Index(\"pinecone-index\")\n# Not applicable\n\n\nInsert the data as a list of (id, vector) tuples. Use the Upsert operation to write vectors into a namespace:", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "b55bd8ef143b-1", "text": "PythonJavaScriptcurl# Insert sample data (5 8-dimensional vectors)\nindex.upsert([\n (\"A\", [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]),\n (\"B\", [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]),\n (\"C\", [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]),\n (\"D\", [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]),\n (\"E\", [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5])\n])\nindex.upsert({\n vectors: [\n {\n id: \"A\",", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "b55bd8ef143b-2", "text": "{\n id: \"A\",\n values: [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1],\n },\n {\n id: \"B\",\n values: [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2],\n },\n {\n id: \"C\",\n values: [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],\n },\n {\n id: \"D\",\n values: [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4],\n },\n {\n id: \"E\",\n values: [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5],\n },\n ],\n});", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "b55bd8ef143b-3", "text": "},\n ],\n});\ncurl -i -X POST https://YOUR_INDEX-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/vectors/upsert \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"vectors\": [\n {\n \"id\": \"A\",\n \"values\": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]\n },\n {\n \"id\": \"B\",\n \"values\": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]\n },\n {\n \"id\": \"C\",\n \"values\": [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]\n },\n {\n \"id\": \"D\",", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "b55bd8ef143b-4", "text": "\"id\": \"D\",\n \"values\": [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]\n },\n {\n \"id\": \"E\",\n \"values\": [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5]\n }\n ]\n }'", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "b55bd8ef143b-5", "text": "Immediately after the upsert response is received, vectors may not be visible to queries yet. In most situations, you can check if the vectors have been received by checking for the vector counts returned by describe_index_stats() to be updated. This technique may not work if the index has multiple replicas. The database is eventually consistent.\nBatching upserts\nFor clients upserting larger amounts of data, you should insert data into an index in batches of 100 vectors or fewer over multiple upsert requests.\nExample\nPythonimport random\nimport itertools\n\ndef chunks(iterable, batch_size=100):\n \"\"\"A helper function to break an iterable into chunks of size batch_size.\"\"\"\n it = iter(iterable)\n chunk = tuple(itertools.islice(it, batch_size))\n while chunk:\n yield chunk\n chunk = tuple(itertools.islice(it, batch_size))\n\nvector_dim = 128\nvector_count = 10000\n\n# Example generator that generates many (id, vector) pairs\nexample_data_generator = map(lambda i: (f'id-{i}', [random.random() for _ in range(vector_dim)]), range(vector_count))\n\n# Upsert data with 100 vectors per upsert request\nfor ids_vectors_chunk in chunks(example_data_generator, batch_size=100):\n index.upsert(vectors=ids_vectors_chunk) # Assuming `index` defined elsewhere", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "b55bd8ef143b-6", "text": "Sending upserts in parallel\nBy default, all vector operations block until the response has been received. But using our client they can be made asynchronous. For the Batching Upserts example this can be done as follows:\nPythonShell# Upsert data with 100 vectors per upsert request asynchronously\n# - Create pinecone.Index with pool_threads=30 (limits to 30 simultaneous requests)\n# - Pass async_req=True to index.upsert()\nwith pinecone.Index('example-index', pool_threads=30) as index:\n # Send requests in parallel\n async_results = [\n index.upsert(vectors=ids_vectors_chunk, async_req=True)\n for ids_vectors_chunk in chunks(example_data_generator, batch_size=100)\n ]\n # Wait for and retrieve responses (this raises in case of error)\n [async_result.get() for async_result in async_results]\n# Not applicable", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "b55bd8ef143b-7", "text": "Pinecone is thread-safe, so you can launch multiple read requests and multiple write requests in parallel. Launching multiple requests can help with improving your throughput. However, reads and writes can\u2019t be performed in parallel, therefore writing in large batches might affect query latency and vice versa.\nIf you experience slow uploads, see Performance tuning for advice.\nPartitioning an index into namespaces\nYou can organize the vectors added to an index into partitions, or \"namespaces,\" to limit queries and other vector operations to only one such namespace at a time. For more information, see: Namespaces.\nInserting vectors with metadata\nYou can insert vectors that contain metadata as key-value pairs.\nYou can then use the metadata to filter for those criteria when sending the query. Pinecone will search for similar vector embeddings only among those items that match the filter. For more information, see: Metadata Filtering.\nPythonJavaScriptcurlindex.upsert([\n (\"A\", [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1], {\"genre\": \"comedy\", \"year\": 2020}),", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "b55bd8ef143b-8", "text": "(\"B\", [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2], {\"genre\": \"documentary\", \"year\": 2019}),\n (\"C\", [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3], {\"genre\": \"comedy\", \"year\": 2019}),\n (\"D\", [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4], {\"genre\": \"drama\"}),\n (\"E\", [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], {\"genre\": \"drama\"})\n])\nawait index.upsert({\n vectors: [\n {\n id: \"A\",\n values: [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1],", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "b55bd8ef143b-9", "text": "metadata: { genre: \"comedy\", year: 2020 },\n },\n {\n id: \"B\",\n values: [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2],\n metadata: { genre: \"documentary\", year: 2019 },\n },\n {\n id: \"C\",\n values: [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],\n metadata: { genre: \"comedy\", year: 2019 },\n },\n {\n id: \"D\",\n values: [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4],\n metadata: { genre: \"drama\" },\n },\n {\n id: \"E\",\n values: [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5],", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "b55bd8ef143b-10", "text": "metadata: { genre: \"drama\" },\n },\n ],\n});\ncurl -i -X POST https://YOUR_INDEX-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/vectors/upsert \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"vectors\": [\n {\n \"id\": \"A\",\n \"values\": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1],\n \"metadata\": {\"genre\": \"comedy\", \"year\": 2020}\n },\n {\n \"id\": \"B\",\n \"values\": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2],\n \"metadata\": {\"genre\": \"documentary\", \"year\": 2019}\n },\n {\n \"id\": \"C\",\n \"values\": [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "b55bd8ef143b-11", "text": "\"metadata\": {\"genre\": \"comedy\", \"year\": 2019}\n },\n {\n \"id\": \"D\",\n \"values\": [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4],\n \"metadata\": {\"genre\": \"drama\"}\n },\n {\n \"id\": \"E\",\n \"values\": [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5],\n \"metadata\": {\"genre\": \"drama\"}\n }\n ]\n }'", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "b55bd8ef143b-12", "text": "Upserting vectors with sparse values\nSparse vector values can be upserted alongside dense vector values.\nPythoncurl index = pinecone.Index('example-index')", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "b55bd8ef143b-13", "text": "upsert_response = index.upsert(\n vectors=[\n {'id': 'vec1',\n 'values': [0.1, 0.2, 0.3, 0.4],\n 'metadata': {'genre': 'drama'},\n 'sparse_values': {\n 'indices': [10, 45, 16],\n 'values': [0.5, 0.5, 0.2]\n }},\n {'id': 'vec2',\n 'values': [0.2, 0.3, 0.4, 0.5],\n 'metadata': {'genre': 'action'},\n 'sparse_values': {\n 'indices': [15, 40, 11],\n 'values': [0.4, 0.5, 0.2]\n }}\n ],\n namespace='example-namespace'\n)\ncurl --request POST \\\n --url https://index_name-project_id.svc.environment.pinecone.io/vectors/upsert \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --data '\n{\n \"vectors\": [\n {\n \"values\": [\n 0.1,\n 0.2,", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "b55bd8ef143b-14", "text": "0.2,\n 0.3,\n 0.4\n ],\n \"sparseValues\": {\n \"indices\": [\n 10,\n 45,\n 16\n ],\n \"values\": [\n 0.4,\n 0.5,\n 0.2\n ]\n },\n \"id\": \"vec1\"\n },\n {\n \"values\": [\n 0.2,\n 0.3,\n 0.4,\n 0.5\n ],\n \"sparseValues\": {\n \"indices\": [\n 15,\n 40,\n 11\n ],\n \"values\": [\n 0.4,\n 0.5,\n 0.2\n ]\n },\n \"id\": \"vec2\"\n }\n ]\n}\n'", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "b55bd8ef143b-15", "text": "Limitations\nThe following limitations apply to upserting sparse vectors:\n\nYou cannot upsert sparse vector values without a dense vector values.\nOnly s1 and p1 pod types using the dotproduct metric support querying sparse vectors. There is no error at upsert time: if you attempt to query any other pod type using sparse vectors, Pinecone returns an error.\nYou can only upsert sparse vector values of sizes up to 1000 non-zero values.\nIndexes created before February 22, 2023 do not support sparse values.\n\nTroubleshooting index fullness errors\nWhen upserting data, you may receive the following error:\nconsoleIndex is full, cannot accept data.\n\nNew upserts may fail as the capacity becomes exhausted. While your index can still serve queries, you need to scale your environment to accommodate more vectors.\nTo resolve this issue, you can scale your index.Updated about 1 month ago Back up indexesManage dataDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/insert-data"}
{"id": "e26508dec703-0", "text": "Overview\nThis document describes how to make backup copies of your indexes using collections.\nTo learn how to create an index from a collection, see Manage indexes.\n\u26a0\ufe0fWarningThis document uses collections. This is a public preview\n\nfeature. Test thoroughly before using this feature with production workloads.\nCreate a backup using a collection\nTo create a backup of your index, use the create_collection operation. A collection is a static copy of your index that only consumes storage.\nExample\nThe following example creates a collection named example-collection from an index named example-index.\nPythonJavaScriptcurlpinecone.create_collection(\"example-collection\", \"example-index\")\nawait pinecone.createCollection({\n name: \"example-collection\",\n source: \"example-index\",\n});\ncurl -i -X POST https://controller.us-west1-gcp.pinecone.io/collections \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"example-collection\",\n \"source\": \"example-index\"\n }'", "source": "https://docs.pinecone.io/docs/back-up-indexes"}
{"id": "e26508dec703-1", "text": "Check the status of a collection\nTo retrieve the status of the process creating a collection and the size of the collection, use the describe_collection operation. Specify the name of the collection to check. You can only call describe_collection on a collection in the current project.\nThe describe_collection operation returns an object containing key-value pairs representing the name of the collection, the size in bytes, and the creation status of the collection.\nExample\nThe following example gets the creation status and size of a collection named example-collection.\nPythonJavaScriptcurlpinecone.describe_collection(\"example-collection\")\nconst collectionDescription = await pinecone.describeCollection(\n \"example-collection\"\n);\nconsole.log(collectionDescription.data);\ncurl -i -X GET https://controller.us-west1-gcp.pinecone.io/collections/example-collection \\\n -H 'Api-Key: YOUR_API_KEY'\n\nResults:\nShellCollectionDescription(name='test-collection', size=3818809, status='Ready')\n\nList your collections\nTo get a list of the collections in the current project, use the list_collections operation.\nExample\nThe following example gets a list of all collections in the current project.\nPythonJavaScriptcurlpinecone.list_collections()\nconst collections = await pinecone.listCollections();\nconsole.log(collections.data);\ncurl -i -X GET https://controller.us-west1-gcp.pinecone.io/collections \\\n -H 'Api-Key: YOUR_API_KEY'\n\nResults\nShellexample-collection", "source": "https://docs.pinecone.io/docs/back-up-indexes"}
{"id": "e26508dec703-2", "text": "Results\nShellexample-collection\n\nDelete a collection\nTo delete a collection, use the delete_collection operation. Specify the name of the collection to delete.\nDeleting the collection takes several minutes. During this time, the describe_collection operation returns the status \"deleting\".\nExample\nThe following example deletes the collection example-collection.\nPythonJavaScriptcurlpinecone.delete_collection(\"example-collection\")\nawait pinecone.deleteCollection(\"example-collection\");\ncurl -i -X DELETE https://controller.us-west1-gcp.pinecone.io/collections/example-collection \\\n -H 'Api-Key: YOUR_API_KEY'\nUpdated about 1 month ago Understanding collectionsInsert dataDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/back-up-indexes"}
{"id": "3d66538aad8c-0", "text": "In this topic, we explain how you can scale your indexes horizontally and vertically.\nProjects in the gcp-starter environment do not support the features referred to here, including pods, replicas, and collections.\nVertical vs. horizontal scaling\nIf you need to scale your environment to accommodate more vectors, you can modify your existing index to scale it vertically or create a new index and scale horizontally. This article will describe both methods and how to scale your index effectively. \nVertical scaling\nScaling vertically is fast and involves no downtime. This is a good choice when you can't pause upserts and must continue serving traffic. It also allows you to double your capacity instantly. However, there are some factors to consider.\nBy changing the pod size, you can scale to x2, x4, and x8 pod sizes, which means you are doubling your capacity at each step. Moving up to a new capacity will effectively double the number of pods used at each step. If you need to scale by smaller increments, then consider horizontal scaling. \nThe number of base pods you specify when you initially create the index is static and cannot be changed. For example, if you start with 10 pods of p1.x1 and vertically scale to p1.x2, this equates to 20 pods worth of usage. Neither can you change pod types with vertical scaling. If you want to change your pod type while scaling, then horizontal scaling is the better option.", "source": "https://docs.pinecone.io/docs/scaling-indexes"}
{"id": "3d66538aad8c-1", "text": "You can only scale index sizes up and cannot scale them back down.\nSee our learning center for more information on vertical scaling.\nHorizontal scaling\nThere are two approaches to horizontal scaling in Pinecone: adding pods and adding replicas. Adding pods increases all resources but requires a pause in upserts; adding replicas only increases throughput and requires no pause in upserts.\nAdding pods\nAdding pods to an index increases all resources, including available capacity. Adding pods to an existing index is possible using our collections feature. A collection is an immutable snapshot of your index in time: a collection stores the data but not the original index definition.\nWhen you create an index from a collection, you define the new index configuration. This allows you to scale the base pod count horizontally without scaling vertically. The main advantage of this approach is that you can scale incrementally instead of doubling capacity as with vertical scaling. Also, you can redefine pod types if you are experimenting or if you need to use a different pod type, such asperformance-optimized pods or storage-optimized pods. Another advantage of this method is that you can change your metadata configuration to redefine metadata fields as indexed or stored-only. This is important when tuning your index for the best throughput. \nHere are the general steps to make a copy of your index and create a new index while changing the pod type, pod count, metadata configuration, replicas, and all typical parameters when creating a new collection:", "source": "https://docs.pinecone.io/docs/scaling-indexes"}
{"id": "3d66538aad8c-2", "text": "Pause upserts.\nCreate a collection from the current index.\nCreate an index from the collection with new parameters.\nContinue upserts to the newly created index. Note: the URL has likely changed.\nDelete the old index if desired.\n\nAdding replicas\nEach replica duplicates the resources and data in an index. This means that adding additional replicas increases the throughput of the index but not its capacity. However, adding replicas does not require downtime.\nThroughput in terms of queries per second (QPS) scales linearly with the number of replicas per index.\nTo add replicas, use the configure_index operation to increase the number of replicas for your index.\nNext steps\n\nSee our learning center for more information on vertical scaling.\nLearn more about collections.\nUpdated about 1 month ago Manage indexesUnderstanding collectionsDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/scaling-indexes"}
{"id": "15c98f511782-0", "text": "In this section, we explain how you can get a list of your indexes, create an index, delete an index, and describe an index.\nTo learn about the concepts related to indexes, see Indexes.\n\u26a0\ufe0fWarningIndexes on the Starter (free) plan are deleted after 7 days of inactivity. To\n\nprevent this, send any API request or log into the console. This will count\n\nas activity.\n\nGetting information on your indexes\nList all your Pinecone indexes:\nPythonJavaScriptcurlpinecone.list_indexes()\nawait pinecone.listIndexes();\ncurl -i https://controller.YOUR_ENVIRONMENT.pinecone.io/databases \\\n -H 'Api-Key: YOUR_API_KEY'\n\nGet the configuration and current status of an index named \"pinecone-index\":\nPythonJavaScriptcurlpinecone.describe_index(\"pinecone-index\")\nawait pinecone.describeIndex(indexName);\ncurl -i -X GET https://controller.YOUR_ENVIRONMENT.pinecone.io/databases/example-index \\\n -H 'Api-Key: YOUR_API_KEY'", "source": "https://docs.pinecone.io/docs/manage-indexes"}
{"id": "15c98f511782-1", "text": "Creating an index\nThe simplest way to create an index is as follows. This gives you an index with a single pod that will perform approximate nearest neighbor (ANN) search using cosine similarity:\nPythonJavaScriptcurlpinecone.create_index(\"example-index\", dimension=128)\nawait pinecone.createIndex({\n name: \"example-index\",\n dimension: 128,\n});\ncurl -i -X POST https://controller.YOUR_ENVIRONMENT.pinecone.io/databases \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"example-index\",\n \"dimension\": 128\n }'", "source": "https://docs.pinecone.io/docs/manage-indexes"}
{"id": "15c98f511782-2", "text": "A more complex index can be created as follows. This creates an index that measures similarity by Euclidean distance and runs on 4 s1 (storage-optimized) pods of size x1:\nPythonJavaScriptcurlpinecone.create_index(\"example-index\", dimension=128, metric=\"euclidean\", pods=4, pod_type=\"s1.x1\")\nawait pinecone.createIndex({\n name: \"example-index\",\n dimension: 128,\n metric: \"euclidean\",\n pods: 4,\n podType: \"s1.x1\",\n});\ncurl -i -X POST https://controller.YOUR_ENVIRONMENT.pinecone.io/databases \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"example-index\",\n \"dimension\": 128,\n \"metric\": \"euclidean\",\n \"pods\": 4,\n \"pod_type\": \"p1.x1\"\n }'", "source": "https://docs.pinecone.io/docs/manage-indexes"}
{"id": "15c98f511782-3", "text": "Create an index from a collection\nTo create an index from a collection, use the create_index operation and provide a source_collection parameter containing the name of the collection from which you wish to create an index. The new index is queryable and writable.\nCreating an index from a collection generally takes about 10 minutes. Creating a p2 index from a collection can take several hours when the number of vectors is on the order of 1M.\nExample\nThe following example creates an index named example-index with 128 dimensions from a collection named example-collection.\nPythonJavaScriptcurlpinecone.create_index(\"example-index\", dimension=128, source_collection=\"example-collection\")\nawait pinecone.createIndex({\n name: \"example-index\",\n dimension: 128,\n sourceCollection: \"example-collection\",\n});\ncurl -i -X POST https://controller.us-west1-gcp.pinecone.io/databases \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"example-index\",\n \"source_collection\":\"example-collection\"}\n }'", "source": "https://docs.pinecone.io/docs/manage-indexes"}
{"id": "15c98f511782-4", "text": "For more information about each pod type and size, see Indexes.\nFor the full list of parameters available to customize an index, see the create_index API reference.\nChanging pod sizes\nThe default pod size is x1. After index creation, you can increase the pod size for an index.\nIncreasing the pod size of your index does not result in downtime. Reads and writes continue uninterrupted during the scaling process. Currently, you cannot reduce the pod size of your indexes. Your number of replicas and your total number of pods remain the same, but each pod changes size. Resizing completes in about 10 minutes.\nTo learn more about pod sizes, see Indexes.\nIncreasing the pod size for an index\nTo change the pod size of an existing index, use the configure_index operation and append the new size to the pod_type parameter, separated by a period (.).\nProjects in the gcp-starter environment do not use pods.\nExample\nThe following example assumes that my_index has size x1 and changes the size to x2.\nPythonJavaScriptcurlpinecone.configure_index(\"my_index\", pod_type=\"s1.x2\")\nawait client.configureIndex(\"my_index\", {\n pod_type: \"s1.x2\",\n});\ncurl -i -X PATCH https://controller.us-west1-gcp.pinecone.io/databases/example-index \\\n -H 'Api-Key: YOUR_API_KEY' \\", "source": "https://docs.pinecone.io/docs/manage-indexes"}
{"id": "15c98f511782-5", "text": "-H 'Content-Type: application/json' \\\n -d '{\n \"pod_type\": \"s1.x2\"\n }\n }'", "source": "https://docs.pinecone.io/docs/manage-indexes"}
{"id": "15c98f511782-6", "text": "Checking the status of a pod size change\nTo check the status of a pod size change, use the describe_index operation. The status field in the results contains the key-value pair \"state\":\"ScalingUp\" or \"state\":\"ScalingDown\" during the resizing process and the key-value pair \"state\":\"Ready\" after the process is complete.\nThe index fullness metric provided by describe_index_stats may be inaccurate until the resizing process is complete.\nExample\nThe following example uses describe_index to get the index status of the index example-index. The status field contains the key-value pair \"state\":\"ScalingUp\", indicating that the resizing process is still ongoing.\nPythonJavaScriptcurlpinecone.describe_index(\"example-index\")\nawait pinecone.describeIndex({\n name: \"example-index\",\n});\ncurl -i -X GET https://controller.us-west1-gcp.pinecone.io/databases/example-index \\\n -H 'Api-Key: YOUR_API_KEY'\n\nResults:\nJSON{\n \"database\": {\n \"name\": \"example-index\",\n \"dimensions\": \"768\",\n \"metric\": \"cosine\",\n \"pods\": 6,\n \"replicas\": 2,\n \"shards\": 3,\n \"pod_type\": \"p1.x2\",\n \"index_config\": {},\n \"status\": {\n \"ready\": true,\n \"state\": \"ScalingUp\"\n }\n }\n}", "source": "https://docs.pinecone.io/docs/manage-indexes"}
{"id": "15c98f511782-7", "text": "Replicas\nYou can increase the number of replicas for your index to increase throughput (QPS). All indexes start with replicas=1.\nIndexes in the gcp-starter environment do not support replicas.\nExample\nThe following example uses the configure_index operation to set the number of replicas for the index example-index to 4.\nPythonJavaScriptcurlpinecone.configure_index(\"example-index\", replicas=4)\nawait pinecone.configureIndex(\"example-index\", {\n replicas: 4,\n});\ncurl -i -X PATCH https://controller.us-west1-gcp.pinecone.io/databases/example-index \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"replicas\": 4\n }'", "source": "https://docs.pinecone.io/docs/manage-indexes"}
{"id": "15c98f511782-8", "text": "See the configure_index API reference for more details.\nSelective metadata indexing\nBy default, Pinecone indexes all metadata. When you index metadata fields, you can filter vector search queries using those fields. When you store metadata fields without indexing them, you keep memory utilization low, especially when you have many unique metadata values, and therefore can fit more vectors per pod.\nSearches without metadata filters do not consider metadata. To combine keywords with semantic search, see sparse-dense embeddings.\nWhen you create a new index, you can specify which metadata fields to index using the metadata_config parameter. Projects on the gcp-starter environment do not support the metadata_config parameter.\nExample\nPythonJavaScriptcurlmetadata_config = {\n \"indexed\": [\"metadata-field-name\"]\n}\n\npinecone.create_index(\"example-index\", dimension=128,\n metadata_config=metadata_config)\npinecone.createIndex({\n name: \"example-index\",\n dimension: 128,\n metadata_config: {\n indexed: [\"metadata-field-name\"],\n },\n});\ncurl -i -X POST https://controller.YOUR_ENVIRONMENT.pinecone.io/databases \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"example-index\",\n \"dimension\": 128,\n \"metadata_config\": {\n \"indexed\": [\"metadata-field-name\"]\n }\n }'", "source": "https://docs.pinecone.io/docs/manage-indexes"}
{"id": "15c98f511782-9", "text": "The value for the metadata_config parameter is a JSON object containing the names of the metadata fields to index.\nJSON{\n \"indexed\": [\n \"metadata-field-1\",\n \"metadata-field-2\",\n \"metadata-field-n\"\n ]\n}\n\nWhen you provide a metadata_config object, Pinecone only indexes the metadata fields present in that object: any metadata fields absent from the metadata_config object are not indexed.\nWhen a metadata field is indexed, you can filter your queries using that metadata field; if a metadata field is not indexed, metadata filtering ignores that field.\nExamples\nThe following example creates an index that only indexes the genre metadata field. Queries against this index that filter for the genre metadata field may return results; queries that filter for other metadata fields behave as though those fields do not exist.\nPythonJavaScriptcurlmetadata_config = {\n \"indexed\": [\"genre\"]\n}", "source": "https://docs.pinecone.io/docs/manage-indexes"}
{"id": "15c98f511782-10", "text": "pinecone.create_index(\"example-index\", dimension=128,\n metadata_config=metadata_config)\npinecone.createIndex({\n name: \"example-index\",\n dimension: 128,\n metadata_config: {\n indexed: [\"genre\"],\n },\n});\ncurl -i -X POST https://controller.us-west1-gcp.pinecone.io/databases \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"example-index\",\n \"dimension\": 128,\n \"metadata_config\": {\n \"indexed\": [\"genre\"]\n }\n }'\n\nDeleting an index\nThis operation will delete all of the data and the computing resources associated with the index.\n\u2139\ufe0fNoteWhen you create an index, it runs as a service until you delete it. Users are\n\nbilled for running indexes, so we recommend you delete any indexes you're not\n\nusing. This will minimize your costs.\nDelete a Pinecone index named \"pinecone-index\":\nPythonJavaScriptcurlpinecone.delete_index(\"example-index\")\npinecone.deleteIndex(\"example-index\");\ncurl -i -X DELETE https://controller.YOUR_ENVIRONMENT.pinecone.io/databases/example-index \\\n -H 'Api-Key: YOUR_API_KEY'\nUpdated 4 days ago Understanding indexesScale indexesDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/manage-indexes"}
{"id": "76a3b703550b-0", "text": "Overview\nThis document describes concepts related to Pinecone indexes. To learn how to create or modify an index, see Manage indexes.\nAn index is the highest-level organizational unit of vector data in Pinecone. It accepts and stores vectors, serves queries over the vectors it contains, and does other vector operations over its contents. Each index runs on at least one pod. \nPods, pod types, and pod sizes\nPods are pre-configured units of hardware for running a Pinecone service. Each index runs on one or more pods. Generally, more pods mean more storage capacity, lower latency, and higher throughput. You can also create pods of different sizes.\nOnce an index is created using a particular pod type, you cannot change the pod type for that index. However, you can create a new index from that collection with a different pod type.\nDifferent pod types are priced differently. See pricing for more details.\nStarter plan\nWhen using the starter plan, you can create one pod with enough resources to support approximately 100,000 vectors with 1536-dimensional embeddings and metadata; the capacity is proportional for other dimensions.\nWhen using a starter plan, all create_index calls ignore the pod_type parameter.\ns1 pods\nThese storage-optimized pods provide large storage capacity and lower overall costs with slightly higher query latencies than p1 pods. They are ideal for very large indexes with moderate or relaxed latency requirements.", "source": "https://docs.pinecone.io/docs/indexes"}
{"id": "76a3b703550b-1", "text": "Each s1 pod has enough capacity for around 5M vectors of 768 dimensions.\np1 pods\nThese performance-optimized pods provide very low query latencies, but hold fewer vectors per pod than s1 pods. They are ideal for applications with low latency requirements (<100ms).\nEach p1 pod has enough capacity for around 1M vectors of 768 dimensions.\np2 pods\nThe p2 pod type provides greater query throughput with lower latency. For vectors with fewer than 128 dimension and queries where topK is less than 50, p2 pods support up to 200 QPS per replica and return queries in less than 10ms. This means that query throughput and latency are better than s1 and p1.\nEach p2 pod has enough capacity for around 1M vectors of 768 dimensions. However, capacity may vary with dimensionality.\nThe data ingestion rate for p2 pods is significantly slower than for p1 pods; this rate decreases as the number of dimensions increases. For example, a p2 pod containing vectors with 128 dimensions can upsert up to 300 updates per second; a p2 pod containing vectors with 768 dimensions or more supports upsert of 50 updates per second. Because query latency and throughput for p2 pods vary from p1 pods, test p2 pod performance with your dataset.\nThe p2 pod type does not support sparse vector values.\nPod size and performance", "source": "https://docs.pinecone.io/docs/indexes"}
{"id": "76a3b703550b-2", "text": "Pod size and performance\nPod performance varies depending on a variety of factors. To observe how your workloads perform on a given pod type, experiment with your own data set.\nEach pod type supports four pod sizes: x1, x2, x4, and x8. Your index storage and compute capacity doubles for each size step. The default pod size is x1. You can increase the size of a pod after index creation.\nTo learn about changing the pod size of an index, see Manage indexes.\nDistance metrics\nYou can choose from different metrics when creating a vector index:", "source": "https://docs.pinecone.io/docs/indexes"}
{"id": "76a3b703550b-3", "text": "euclidean\n\nThis is used to calculate the distance between two data points in a plane. It is one of the most commonly used distance metric. For an example, see our image similarity search example.\nWhen you use metric='euclidean', the most similar results are those with the lowest score.\n\n\ncosine\n\nThis is often used to find similarities between different documents. The advantage is that the scores are normalized to [-1,1] range.\n\n\ndotproduct\n\nThis is used to multiply two vectors. You can use it to tell us how similar the two vectors are. The more positive the answer is, the closer the two vectors are in terms of their directions.\n\n\n\nFor the full list of parameters available to customize an index, see the create_index API reference.\nDepending on your application, some metrics have better recall and precision performance than others. For more information, see: What is Vector Similarity Search?Updated 29 days ago gcp-starter environmentManage indexesDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/indexes"}
{"id": "61bf244afc2f-0", "text": "Overview\nIf you are a project owner, follow these steps to change the name of your project.\n\n\nAccess the Pinecone Console.\n\n\nClick Settings in the left menu.\n\n\nIn the Settings view, click the PROJECTS tab.\n\n\nNext to the project you want to update, click .\n\n\nUnder Project Name, enter the new project name.\n\n\nClick SAVE CHANGES.\n\nUpdated about 1 month ago Change project pod limitgcp-starter environmentDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/rename-project"}
{"id": "02acbd55900d-0", "text": "Overview\nIf you are a project owner, follow these steps to change the maximum total number of pods in your project.\nChange project pod limit in console\n\nAccess the Pinecone Console.\nClick Settings in the left menu.\nIn the Settings view, click the PROJECTS tab.\nNext to the project you want to update, click .\nUnder Pod Limit, enter the new number of pods.\nClick SAVE CHANGES.\nUpdated about 1 month ago Add users to projects and organizationsRename a projectDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/change-project-pod-limit"}
{"id": "4b96f1fef33d-0", "text": "Overview\nIf you are a project or organization owner, follow these steps to add users to organizations and projects. \nAdd users to projects and organizations\n\n\nAccess the Pinecone Console.\n\n\nClick Settings in the left menu.\n\n\nIn the Settings view, click the USERS tab.\n\n\nClick +INVITE USER.\n\n\n(Organization owner only) Select an organization role.\n\n\nSelect one or more projects.\n\n\nSelect a project role.\n\n\nEnter the user's email address.\n\n\nClick +INVITE USER.\n\n\nWhen you invite another user to join your organization or project, Pinecone sends them an email containing a link that enables them to gain access to the organization or project. If they already have a Pinecone account, they still receive an email, but they can also immediately view the project.Updated 13 days ago Create a projectChange project pod limitDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/add-users-to-projects-and-organizations"}
{"id": "e4c8b57346db-0", "text": "Overview\n\u2139\ufe0fInfoStarter (free) users can only have 1 owned project. To create a new project, Starter users must upgrade to the Standard or Enterprise plan or delete their default project.\nFollow these steps to create a new project:\n\n\nAccess the Pinecone Console.\n\n\nClick Organizations in the left menu.\n\n\nIn the Organizations view, click the PROJECTS tab.\n\n\nClick the +CREATE PROJECT button.\n\n\nEnter the Project Name.\n\n\nSelect a cloud provider and region.\n\n\nEnter the project pod limit.\n\n\nClick CREATE PROJECT.\n\n\nNext steps\n\nAdd users to your project.\nCreate an index.\nUpdated 13 days ago Understanding projectsAdd users to projects and organizationsDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/create-project"}
{"id": "aa8954e9aa20-0", "text": "Overview\nThis document explains the concepts related to Pinecone projects.\nProjects contain indexes and users\nEach Pinecone project contains a number of indexes and users. Only a user who belongs to the project can access the indexes in that project. Each project also has at least one project owner. All of the pods in a single project are located in a single environment. \nProject settings\nWhen you create a new project, you can choose the name, deployment environment, and pod limit.\nProject environment\nWhen creating a project, you must choose a cloud environment for the indexes in that project. The following table lists the available cloud regions, the corresponding values of the environment parameter for the init() operation, and which billing tier has access to each environment:", "source": "https://docs.pinecone.io/docs/projects"}
{"id": "aa8954e9aa20-1", "text": "Cloud regionenvironment valueTier availabilityGCP Starter (Iowa)*gcp-starterStarterGCP US-West-1 Free (N. California)us-west1-gcp-freeStarterGCP Asia-Southeast-1 (Singapore)asia-southeast1-gcp-freeStarterGCP US-West-4 (Las Vegas)us-west4-gcpStarterGCP US-West-1 (N. California)us-west1-gcpStandard / EnterpriseGCP US-Central-1 (Iowa)us-central1-gcpStandard / EnterpriseGCP US-West-4 (Las Vegas)us-west4-gcpStandard / EnterpriseGCP US-East-4 (Virginia)us-east4-gcpStandard / EnterpriseGCP northamerica-northeast-1northamerica-northeast1-gcpStandard / EnterpriseGCP Asia-Northeast-1 (Japan)asia-northeast1-gcpStandard / EnterpriseGCP Asia-Southeast-1 (Singapore)asia-southeast1-gcpStandard / EnterpriseGCP US-East-1 (South Carolina)us-east1-gcpStandard / EnterpriseGCP EU-West-1 (Belgium)eu-west1-gcpStandard / EnterpriseGCP EU-West-4 (Netherlands)eu-west4-gcpStandard / EnterpriseAWS US-East-1 (Virginia)us-east1-awsStandard / Enterprise", "source": "https://docs.pinecone.io/docs/projects"}
{"id": "aa8954e9aa20-2", "text": "* This environment has unique features and limitations. See gcp-starter environment for more information.\n Contact us if you need a dedicated deployment in other regions.\nThe environment cannot be changed after the project is created.\nProject pod limit\nYou can set the maximum number of pods that can be used in total across all indexes in a project. Use this to control costs.\nThe pod limit can be changed only by the project owner.\nProject roles\nThere are two project roles: Project owner and project member. Table 1 below summarizes the permissions for each role.\nTable 1: Project roles and permissions", "source": "https://docs.pinecone.io/docs/projects"}
{"id": "aa8954e9aa20-3", "text": "Project rolePermissions in organizationProject ownerManage project membersManage project API keysManage pod limitsProject memberAccess API keysCreate indexes in projectUse indexes in project\nAPI keys\nEach Pinecone project has one or more API keys. In order to make calls to the Pinecone API, a user must provide a valid API key for the relevant Pinecone project.\nTo view the API key for your project, open the Pinecone console, select the project, and click API Keys.Updated 11 days ago Setting up billing through GCP MarketplaceCreate a projectDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/projects"}
{"id": "e154854ddb3c-0", "text": "Introduction\nWhen planning your Pinecone deployment, it is important to understand the approximate storage requirements of your vectors to choose the appropriate pod type and number. This page will give guidance on sizing to help you plan accordingly.\nAs with all guidelines, these considerations are general and may not apply to your specific use case. We caution you to always test your deployment and ensure that the index configuration you are using is appropriate to your requirements.\nCollections make it easy to create new versions of your index with different pod types and sizes, and we encourage you to take advantage of that feature to test different configurations. This guide is merely an overview of sizing considerations and should not be taken as a definitive guide. \nUsers on the Standard, Enterprise, and Enterprise Dedicated plans can contact support for further help with sizing and testing.\nOverview\nThere are five main considerations when deciding how to configure your Pinecone index:\n\nNumber of vectors\nDimensionality of your vectors\nSize of metadata on each vector\nQPS throughput\nCardinality of indexed metadata", "source": "https://docs.pinecone.io/docs/choosing-index-type-and-size"}
{"id": "e154854ddb3c-1", "text": "Each of these considerations comes with requirements for index size, pod type, and replication strategy. \nNumber of vectors\nThe most important consideration in sizing is the number of vectors you plan on working with. As a rule of thumb, a single p1 pod can store approximately 1M vectors, while a s1 pod can store 5M vectors. However, this can be affected by other factors, such as dimensionality and metadata, which are explained below. \nDimensionality of vectors\nThe rules of thumb above for how many vectors can be stored in a given pod assumes a typical configuration of 768 dimensions per vector. As your individual use case will dictate the dimensionality of your vectors, the amount of space required to store them may necessarily be larger or smaller. \nEach dimension on a single vector consumes 4 bytes of memory and storage per dimension, so if you expect to have 1M vectors with 768 dimensions each, that\u2019s about 3GB of storage without factoring in metadata or other overhead. Using that reference, we can estimate the typical pod size and number needed for a given index. Table 1 below gives some examples of this.\nTable 1: Estimated number of pods per 1M vectors by dimensionality", "source": "https://docs.pinecone.io/docs/choosing-index-type-and-size"}
{"id": "e154854ddb3c-2", "text": "Pod typeDimensionsEstimated max vectors per podp15121,250,0007681,000,0001024675,000p25121,250,0007681,100,00010241,000,000s15128,000,0007685,000,00010244,000,000\nPinecone does not support fractional pod deployments, so always round up to the next nearest whole number when choosing your pods. \nQueries per second (QPS)\nQPS speeds are governed by a combination of the pod type of the index, the number of replicas, and the top_k value of queries. The pod type is the primary factor driving QPS, as the different pod types are optimized for different approaches.\nThe p1 pods are performance-optimized pods which provide very low query latencies, but hold fewer vectors per pod than s1 pods. They are ideal for applications with low latency requirements (<100ms). The s1 pods are optimized for storage and provide large storage capacity and lower overall costs with slightly higher query latencies than p1 pods. They are ideal for very large indexes with moderate or relaxed latency requirements. \nThe p2 pod type provides greater query throughput with lower latency. They support 200 QPS per replica and return queries in less than 10ms. This means that query throughput and latency are better than s1 and p1, especially for low dimension vectors (<512D).", "source": "https://docs.pinecone.io/docs/choosing-index-type-and-size"}
{"id": "e154854ddb3c-3", "text": "As a rule, a single p1 pod with 1M vectors of 768 dimensions each and no replicas can handle about 20 QPS. It\u2019s possible to get greater or lesser speeds, depending on the size of your metadata, number of vectors, the dimensionality of your vectors, and the top_K value for your search. See Table 2 below for more examples.\nTable 2: QPS by pod type and top_k value*", "source": "https://docs.pinecone.io/docs/choosing-index-type-and-size"}
{"id": "e154854ddb3c-4", "text": "Pod typetop_k 10top_k 250top_k 1000p1302520p21505020s1101010\n*The QPS values in Table 2 represent baseline QPS with 1M vectors and 768 dimensions.\nAdding replicas is the simplest way to increase your QPS. Each replica increases the throughput potential by roughly the same QPS, so aiming for 150 QPS using p1 pods means using the primary pod and 5 replicas. Using threading or multiprocessing in your application is also important, as issuing single queries sequentially still subjects you to delays from any underlying latency. The Pinecone gRPC client can also be used to increase throughput of upserts.\nMetadata cardinality and size\nThe last consideration when planning your indexes is the cardinality and size of your metadata. While the increases are small when talking about a few million vectors, they can have a real impact as you grow to hundreds of millions or billions of vectors. \nIndexes with very high cardinality, like those storing a unique user ID on each vector, can have significant memory requirements, resulting in fewer vectors fitting per pod. Also, if the size of the metadata per vector is larger, the index requires more storage. Limiting which metadata fields are indexed using selective metadata indexing can help lower memory usage.\nPod sizes", "source": "https://docs.pinecone.io/docs/choosing-index-type-and-size"}
{"id": "e154854ddb3c-5", "text": "Pod sizes\nYou can also start with one of the larger pod sizes, like p1.x2. Each step up in pod size doubles the space available for your vectors. We recommend starting with x1 pods and scaling as you grow. This way, you don\u2019t start with too large a pod size and have nowhere else to go up, meaning you have to migrate to a new index before you\u2019re ready.\nProjects on the gcp-starter environment do not use pods.\nExample applications\nThe following examples will showcase how to use the sizing guidelines above to choose the appropriate type, size, and number of pods for your index. \nExample 1: Semantic search of news articles\nIn our first example, we\u2019ll use the demo app for semantic search from our documentation. In this case, we\u2019re only working with 204,135 vectors. The vectors use 300 dimensions each, well under the general measure of 768 dimensions. Using the rule of thumb above of up to 1M vectors per p1 pod, we can run this app comfortably with a single p1.x1 pod. \nExample 2: Facial recognition", "source": "https://docs.pinecone.io/docs/choosing-index-type-and-size"}
{"id": "e154854ddb3c-6", "text": "Example 2: Facial recognition\nFor this example, suppose you\u2019re building an application to identify customers using facial recognition for a secure banking app. Facial recognition can work with as few as 128 dimensions, but in this case, because the app will be used for access to finances, we want to make sure we\u2019re certain that the person using it is the right one. We plan for 100M customers and use 2048 dimensions per vector.\nWe know from our rules of thumb above that 1M vectors with 768 dimensions fit nicely in a p1.x1 pod. We can just divide those numbers into the new targets to get the ratios we\u2019ll need for our pod estimate:\n100M / 1M = 100 base p1 pods\n2048 / 768 = 2.667 vector ratio\n2.667 * 100 = 267 rounding up", "source": "https://docs.pinecone.io/docs/choosing-index-type-and-size"}
{"id": "e154854ddb3c-7", "text": "So we need 267 p1.x1 pods. We can reduce that by switching to s1 pods instead, sacrificing latency by increasing storage availability. They hold five times the storage of p1.x1, so the math is simple:\n267 / 5 = 54 rounding up\n\nSo we estimate that we need 54 s1.x1 pods to store very high dimensional data for the face of each of the bank\u2019s customers.Updated about 1 month ago QuickstartUnderstanding organizationsDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/choosing-index-type-and-size"}
{"id": "7c8ea518c360-0", "text": "This guide explains how to set up a Pinecone vector database in minutes.\n1. Install Pinecone client (optional)\nThis step is optional. Do this step only if you want to use the Python client.\nUse the following shell command to install Pinecone:\nPythonJavaScriptpip install pinecone-client\nnpm i @pinecone-database/pinecone\n\nFor other clients, see Libraries.\n2. Get and verify your Pinecone API key\nTo use Pinecone, you must have an API key. To find your API key, open the Pinecone console and click API Keys. This view also displays the environment for your project. Note both your API key and your environment.\nTo verify that your Pinecone API key works, use the following commands:\nPythonJavaScriptcurlimport pinecone\n\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\nimport { PineconeClient } from '@pinecone-database/pinecone';\nconst pinecone = new PineconeClient();\nawait pinecone.init({\n apiKey: \"YOUR_API_KEY\",\n environment: \"YOUR_ENVIRONMENT\",\n});\ncurl -i https://controller.YOUR_ENVIRONMENT.pinecone.io/actions/whoami -H 'Api-Key: YOUR_API_KEY'\n\nIf you don't receive an error message, then your API key is valid.\n3. Hello, Pinecone!\nYou can complete the remaining steps in three ways:", "source": "https://docs.pinecone.io/docs/quickstart"}
{"id": "7c8ea518c360-1", "text": "Use the \"Hello, Pinecone!\" colab notebook to write and execute Python in your browser.\nCopy the commands below into your local installation of Python.\nUse the cURL API commands below.\n\n1. Initialize Pinecone\nPythonJavaScriptcurlimport pinecone\npinecone.init(api_key=\"YOUR_API_KEY\", environment=\"YOUR_ENVIRONMENT\")\nimport { PineconeClient } from '@pinecone-database/pinecone';\nconst pinecone = new PineconeClient();\nawait pinecone.init({\n apiKey: \"YOUR_API_KEY\",\n environment: \"YOUR_ENVIRONMENT\",\n});\n# Not applicable\n\n2. Create an index.\nThe commands below create an index named \"quickstart\" that performs approximate nearest-neighbor search using the Euclidean distance metric for 8-dimensional vectors.\nIndex creation takes roughly a minute.\nPythonJavaScriptcurlpinecone.create_index(\"quickstart\", dimension=8, metric=\"euclidean\")\nconst createRequest = {\n name: \"quickstart\",\n dimension: 8,\n metric:\"euclidean\",\n};\nawait pinecone.createIndex({ createRequest });\ncurl -i -X POST \\\n -H 'Content-Type: application/json' \\\n -H 'Api-Key: YOUR_API_KEY_HERE' \\\n https://controller.YOUR_ENVIRONMENT.pinecone.io/databases \\\n -d '{\n \"name\": \"quickstart\",\n \"dimension\": 8,\n \"metric\": \"euclidean\"\n }'", "source": "https://docs.pinecone.io/docs/quickstart"}
{"id": "7c8ea518c360-2", "text": "\u26a0\ufe0fWarningIn general, indexes on the Starter (free) plan are archived as collections and deleted after 7 days of inactivity; for indexes created by certain open source projects such as AutoGPT, indexes are archived and deleted after 1 day of inactivity. To prevent this, you can send any API request to Pinecone and the counter will reset.\n3. Retrieve a list of your indexes.\n Once your index is created, its name appears in the index list.\n Use the following commands to return a list of your indexes.\nPythonJavaScriptcurlpinecone.list_indexes()\n# Returns:\n# ['quickstart']\nconst list = await pinecone.listIndexes();\n// Returns:\n// [ 'quickstart' ]\ncurl -i https://controller.YOUR_ENVIRONMENT.pinecone.io/databases \\\n -H \"Api-Key: YOUR_API_KEY\"\n# Output:\n# [\"quickstart\"]\n\n4. Connect to the index (Client only).\nBefore you can query your index using a client, you must connect to the index.\nUse the following commands to connect to your index.\nPythonJavaScriptcurlindex = pinecone.Index(\"quickstart\")\nconst index = pinecone.Index(\"quickstart\");\n# Not applicable", "source": "https://docs.pinecone.io/docs/quickstart"}
{"id": "7c8ea518c360-3", "text": "5. Insert the data.\nTo ingest vectors into your index, use the upsert operation. \nThe upsert operation inserts a new vector in the index or updates the vector if a vector with the same ID is already present.\nThe following commands upsert 5 8-dimensional vectors into your index.\nPythonJavaScriptcurl# Upsert sample data (5 8-dimensional vectors)\nindex.upsert([\n (\"A\", [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]),\n (\"B\", [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]),\n (\"C\", [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]),\n (\"D\", [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]),", "source": "https://docs.pinecone.io/docs/quickstart"}
{"id": "7c8ea518c360-4", "text": "(\"E\", [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5])\n])\nconst upsertRequest = {\n vectors: [\n {\n \"id\": \"A\",\n \"values\": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]\n },\n {\n \"id\": \"B\",\n \"values\": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]\n },\n {\n \"id\": \"C\",\n \"values\": [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]\n },\n {\n \"id\": \"D\",\n \"values\": [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]\n },\n {", "source": "https://docs.pinecone.io/docs/quickstart"}
{"id": "7c8ea518c360-5", "text": "},\n {\n \"id\": \"E\",\n \"values\": [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5]\n }\n ]\n};\nawait index.upsert({ upsertRequest });\ncurl -i -X POST https://quickstart-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/vectors/upsert \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"vectors\": [\n {\n \"id\": \"A\",\n \"values\": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]\n },\n {\n \"id\": \"B\",\n \"values\": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]\n },\n {\n \"id\": \"C\",", "source": "https://docs.pinecone.io/docs/quickstart"}
{"id": "7c8ea518c360-6", "text": "\"id\": \"C\",\n \"values\": [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]\n },\n {\n \"id\": \"D\",\n \"values\": [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]\n },\n {\n \"id\": \"E\",\n \"values\": [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5]\n }\n ]\n }'", "source": "https://docs.pinecone.io/docs/quickstart"}
{"id": "7c8ea518c360-7", "text": "The cURL command above uses the endpoint for your Pinecone index. \n\u2139\ufe0fNoteWhen upserting larger amounts of data, upsert data in batches of 100 vectors or fewer over multiple upsert requests.\n6. Get statistics about your index.\nThe following commands return statistics about the contents of your index.\nPythonJavaScriptcurlindex.describe_index_stats()\n# Returns:\n# {'dimension': 8, 'index_fullness': 0.0, 'namespaces': {'': {'vector_count': 5}}}\nconst indexStats = await index.describeIndexStats({\n describeIndexStatsRequest: {},\n});\n// Returns:\n/** {\n \"namespaces\": {\n \"\": {\n \"vectorCount\": 5\n }\n },\n \"dimension\": 8\n }\n**/\ncurl -i https://quickstart-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/describe_index_stats \\\n -H 'Api-Key: YOUR_API_KEY'\n\n# Output:\n# {\n# \"namespaces\": {\n# \"\": {\n# \"vectorCount\": 5\n# }\n# },\n# \"dimension\": 8\n# }", "source": "https://docs.pinecone.io/docs/quickstart"}
{"id": "7c8ea518c360-8", "text": "7. Query the index and get similar vectors.\nThe following example queries the index for the three (3) vectors that are most similar to an example 8-dimensional vector using the Euclidean distance metric specified in step 2 (\"Create an index.\") above.\nPythonJavaScriptcurlindex.query(\n vector=[0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],\n top_k=3,\n include_values=True\n)\n# Returns:\n# {'matches': [{'id': 'C',\n# 'score': 0.0,\n# 'values': [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]},\n# {'id': 'D',\n# 'score': 0.0799999237,\n# 'values': [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]},\n# {'id': 'B',\n# 'score': 0.0800000429,", "source": "https://docs.pinecone.io/docs/quickstart"}
{"id": "7c8ea518c360-9", "text": "# 'values': [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]}],\n# 'namespace': ''}\nconst queryRequest = {\n topK: 3,\n vector: [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],\n includeValues: true\n};", "source": "https://docs.pinecone.io/docs/quickstart"}
{"id": "7c8ea518c360-10", "text": "const queryResponse = await index.query({ queryRequest });\n// Returns:\n/** {\n\t\"results\": [],\n\t\"matches\": [{\n\t\t\"id\": \"C\",\n\t\t\"score\": 0,\n\t\t\"values\": [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]\n\t}, {\n\t\t\"id\": \"D\",\n\t\t\"score\": 0.0799999237,\n\t\t\"values\": [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]\n\t}, {\n\t\t\"id\": \"B\",\n\t\t\"score\": 0.0800000429,\n\t\t\"values\": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]\n\t}],\n\t\"namespace\": \"\"\n}\n**/\ncurl -i -X POST https://quickstart-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/query \\\n -H 'Api-Key: YOUR_API_KEY' \\", "source": "https://docs.pinecone.io/docs/quickstart"}
{"id": "7c8ea518c360-11", "text": "-H 'Content-Type: application/json' \\\n -d '{\n \"vector\": [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],\n \"topK\": 3,\n \"includeValues\": true\n }'", "source": "https://docs.pinecone.io/docs/quickstart"}
{"id": "7c8ea518c360-12", "text": "# Output:\n# {\n# \"matches\":[\n# {\n# \"id\": \"C\",\n# \"score\": -1.76717265e-07,\n# \"values\": [0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3]\n# },\n# {\n# \"id\": \"B\",\n# \"score\": 0.080000028,\n# \"values\": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]\n# },\n# {\n# \"id\": \"D\",\n# \"score\": 0.0800001323,\n# \"values\": [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]\n# }\n# ],\n# \"namespace\": \"\"\n# }", "source": "https://docs.pinecone.io/docs/quickstart"}
{"id": "7c8ea518c360-13", "text": "8. Delete the index.\nOnce you no longer need the index, use the delete_index operation to delete it. \nThe following commands delete the index.\nPythonJavaScriptcurlpinecone.delete_index(\"quickstart\")\nawait pinecone.deleteIndex({ indexName:\"quickstart\" });\ncurl -i -X DELETE https://controller.YOUR_ENVIRONMENT.pinecone.io/databases/quickstart \\\n -H 'Api-Key: YOUR_API_KEY'\n\n\u26a0\ufe0fWarningAfter you delete an index, you cannot use it again.\nNext steps\nNow that you\u2019re successfully making indexes with your API key, you can start inserting data or view more examples.Updated 4 days ago OverviewChoosing index type and sizeDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/quickstart"}
{"id": "a127577ba5d8-0", "text": "Pinecone Overview\nPinecone makes it easy to provide long-term memory for high-performance AI applications. It\u2019s a managed, cloud-native vector database with a simple API and no infrastructure hassles. Pinecone serves fresh, filtered query results with low latency at the scale of billions of vectors.\nVector embeddings provide long-term memory for AI.\nApplications that involve large language models, generative AI, and semantic search rely on vector embeddings, a type of data that represents semantic information. This information allows AI applications to gain understanding and maintain a long-term memory that they can draw upon when executing complex tasks. \nVector databases store and query embeddings quickly and at scale.\nVector databases like Pinecone offer optimized storage and querying capabilities for embeddings. Traditional scalar-based databases can\u2019t keep up with the complexity and scale of such data, making it difficult to extract insights and perform real-time analysis. Vector indexes like FAISS lack useful features that are present in any database. Vector databases combine the familiar features of traditional databases with the optimized performance of vector indexes.\nPinecone indexes store records with vector data.\nEach record in a Pinecone index contains a unique ID and an array of floats representing a dense vector embedding. \n \nEach record may also contain a sparse vector embedding for hybrid search and metadata key-value pairs for filtered queries.\nPinecone queries are fast and fresh.", "source": "https://docs.pinecone.io/docs/overview"}
{"id": "a127577ba5d8-1", "text": "Pinecone queries are fast and fresh.\nPinecone returns low-latency, accurate results for indexes with billions of vectors. High-performance pods return up to 200 queries per second per replica. Queries reflect up-to-the-second updates such as upserts and deletes. Filter by namespaces and metadata or add resources to improve performance.\nUpsert and query vector embeddings with the Pinecone API.\nPerform CRUD operations and query your vectors using HTTP, Python, or Node.js.\nPythonindex = pinecone.Index('example-index')", "source": "https://docs.pinecone.io/docs/overview"}
{"id": "a127577ba5d8-2", "text": "upsert_response = index.upsert(\n vectors=[\n {'id': 'vec1',\n 'values': [0.1, 0.2, 0.3],\n 'metadata': {'genre': 'drama'},\n 'sparse_values': {\n 'indices': [10, 45, 16],\n 'values': [0.5, 0.5, 0.2]\n }},\n {'id': 'vec2',\n 'values': [0.2, 0.3, 0.4],\n 'metadata': {'genre': 'action'},\n 'sparse_values': {\n 'indices': [15, 40, 11],\n 'values': [0.4, 0.5, 0.2]\n }}\n ],\n namespace='example-namespace'\n)", "source": "https://docs.pinecone.io/docs/overview"}
{"id": "a127577ba5d8-3", "text": "Query your index for the most similar vectors.\nSpecify the distance metric your index uses to evaluate vector similarity, along with dimensions and replicas.\nPythonJavaScriptcurlpinecone.create_index(\"example-index\", dimension=128, metric=\"euclidean\", pods=4, pod_type=\"s1.x1\")\nawait pinecone.createIndex({\n name: \"example-index\",\n dimension: 128,\n metric: \"euclidean\",\n pods: 4,\n podType: \"s1.x1\",\n});\ncurl -i -X POST https://controller.YOUR_ENVIRONMENT.pinecone.io/databases \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"example-index\",\n \"dimension\": 128,\n \"metric\": \"euclidean\",\n \"pods\": 4,\n \"pod_type\": \"p1.x1\"\n }'\n\nFind the top k most similar vectors, or query by ID.\nPythonJavaScriptcurlindex.query(\n vector=[0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],\n top_k=3,\n include_values=True\n)", "source": "https://docs.pinecone.io/docs/overview"}
{"id": "a127577ba5d8-4", "text": "# Returns:\n# {'matches': [{'id': 'C',\n# 'score': -1.76717265e-07,\n# 'values': [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]},\n# {'id': 'B',\n# 'score': 0.080000028,\n# 'values': [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]},\n# {'id': 'D',\n# 'score': 0.0800001323,\n# 'values': [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]}],\n# }\nconst index = pinecone.Index(\"example-index\");\nconst queryRequest = {\n vector: [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],\n topK: 3,\n includeValues: true\n};\nconst queryResponse = await index.query({ queryRequest });", "source": "https://docs.pinecone.io/docs/overview"}
{"id": "a127577ba5d8-5", "text": "// Returns:\n// {'matches': [{'id': 'C',\n// 'score': -1.76717265e-07,\n// 'values': [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]},\n// {'id': 'B',\n// 'score': 0.080000028,\n// 'values': [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]},\n// {'id': 'D',\n// 'score': 0.0800001323,\n// 'values': [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]}],\n// }\ncurl -i -X POST https://hello-pinecone-YOUR_PROJECT.svc.YOUR_ENVIRONMENT.pinecone.io/query \\\n -H 'Api-Key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{", "source": "https://docs.pinecone.io/docs/overview"}
{"id": "a127577ba5d8-6", "text": "-d '{\n \"vector\":[0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],\n \"topK\": 3,\n \"includeValues\": true\n }'", "source": "https://docs.pinecone.io/docs/overview"}
{"id": "a127577ba5d8-7", "text": "Get started\nGo to the quickstart guide to get a production-ready vector search service up and running in minutes.Updated 3 days ago QuickstartDid this page help you?YesNo", "source": "https://docs.pinecone.io/docs/overview"}