{"slug": "from-files-to-cited-answers-in-one-api-call-managed-ingestion-and-in-agent", "title": "From Files to Cited Answers in One API Call: Managed Ingestion and SearchDocuments in Agent Retrieval", "summary": "Google added managed ingestion and SearchDocuments to Agent Retrieval (formerly Vector Search 2.0), now in Public Preview, letting developers point a data store at files in Cloud Storage and search them with one API call instead of building their own parsing, chunking, embedding and vector-database pipeline. In Google's tests, 18 Alphabet investor PDFs went from a public Cloud Storage bucket to searchable, page-cited results in about 9 minutes, and 19 minutes of video became searchable by visuals and spoken audio at 0.3 to 0.5 seconds per query. Managed ingestion parses, segments and embeds files with Gemini Embedding 2, while SearchDocuments returns matching passages with page numbers or timestamps, and the data store and SearchDocuments APIs are served over REST at v1beta.", "body_md": "*A guide to the new* *managed ingestion**and SearchDocuments features in* *Agent Retrieval**, for searching PDFs, Office files, and videos without writing an ingestion pipeline.*\n\nBefore an agent can answer a question about your PDFs, someone has to build the pipeline: parse every file, split it into chunks, embed each chunk, write the chunks to a vector database, and then learn that database's schema to query it. For video it gets harder: transcode the files, cut them into clips, embed the frames, and keep track of which second of which video each clip came from.\n\nMost of that code has nothing to do with your application. Two features recently added to Agent Retrieval (formerly Vector Search 2.0), now in Public Preview, take that work off your hands. Managed ingestion builds the pipeline for you: point a data store at files in [Cloud Storage](https://cloud.google.com/storage), and the service parses, segments, and embeds them with [Gemini Embedding 2](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/embedding-2). SearchDocuments, the second new feature, then searches the data store with one API call and returns the matching passages with their page numbers or timestamps. In our tests, 18 Alphabet investor PDFs went from a public Cloud Storage bucket to searchable, page cited results in about 9 minutes, and 19 minutes of video became searchable by both visuals and spoken audio in 0.3 to 0.5 seconds per query, with no parsing, chunking, transcription, or embedding code.\n\nThis guide covers how to create a data store, import documents and videos, and search them with filters, reranking, and audio-aware video search.\n\nPairing managed ingestion with SearchDocuments gives you several immediate benefits:\n\nAgent Retrieval Collections already give you semantic, text, and hybrid search over your own data objects. But you have to produce those data objects yourself, and to query them you need to know how they are stored. Here is what changes when you let a data store do the work:\n\nThe backing Collection is still a regular Agent Retrieval Collection, so you can query it directly whenever you need full control.\n\nA data store holds your files and the configuration that controls how they are parsed and segmented. The data store and SearchDocuments APIs are currently served over REST at v1beta, so the examples use an authorized session from `google-auth`:\n\n``` python\nimport google.auth\nfrom google.auth.transport.requests import AuthorizedSession\ncredentials, _ = google.auth.default(\n    scopes=[\"https://www.googleapis.com/auth/cloud-platform\"]\n)\nsession = AuthorizedSession(credentials)\nPARENT = \"https://vectorsearch.googleapis.com/v1beta/projects/PROJECT_ID/locations/us-east4\"\nsession.post(\n    f\"{PARENT}/dataStores\",\n    params={\"data_store_id\": \"investor-reports\"},\n    json={\n        \"document_type\": \"UNSTRUCTURED\",\n        \"processing_config\": {\n            \"unstructured_processing_config\": {\n                # One segment per page, so results carry page numbers\n                \"segmentation_config\": {\"page_segmentation_config\": {}},\n                \"parsing_config\": {\"digital_parsing_config\": {}},\n            }\n        },\n        # Metadata you can filter on and return in search\n        \"document_metadata_schema\": {\n            \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"doc_type\": {\"type\": \"string\"},\n                    \"year\": {\"type\": \"integer\"},\n                },\n            }\n        },\n    },\n)\n```\n\nTwo segmentation modes are available. **Chunk segmentation** (the default) splits text into chunks of 100 to 500 tokens and works with layout parsing, which also detects tables and headings. **Page segmentation** produces one segment per page. For paginated documents such as PDFs, both modes record page numbers (startPage and endPage) so you can cite pages or filter by page range: page segmentation returns a single page per segment, while chunk segmentation returns the page range each chunk spans.\n\nPoint an import at your files with URI patterns such as `gs://my-bucket/reports/*.pdf`, or with a JSONL manifest when you want to set your own document IDs and attach metadata:\n\n```\n{\"name\": \"projects/PROJECT_ID/locations/us-east4/dataStores/investor-reports/documents/2023-q4-earnings-release\", \"content\": {\"gcsUri\": \"gs://my-bucket/reports/2023q4-earnings-release.pdf\"}, \"metadata\": {\"value\": {\"doc_type\": \"earnings_release\", \"year\": 2023}}}\nsession.post(\n    f\"{PARENT}/dataStores/investor-reports:importDocuments\",\n    json={\n        \"gcs_source\": {\n            \"input_uris\": [\"gs://my-bucket/manifests/docs.jsonl\"],\n            \"source_format\": \"SOURCE_FORMAT_DOCUMENT_JSON\",\n        },\n        \"import_output_config\": {\"error_gcs_prefix\": \"gs://my-bucket/import-errors/run-1/\"},\n    },\n)\n```\n\nThe import runs as a long-running operation. Re-importing the same files updates existing documents instead of duplicating them, and files whose content didn't change are skipped.\n\nSearchDocuments needs only the data store and a text query:\n\n```\nresponse = session.post(\n    f\"{PARENT}/dataStores/investor-reports/documents:search\",\n    json={\n        \"text_query\": {\"text\": \"How much did Google Cloud revenue grow?\"},\n        \"top_k\": 5,\n    },\n).json()\n```\n\nEach result is a segment of a document, with the text, the page, and the source file:\n\n```\n{\n  \"document\": {\n    \"name\": \".../dataStores/investor-reports/documents/2022-annual-report\",\n    \"content\": {\"gcsUri\": \"gs://.../2022_alphabet_annual_report.pdf\"}\n  },\n  \"unstructuredDetails\": {\n    \"contentSnippet\": \"... Google Cloud revenues increased $7.1 billion from 2021 to 2022 ...\",\n    \"pageRange\": {\"startPage\": \"68\", \"endPage\": \"68\"}\n  }\n}\n```\n\n`top_k` and reorders them with the `semantic-ranker-fast@latest` model as Agent Retrieval's `VertexRanker`.\nPass `filter` to search only the segments that match, using the same paths you read back in results:\n\nYou can also pass `document_ids` to search only inside specific files, and `output_fields.metadata` to return each document's metadata with its results. In our test, searching \"What did the CEO say about AI?\" with the page-1 filter returned the CEO quotes from the headline page of five different earnings releases.\n\n```\n\"ranking_spec\": {\"reranking_spec\": {\"enabled\": True}}\n```\n\nFor \"How many employees does Alphabet have?\", plain hybrid search returned two balance sheet pages among the top five, which don't mention employees at all. With reranking on, every top result reported the headcount: the annual report's \"Alphabet had 190,234 employees\" and the \"Number of employees\" row of the quarterly supplemental tables.\n\nVideo works the same way: create a data store with `document_type: VIDEO`, import the files, and call SearchDocuments. The service transcodes each video, splits it into fixed windows, and embeds each window:\n\n```\n\"document_type\": \"VIDEO\",\n\"processing_config\": {\n    \"video_processing_config\": {\n        \"segmentation_config\": {\"fixed_window_config\": {\"segment_duration\": \"20s\"}},\n        \"embedding_config\": {\"audio_mode\": \"ENABLED\"},\n    }\n},\n```\n\nEach result carries the moment it matched:\n\n```\n\"videoDetails\": {\"startOffset\": \"60s\", \"endOffset\": \"80s\"}\n```\n\nWe imported five Google sample videos (about 19 minutes in total) and searched them with scene descriptions. \"Cucumbers being sorted by a machine\" returned 03:20-03:40 of the machine learning video, where a farm's sorting machine grades cucumbers, without any tags or captions. Searches returned in 0.3 to 0.5 seconds.\n\nBy default (`audio_mode: DISABLED`), only the frames are embedded, so a query matches what is shown. With `ENABLED`, the first audio track is embedded together with the frames. We imported the same videos into two data stores and asked both about statements from a keynote, spoken while the picture shows the speaker:\n\nOnly the audio-enabled data store found the right moments.\n\n`force=true` and `backing_collection_deleted=true`, or its Collection is left behind. Deletion runs in the background and took about 20 minutes in our tests.`reranking_spec` is not supported on `VIDEO` data stores.\nThe rule of thumb: **If your data is files, let a data store ingest them and search with SearchDocuments. Drop down to the Collection only when you need control the data store doesn't give you.**\n\nManaged ingestion doesn't change what good retrieval needs: well-segmented content, good embeddings, and the right filters. What changes is who builds it. Instead of maintaining parsers, chunkers, embedding jobs, and a schema, you point a data store at a bucket and get back segments that are ready to cite.\n\nFor agents, that means a retrieval tool that returns where each answer came from, a page in a PDF or a moment in a video, with one API call.\n\n**Try it yourself:** the [document notebook](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/embeddings/agent-retrieval-search-documents.ipynb) ingests 18 Alphabet investor PDFs and walks through filters and reranking, and the [video notebook](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/embeddings/agent-retrieval-video-search.ipynb) searches five sample videos with an inline player and compares audio modes.", "url": "https://wpnews.pro/news/from-files-to-cited-answers-in-one-api-call-managed-ingestion-and-in-agent", "canonical_source": "https://developers.googleblog.com/from-files-to-cited-answers-in-one-api-call-managed-ingestion-and-searchdocuments-in-agent-retrieval/", "published_at": "2026-11-24 22:41:51.602858+00:00", "updated_at": "2026-11-24 22:41:53.925692+00:00", "lang": "en", "topics": ["ai-agents", "ai-products", "developer-tools", "large-language-models"], "entities": ["Google", "Agent Retrieval", "Vector Search 2.0", "SearchDocuments", "Gemini Embedding 2", "Cloud Storage"], "also_reported_by": [], "takeaway": "Pointing an Agent Retrieval data store at Cloud Storage files with page segmentation makes 18 PDFs searchable with page citations in about 9 minutes and 19 minutes of video searchable by visuals and audio at 0.3 to 0.5 seconds per query, with no parsing, chunking, transcription or embedding code.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/from-files-to-cited-answers-in-one-api-call-managed-ingestion-and-in-agent", "markdown": "https://wpnews.pro/news/from-files-to-cited-answers-in-one-api-call-managed-ingestion-and-in-agent.md", "text": "https://wpnews.pro/news/from-files-to-cited-answers-in-one-api-call-managed-ingestion-and-in-agent.txt", "jsonld": "https://wpnews.pro/news/from-files-to-cited-answers-in-one-api-call-managed-ingestion-and-in-agent.jsonld"}}