11-19 更新 实时
首页/ 技术栈/ 正文

Pinecone 集成嵌入支持 Gemini Embedding 2

技术栈 来源:Pinecone Blog 2026-11-13 00:00 0 阅读 机器翻译
Pinecone 集成嵌入支持 Gemini Embedding 2

Pinecone 在 Documents API 上的集成嵌入现已支持 Google 的 Gemini Embedding 2,与最初一同推出的 Pinecone 托管模型并列。Gemini Embedding 2 是 Google 最新的 Gemini 嵌入模型。团队现在可以直接在其上运行语义搜索,而无需构建和维护嵌入流水线。

在 Documents API 索引的某个文本字段上设置 Gemini Embedding 2,然后发送纯文本即可。Pinecone 会用该模型对该字段的每一次写入和每一次查询进行嵌入。无需管理 Google Cloud 账号或密钥,相关 Token 会按 Google 的标价出现在你的 Pinecone 账单上。

在 2026 年 12 月 31 日之前,Builder 套餐可获得 Gemini Embedding 2 双倍的包含 Token 额度:每月 2000 万。

让 Pinecone 来完成嵌入调用

使用 Google 的嵌入模型意味着每次写入和每次查询都要调用 Google 的 API。开发团队需要管理 Google Cloud 账号、API 密钥和速率限制,并向 Google 单独付费,与 Pinecone 分开结算。集成嵌入把这些工作移入 Pinecone:

直接发送纯文本,而不用先调用嵌入服务提供商。Pinecone 在一次调用中完成查询嵌入并执行搜索。

Pinecone 将每个文档的文本与其嵌入一起写入,因此全文搜索和语义搜索始终看到每个文档的同一版本。

Pinecone 通过 Google Vertex AI 提供 Gemini Embedding 2,并对失败的调用进行重试,因此团队无需自行构建重试逻辑。

无需管理 Google API 密钥,嵌入也没有单独的账单。Token 按 Google 的标价计入 Pinecone 账单。

如何在 Pinecone 中使用 Gemini Embedding 2

创建 Documents API 索引时,在文本字段的 embed 设置中指定该模型。下面的 Python 示例使用 gemini-embedding-2 以 1,536 维对 body 字段进行嵌入,并为 body 开启全文搜索,因此同一个字段可同时服务于语义搜索和关键词搜索。

注意:Gemini Embedding 2 需要 Builder 套餐或更高级别。

from pinecone import Pinecone pc = Pinecone(api_key="YOUR_API_KEY") pc.indexes.create( name="support-articles", schema={ "fields": { "body": { "type": "string", "full_text_search": {}, "embed": { "model": "gemini-embedding-2", "dimension": 1536, }, } } }, ) index = pc.index("support-articles") index.documents.upsert( namespace="articles", documents=[ {"_id": "kb-205", "body": "Refunds take five business days."}, ], )

搜索时,将查询以文本形式发送。该搜索还会让 Gemini Embedding 2 为问答场景嵌入查询:

results = index.documents.search( namespace="articles", top_k=5, score_by=[ { "type": "embed", "fields": ["body"], "query": "how long do refunds take", "parameters": {"task_type": "question_answering"} } ], include_fields=["body"], )

如果不指定维度,该字段将使用模型的完整维度。模型支持的任意维度都可用,因此你可以沿用现有索引已经使用的维度。

Gemini Embedding 2 要求在每个输入的开头附带一条简短指令,说明该文本是文档还是查询。Pinecone 会在每次写入和每次查询时自动加上正确的指令,因此你无需编写针对特定模型的提示词。

默认情况下,Pinecone 会为通用搜索嵌入 Gemini Embedding 2 字段。若用于分类、聚类或 sentence_similarity,可在字段上设置 task_type。单次搜索也可以针对该查询把 task_type 设为 question_answering、fact_verification 或 code_retrieval_query。请查看 Pinecone 支持的任务类型完整列表。

Gemini Embedding 2 支持 100 多种语言的文本。该模型在全球范围处理文本,这意味着 Google 可以在其任一区域处理每个请求,且不保证使用特定区域。

Gemini Embedding 2 可用于无服务器 Documents API 索引。不支持 BYOC、基于 pod 的索引以及 Records API 索引。

控制台和 Python SDK 10.3.0 已支持 Gemini Embedding 2。Node.js 和 Go SDK 的支持即将推出。

现有的向量索引可以转换为 Documents API 索引,无需重新嵌入。为已转换的索引添加集成嵌入功能即将推出。在此之前,请在新的 Documents API 索引上使用 Gemini Embedding 2,并把文本发送给它们。

集成嵌入目前适用于文本字段,不适用于多模态字段。因此,虽然 Gemini Embedding 2 也能嵌入图像、视频和音频,但目前仅作为文本模型提供。多模态支持计划在后续版本中推出。

Builder 套餐每月为 Gemini Embedding 2 提供 1000 万个 Token,并在 2026 年 12 月 31 日之前提供该额度的两倍。

阅读集成嵌入文档,了解如何在 Documents API 索引上设置 Google 的 Gemini Embedding 2。在 2026 年 12 月 31 日之前,Builder 套餐可获得 Gemini Embedding 2 所含 Token 的两倍:每月 20M。

这篇文章对您有帮助吗?

立即开始构建知识型 AI

免费创建您的第一个索引,待您准备扩展时再按需付费。

译文由英文原文机器翻译,术语按行业惯例统一,可在文末展开原文核对。

查看英文原文(Pinecone integrated embedding now supports Google's Gemini Embedding 2)

Pinecone integrated embedding on the Documents API now supports Google's Gemini Embedding 2, alongside the Pinecone-hosted models it launched with. Gemini Embedding 2 is Google's newest Gemini embedding model. Teams can now run semantic search on it without building and maintaining an embedding pipeline.

Set Gemini Embedding 2 on a text field in a Documents API index and send plain text. Pinecone embeds every write and every query for that field with that model. There's no Google Cloud account or key to manage, and the tokens appear on your Pinecone invoice at Google's list price.

Through December 31, 2026, the Builder plan gets twice its included tokens for Gemini Embedding 2: 20M a month.

Let Pinecone make the embedding calls

An application sends a document and a query to Pinecone as plain text, and Pinecone embeds both with Google's Gemini Embedding 2.

Using a Google embedding model means calling Google's API on every write and every query. Development teams manage the Google Cloud account, API key, and rate limits, and pay Google separately from Pinecone. Integrated embedding moves that work into Pinecone:

Send plain text instead of calling an embedding provider first. Pinecone embeds the query and runs the search in one call.

Pinecone writes each document's text and its embedding together, so full-text and semantic search always see the same version of each document.

Pinecone serves Gemini Embedding 2 from Google Vertex AI, and retries failed calls, so teams don't have to build their own retry logic.

There's no Google API key to manage, and no separate bill for embedding. Tokens are billed on the Pinecone invoice at Google's list price.

How to use Gemini Embedding 2 in Pinecone

Set the model in the embed setting of a text field when creating a Documents API index. The Python example below embeds the body field with gemini-embedding-2 at 1,536 dimensions and turns on full-text search for body, so the same field serves semantic and keyword search.

Note: Gemini Embedding 2 needs a Builder plan or above.

from pinecone import Pinecone pc = Pinecone(api_key="YOUR_API_KEY") pc.indexes.create( name="support-articles", schema={ "fields": { "body": { "type": "string", "full_text_search": {}, "embed": { "model": "gemini-embedding-2", "dimension": 1536, }, } } }, ) index = pc.index("support-articles") index.documents.upsert( namespace="articles", documents=[ {"_id": "kb-205", "body": "Refunds take five business days."}, ], )

To search, send the query as text. This search also tells Gemini Embedding 2 to embed the query for question answering:

results = index.documents.search( namespace="articles", top_k=5, score_by=[ { "type": "embed", "fields": ["body"], "query": "how long do refunds take", "parameters": {"task_type": "question_answering"} } ], include_fields=["body"], )

If you leave out the dimension, the field uses the model's full size. Any size the model supports works, so you can keep the dimensions your existing indexes already use.

Gemini Embedding 2 expects a short instruction at the start of each input that says whether the text is a document or a query. Pinecone adds the right instruction to every write and every query, so you don't need model-specific prompts.

By default, Pinecone embeds Gemini Embedding 2 fields for general search. Set task_type on the field for classification, clustering, or sentence_similarity. A single search can also set task_type to question_answering, fact_verification, or code_retrieval_query for that query. See the full list of task types Pinecone supports.

Gemini Embedding 2 supports text in more than 100 languages. The model processes text globally, which means Google can handle each request in any of its regions, with no specific region guaranteed.

Gemini Embedding 2 works on serverless Documents API indexes. BYOC, pod-based, and Records API indexes aren't supported.

The console and Python SDK 10.3.0 support Gemini Embedding 2. Support in the Node.js and Go SDKs is coming soon.

Existing vector indexes can be converted to Documents API indexes without re-embedding. Adding integrated embedding to a converted index is coming soon. Until then, use Gemini Embedding 2 on new Documents API indexes and send them your text.

Integrated embedding works on text fields today, not on multimodal fields. So, while Gemini Embedding 2 can also embed images, video, and audio, it is only offered as a text model today. Multimodal support is planned for a later release.

Builder plan includes 10M tokens a month for Gemini Embedding 2, and twice that through December 31, 2026.

Read the integrated embedding docs to learn how to set up Google's Gemini Embedding 2 on a Documents API index. Through December 31, 2026, the Builder plan gets twice its included tokens for Gemini Embedding 2: 20M a month.

Was this article helpful?

Start building knowledgeable AI today

Create your first index for free, then pay as you go when you're ready to scale.

原文为英文,正文由自动抓取并保留原文。

本文由采集器自动同步

原文发布于 Pinecone Blog(Pinecone integrated embedding now supports Google's Gemini Embedding 2),标题、摘要与正文由机器翻译,术语按行业惯例统一,未经人工逐句校订。

阅读原文 ↗