Pinecone Resource Management

pinecone.init(host: str = None, environment: str = None, config: str = '~/.pinecone', **kwargs)

Initializes the Pinecone client.

Parameters
  • api_key – Required if not set in config file or by environment variable PINECONE_API_KEY.

  • host – Optional. Controller host.

  • environment – Optional. Deployment environment.

  • config – Optional. An INI configuration file.

pinecone.create_index(wait: bool = True, engine_type: str = 'approximated', metric: str = 'cosine', shards: int = 1, replicas: int = 1, gateway_replicas: int = 1, engine_args: dict = None) → Optional[dict]

Creates a Pinecone index.

Parameters
  • name (str) – the name of the index.

  • wait (bool) – wait for the index to deploy. Defaults to True

  • engine_type (str, optional) – type of engine, one of {“approximated”, “exact”}, defaults to “approximated”. The “approximated” engine uses fast approximate search algorithms developed by Pinecone. The “exact” engine uses accurate exact search algorithms. It performs exhaustive searches and thus it is usually slower than the “approximated” engine.

  • metric (str, optional) – type of metric used in the vector index, one of {“cosine”, “dotproduct”, “euclidean”}, defaults to “cosine”. Use “cosine” for cosine similarity, “dotproduct” for dot-product, and “euclidean” for euclidean distance.

  • shards (int, optional) – the number of shards for the engine, defaults to 1. As a general guideline, use 1 shard per 1 GB of data.

  • replicas (int, optional) – the number of replicas, defaults to 1. Use at least 2 replicas if you need high availability (99.99% uptime) for querying. For additional throughput (QPS) your service needs to support, provision additional replicas.

  • gateway_replicas (int) – number of replicas of both the gateway and the aggregator.

  • engine_args (dict) – advanced arguments for the engine instance in the graph.

pinecone.delete_index(wait: bool = True) → Optional[dict]

Deletes a Pinecone index.

Parameters
  • name (str) – the name of the index.

  • wait (bool) – wait for the index to deploy. Defaults to True

pinecone.list_indexes() → Optional[List[str]]

Lists all indexes.

pinecone.describe_index() → Optional[pinecone.manage.ResourceDescription]

Describes an index.

Parameters

name (str) – the name of the index.

class pinecone.ResourceDescription(name: str, kind: str, status: dict, config: dict)

Description of a resource.

Create new instance of ResourceDescription(name, kind, status, config)

property config

Alias for field number 3

property kind

Alias for field number 1

property name

Alias for field number 0

property status

Alias for field number 2