Skip to main content

When to use it

Gemini Embedding 2 (gemini-embedding-2) is a dense text embedding model from Google. Pinecone offers it for integrated embedding on document indexes, so you upsert and search with text and Pinecone embeds it through Google Vertex AI.The model embeds text differently for each task you choose with task_type, such as retrieval_document for stored text, question_answering or fact_verification for queries, or clustering for grouping texts. You can also override the query task for one search.

Inputs, limits, and pricing

Monthly and per-minute limits depend on your plan. See Rate limits.

Quickstart

Installation

Integrated embedding on document indexes requires Python SDK 10.1.0, Node.js SDK 9.1.0, or Go SDK 7.1.0 or later.

Create index

This creates a document index whose chunk_text field embeds with gemini-embedding-2 at 768 dimensions. The fieldโ€™s write task defaults to retrieval_document, and its queries default to retrieval_query.

Embed & upsert

Upsert documents with plain text on the embedded field. Pinecone embeds each value on write, up to 96 documents per request.

Query

Search with an embed clause, and Pinecone embeds the query text with the fieldโ€™s read task.

Task types

Each task type is a write task, a query task, or a symmetric task. Set the write task in the fieldโ€™s write_parameters and the default query task in its read_parameters. A symmetric task embeds stored text and queries the same way, for comparing texts with each other rather than searching. For which tasks a field accepts, see Set task types on the field.

Override the query task

To embed one query with a different task, set parameters on the embed clause. The Python SDK supports parameters in 10.3.0 and later. The Node.js and Go SDKs donโ€™t support it yet, so use the REST API with them. This search embeds its query as a question with question_answering:

Use a symmetric task

This creates an index that embeds support tickets with clustering. Its queries use clustering too, so a search returns the tickets most similar to the one you pass in, which you can use to find duplicates or group related issues.
After you upsert tickets, search with a new ticketโ€™s text to find similar ones:

Good to know

  • Dimension: 3,072 by default, or any integer from 128 to 3,072. The metric is cosine only.
  • Input: Text only. Pinecone doesnโ€™t support image, audio, or video input for this model yet.
  • Processing location: global only. See Processing locations.
  • Availability: Integrated embedding on document indexes only, on the Builder, Standard, and Enterprise plans.