APIs de Vertex AI para crear experiencias de búsqueda y RAG
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Vertex AI ofrece un conjunto de APIs para ayudarte a compilar aplicaciones de Generación mejorada por recuperación (RAG) o un motor de búsqueda. En esta página, se presentan esas APIs.
Recuperación y generación
La RAG es una metodología que permite que los modelos de lenguaje grandes (LLM) generen respuestas basadas en la fuente de datos que elijas. Existen dos etapas en RAG:
Recuperación: Obtener los datos más relevantes rápidamente puede ser un problema de búsqueda común. Con la RAG, puedes recuperar rápidamente los datos importantes para generar una respuesta.
Generación: El LLM usa los hechos recuperados para generar una respuesta fundamentada.
Vertex AI ofrece opciones para ambas etapas que se adaptan a una variedad de necesidades de los desarrolladores.
Recuperación
Elige el mejor método de recuperación para tus necesidades:
Vertex AI Search: Vertex AI Search es un motor de recuperación de información con la calidad de la Búsqueda de Google que puede ser un componente de cualquier aplicación de IA generativa que use tus datos empresariales.
Vertex AI Search funciona como un motor de búsqueda semántico y de palabras clave listo para usar para RAG con la capacidad de procesar una variedad de tipos de documentos y con conectores a una variedad de sistemas fuente, incluidos BigQuery y muchos sistemas de terceros.
Crea tu propia recuperación: Si quieres crear tu búsqueda semántica, puedes usar las APIs de Vertex AI para los componentes de tu sistema RAG personalizado. Este conjunto de APIs proporciona implementaciones de alta calidad para el análisis de documentos, la generación de incorporaciones, la búsqueda de vectores y la clasificación semántica. El uso de estas APIs de nivel inferior te brinda flexibilidad total en el diseño de tu recuperador y, al mismo tiempo, ofrece un tiempo de comercialización acelerado y alta calidad, ya que se basa en las APIs de Vertex AI de nivel inferior.
Incorpora una recuperación existente: Puedes usar tu búsqueda existente como un recuperador para la generación fundamentada.
También puedes usar las APIs de Vertex para RAG y mejorar la calidad de tu búsqueda existente. Para obtener más información, consulta Descripción general de la fundamentación.
Vertex AI RAG Engine: Vertex AI RAG Engine proporciona un entorno de ejecución completamente administrado para la organización de RAG, lo que permite a los desarrolladores compilar RAG para su uso en contextos de producción y listos para empresas.
Búsqueda de Google: Cuando usas la fundamentación con la Búsqueda de Google para tu modelo de Gemini, Gemini usa la Búsqueda de Google y genera resultados fundamentados en los resultados de la búsqueda pertinentes. Este método de recuperación no requiere administración y te brinda el conocimiento del mundo disponible para Gemini.
Elige el mejor método de generación según tus necesidades:
Fundamentar con tus datos:
Genera respuestas fundamentadas a la consulta de un usuario. La API de generación fundamentada usa modelos de Gemini especializados y perfeccionados, y es una forma eficaz de reducir las alucinaciones y proporcionar respuestas fundamentadas en tus fuentes o en fuentes de terceros, incluidas las referencias al contenido de asistencia para la fundamentación.
También puedes fundamentar las respuestas con tus datos de Vertex AI Search usando la IA generativa en Vertex AI. Para obtener más información, consulta Fundamenta con tus datos.
Fundamentación con la Búsqueda de Google: Gemini es el modelo más capaz de Google y ofrece fundamentación lista para usar con la Búsqueda de Google. Puedes usarla para crear tu solución de generación fundamentada completamente personalizada.
Model Garden: Si quieres tener el control total y el modelo de tu elección, puedes usar cualquiera de los modelos en Model Garden de Vertex AI para la generación.
Crea tu propia generación mejorada por recuperación
Desarrollar un sistema de RAG personalizado para la fundamentación ofrece flexibilidad y control en cada paso del proceso. Vertex AI ofrece un conjunto de APIs para ayudarte a crear tus propias soluciones de búsqueda. El uso de esas APIs te brinda flexibilidad total en el diseño de tu aplicación de RAG y, al mismo tiempo, ofrece un tiempo de comercialización acelerado y alta calidad, ya que se basa en estas APIs de Vertex AI de nivel inferior.
El analizador de diseño de Document AI.
El analizador de diseño de Document AI transforma documentos en varios formatos en representaciones estructuradas, lo que hace que el contenido, como párrafos, tablas, listas y elementos estructurales, como encabezados, encabezados de página y pies de página, sea accesible, y crea fragmentos contextuales que facilitan la recuperación de información en una variedad de apps de IA generativa y descubrimiento.
Para obtener más información, consulta Document AI Layout Parser en la documentación de Document AI.
API de Embeddings: Las APIs de Embeddings de Vertex AI te permiten crear embeddings para entradas de texto o multimodales. Los embeddings son vectores de números de punto flotante diseñados para capturar el significado de su entrada. Puedes usar los embeddings para potenciar la búsqueda semántica con la Búsqueda de vectores.
Búsqueda de vectores. El motor de recuperación es una parte clave de tu aplicación de búsqueda o RAG. La Búsqueda de vectores de Vertex AI es un motor de recuperación que puede buscar miles de millones de elementos similares o relacionados de manera semántica a gran escala, con consultas por segundo (QPS) altas, recuperación alta, latencia baja y eficiencia de costos. Puede realizar búsquedas en embeddings densos y admite la búsqueda de palabras clave con embeddings dispersos y la búsqueda híbrida en la vista previa pública.
API de clasificación.
La API de clasificación toma una lista de documentos y los vuelve a clasificar según su relevancia para una búsqueda determinada. En comparación con las incorporaciones que solo analizan la similitud semántica de un documento y una búsqueda, la API de clasificación puede proporcionarte una puntuación más precisa sobre qué tan bien un documento responde a una búsqueda determinada.
La API de Grounded Generation. Usa la API de generación fundamentada para generar respuestas bien fundamentadas a la instrucción de un usuario. Las fuentes de fundamentación pueden ser tus almacenes de datos de Vertex AI Search, los datos personalizados que proporciones o la Búsqueda de Google.
API para generar contenido. Usa la API de Generate Content para generar respuestas fundamentadas a las instrucciones de un usuario. Las fuentes de fundamentación pueden ser tus almacenes de datos de Vertex AI Search o la Búsqueda de Google.
API de fundamentación de la verificación
La API de Check grounding determina qué tan fundamentado está un fragmento de texto determinado en un conjunto determinado de textos de referencia. La API puede generar citas de respaldo a partir del texto de referencia para indicar dónde se admite el texto determinado en los textos de referencia. Entre otras cosas, la API se puede usar para evaluar la fundamentación de las respuestas de los sistemas RAG. Además, como función experimental, la API también genera citas contradictorias que muestran dónde no coinciden el texto determinado y los textos de referencia.
Flujo de trabajo: Genera respuestas fundamentadas a partir de datos no estructurados
A continuación, se muestra un flujo de trabajo que describe cómo integrar las APIs de RAG de Vertex AI para generar respuestas fundamentadas a partir de datos no estructurados.
Importa tus documentos no estructurados, como archivos PDF, archivos HTML o imágenes con texto, a una ubicación de Cloud Storage.
Procesa los documentos importados con el analizador de diseño.
El analizador de diseño desglosa los documentos no estructurados en fragmentos y transforma el contenido no estructurado en su representación estructurada. El analizador de diseño también extrae anotaciones de los fragmentos.
Si generaste las respuestas con un modelo de generación de respuestas que no sea de Google, puedes verificar la fundamentación de estas respuestas con el método check grounding.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-08 (UTC)"],[[["\u003cp\u003eVertex AI provides APIs for building Retrieval-Augmented Generation (RAG) applications and search engines, supporting both retrieval and generation stages.\u003c/p\u003e\n"],["\u003cp\u003eFor retrieval, options include Vertex AI Search, building your own using Vertex AI APIs, using an existing search engine, Vertex AI RAG Engine, or leveraging Google Search for Gemini models.\u003c/p\u003e\n"],["\u003cp\u003eFor generation, options include the Grounded Generation API, using Gemini with built-in Google Search grounding, or using models from the Vertex AI Model Garden for full customization.\u003c/p\u003e\n"],["\u003cp\u003eVertex AI's suite of APIs includes the Document AI Layout Parser, Embeddings API, Vector Search, and Ranking API, enabling users to create custom RAG systems with flexibility and control.\u003c/p\u003e\n"],["\u003cp\u003eThe Vertex AI workflow for generating grounded responses from unstructured data involves importing documents, processing with the layout parser, creating text embeddings, indexing with Vector Search, ranking chunks, and generating grounded answers.\u003c/p\u003e\n"]]],[],null,["# Vertex AI APIs for building search and RAG experiences\n\nVertex AI offers a suite of APIs to help you build Retrieval-Augmented\nGeneration (RAG) applications or a search engine. This page introduces those\nAPIs.\n\nRetrieval and generation\n------------------------\n\nRAG is a methodology that enables Large Language Models (LLMs) to generate\nresponses that are grounded to your data source of choice. There are two stages\nin RAG:\n\n1. **Retrieval**: Getting the most relevant facts quickly can be a common search problem. With RAG, you can quickly retrieve the facts that are important to generate an answer.\n2. **Generation:** The retrieved facts are used by the LLM to generate a grounded response.\n\nVertex AI offers options for both stages to match a variety of\ndeveloper needs.\n\nRetrieval\n---------\n\nChoose the best retrieval method for your needs:\n\n- **Vertex AI Search:** Vertex AI Search is a\n Google Search-quality information retrieval engine that can be a\n component of any generative AI application that uses your enterprise data.\n Vertex AI Search works as an out-of-the-box semantic \\& keyword\n search engine for RAG with the ability to process a variety of document\n types and with connectors to a variety of source systems including\n BigQuery and many third party systems.\n\n For more information, see\n [Vertex AI Search](/enterprise-search).\n- **Build your own retrieval:** If you want to build your semantic search, you\n can rely on Vertex AI APIs for components of your custom RAG\n system. This suite of APIs provide high-quality implementations for document\n parsing, embedding generation, vector search, and semantic ranking. Using these\n lower-level APIs gives you full flexibility on the design of your retriever\n while at the same time offering accelerated time to market and high quality\n by relying on lower-level Vertex AI APIs.\n\n For more information, see\n [Build your own Retrieval Augmented Generation](#build-rag).\n- **Bring an existing retrieval** : You can use your existing search as a\n retriever for [grounded generation](/generative-ai-app-builder/docs/grounded-gen).\n You can also use the Vertex APIs for RAG\n to upgrade your existing search to higher quality. For more information, see\n [Grounding overview](/vertex-ai/generative-ai/docs/grounding/overview).\n\n- **Vertex AI RAG Engine**: Vertex AI RAG Engine\n provides a fully-managed runtime for RAG orchestration, which lets\n developers build RAG for use in production and enterprise-ready contexts.\n\n For more information, see [Vertex AI RAG Engine\n overview](/vertex-ai/generative-ai/docs/rag-overview) in the Generative AI\n on Vertex AI documentation.\n- **Google Search**: When you use Grounding with\n Google Search for your Gemini model, then Gemini\n uses Google Search and generates output that is grounded to the\n relevant search results. This retrieval method doesn't require management\n and you get the world's knowledge available to Gemini.\n\n For more information, see [Grounding with\n Google Search](/vertex-ai/generative-ai/docs/multimodal/ground-gemini)\n in the Generative AI on Vertex AI documentation.\n\nGeneration\n----------\n\nChoose the best generation method for your needs:\n\n- **Ground with your data**:\n Generate well-grounded answers to a user's query. The grounded generation\n API uses specialized, fine-tuned Gemini models and is an effective\n way to reduce hallucinations and provide responses grounded to your sources\n or third-party sources including references to grounding support content.\n\n For more information, see\n [Generate grounded answers with RAG](/generative-ai-app-builder/docs/grounded-gen).\n\n You can also ground responses to your Vertex AI Search data using\n Generative AI on Vertex AI. For more information, see\n [Ground with your data](/vertex-ai/generative-ai/docs/multimodal/ground-with-your-data).\n- **Ground with Google Search:** Gemini is Google's most capable\n model and offers out-of-the-box grounding with Google Search. You\n can use it to build your fully-customized grounded generation solution.\n\n For more information, see [Grounding with Google Search](/vertex-ai/generative-ai/docs/multimodal/ground-gemini) in\n the Generative AI on Vertex AI documentation.\n- **Model Garden:** If you want full control and the model of your choice,\n you can use any of the models in\n [Vertex AI Model Garden](/model-garden) for generation.\n\nBuild your own Retrieval Augmented Generation\n---------------------------------------------\n\nDeveloping a custom RAG system for grounding offers flexibility and control at\nevery step of the process. Vertex AI offers a suite of APIs to help you\ncreate your own search solutions. Using those APIs gives you full flexibility on\nthe design of your RAG application while at the same time offering accelerated\ntime to market and high quality by relying on these lower-level\nVertex AI APIs.\n\n- **The Document AI Layout Parser.**\n The Document AI Layout Parser transforms documents in various\n formats into structured representations, making content like paragraphs,\n tables, lists, and structural elements like headings, page headers, and\n footers accessible, and creating context-aware chunks that facilitate\n information retrieval in a range of generative AI and discovery apps.\n\n For more information, see [Document AI Layout Parser](/document-ai/docs/layout-parse-chunk) in the\n *Document AI* documentation.\n- **Embeddings API:** The Vertex AI embeddings APIs let you create\n embeddings for text or multimodal inputs. Embeddings are vectors of\n floating point numbers that are designed to capture the meaning of their\n input. You can use the embeddings to power semantic search using Vector\n search.\n\n For more information, see [Text embeddings](/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings) and\n [Multimodal embeddings](/vertex-ai/generative-ai/docs/embeddings/get-multimodal-embeddings) in the Generative AI on\n Vertex AI documentation.\n- **Vector Search.** The retrieval engine is a key part of your RAG\n or search application. Vertex AI Vector Search is a\n retrieval engine that can search from billions of semantically similar or\n semantically related items at scale, with high queries per second (QPS), high\n recall, low latency, and cost efficiency. It can search over dense\n embeddings, and supports sparse embedding keyword search and hybrid search in\n Public preview.\n\n For more information, see: [Overview of Vertex AI\n Vector Search](/vertex-ai/docs/vector-search/overview) in the\n Vertex AI documentation.\n- **The ranking API.**\n The ranking API takes in a list of documents and reranks those documents\n based on how relevant the documents are to a given query. Compared to\n embeddings that look purely at the semantic similarity of a document and a\n query, the ranking API can give you a more precise score for how well a\n document answers a given query.\n\n For more information, see\n [Improve search and RAG quality with ranking API](/generative-ai-app-builder/docs/ranking).\n- **The grounded generation API.** Use the grounded\n generation API to generate\n well-grounded answers to a user's prompt. The grounding sources can be your\n Vertex AI Search data stores, custom data that you provide, or\n Google Search.\n\n For more information, see [Generate grounded answers](/generative-ai-app-builder/docs/grounded-gen).\n- **The generate content API.** Use the generate content API to generate\n well-grounded answers to a user's prompt. The grounding sources can be your\n Vertex AI Search data stores or Google Search.\n\n For more information, see\n [Ground with Google Search](/vertex-ai/generative-ai/docs/multimodal/ground-with-google-search) or\n [Ground with your data](/vertex-ai/generative-ai/docs/multimodal/ground-with-your-data).\n- **The check grounding API.**\n The check grounding API determines how grounded a given piece of text is in a\n given set of reference texts. The API can generate supporting citations from\n the reference text to indicate where the given text is supported by the\n reference texts. Among other things, the API can be used to assess the\n grounded-ness of responses from a RAG systems. Additionally, as an\n experimental feature, the API also generates contradicting citations that\n show where the given text and reference texts disagree.\n\n For more information, see [Check grounding](/generative-ai-app-builder/docs/check-grounding).\n\nWorkflow: Generate grounded responses from unstructured data\n------------------------------------------------------------\n\nHere's a workflow that outlines how to integrate the Vertex AI RAG APIs\nto generate grounded responses from unstructured data.\n\n1. Import your unstructured documents, such as PDF files, HTML files, or images with text, into a Cloud Storage location.\n2. Process the imported documents using the [layout parser](/document-ai/docs/layout-parse-chunk). The layout parser breaks down the unstructured documents into chunks and transforms the unstructured content into its structured representation. The layout parser also extracts annotations from the chunks.\n3. [Create text embeddings](/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings) for chunks using Vertex AI text embeddings API.\n4. [Index and retrieve](/vertex-ai/docs/vector-search/create-manage-index) the chunk embeddings using Vector Search.\n5. [Rank the chunks](/generative-ai-app-builder/docs/ranking) using the ranking API and determine the top-ranked chunks.\n6. Generate grounded answers based on the top-ranked chunks using the [grounded generation API](/generative-ai-app-builder/docs/grounded-gen) or using the [generate content API](/vertex-ai/generative-ai/docs/multimodal/ground-with-your-data).\n\nIf you generated the answers using an answer generation model other than the\nGoogle models, you can [check the grounding](/generative-ai-app-builder/docs/check-grounding) of these answers\nusing the check grounding method."]]