Skip to contents

Creates a new Pinecone index with an integrated embedding model. This enables automatic embedding of text during upsert and query operations using Pinecone's hosted models.

Usage

create_index_for_model(
  name,
  cloud,
  region,
  embed,
  deletion_protection = "disabled",
  tags = NULL
)

Arguments

name

Name of the index (must be unique within project)

cloud

Cloud provider: "aws", "gcp", or "azure"

region

Cloud region (e.g., "us-east-1" for AWS)

embed

A list specifying the embedding model configuration: - model: The embedding model name (e.g., "multilingual-e5-large") - field_map: A named list mapping source field to text field (e.g., list(text = "chunk_text")) - metric: Optional distance metric ("cosine", "euclidean", "dotproduct") - read_parameters: Optional list with input_type for queries - write_parameters: Optional list with input_type for documents

deletion_protection

Whether to enable deletion protection ("enabled" or "disabled")

tags

Optional named list of tags for the index

Value

List with http response, content (index details including host), and status_code

Details

Indexes created with integrated embedding models support: - `records_upsert()`: Upsert text that gets automatically embedded - `records_search()`: Search using text queries with optional reranking

The embedding model determines the vector dimension automatically.

Examples

if (FALSE) { # \dontrun{
# Create an index with multilingual-e5-large model
create_index_for_model(
  name = "my-semantic-index",
  cloud = "aws",
  region = "us-east-1",
  embed = list(
    model = "multilingual-e5-large",
    field_map = list(text = "chunk_text")
  )
)

# With custom metric and input types
create_index_for_model(
  name = "my-index",
  cloud = "aws",
  region = "us-east-1",
  embed = list(
    model = "multilingual-e5-large",
    field_map = list(text = "content"),
    metric = "dotproduct",
    read_parameters = list(input_type = "query"),
    write_parameters = list(input_type = "passage")
  )
)
} # }