The Research Report
Gemini File Search Goes Multimodal: What It Means for RAG
Google just made retrieval-augmented generation a lot simpler. On May 5, the Gemini API's File Search tool added three features that change how developers build RAG systems: multimodal retrieval with images, custom metadata filtering, and page-level citations. These are not incremental improvements. They eliminate whole categories of plumbing code that production RAG systems currently need.
Here is what changed, how it works, and why it matters.
What File Search Was Before
The Gemini API has had a File Search tool since November 2025. It was a managed RAG pipeline. You uploaded documents, the API chunked them, generated embeddings, built an index, and handled retrieval at query time. You passed a file_search tool alongside your prompt, and the model pulled relevant chunks from your data to generate a grounded response.
It worked well for text. That was the problem. It only worked for text.
If your documents contained charts, product photos, diagrams, or any visual content, you had two choices. You could ignore the images and lose information. Or you could build a separate vision pipeline to handle them. Both options were bad. The first threw away data. The second doubled your infrastructure complexity.
What Changed on May 5
Three things landed at once.
Multimodal Retrieval
File Search now supports Gemini Embedding 2 as its embedding model. This is Google's first natively multimodal embedding model, released in March 2026. It maps text, images, video, audio, and documents into a single 3072-dimensional vector space.
What this means in practice: you upload images alongside your PDFs, and the system indexes both in the same store. When you query, the model retrieves relevant text chunks and relevant images from the same search. No separate pipelines. No OCR workarounds. No caption-and-index hacks.
You create a store with the multimodal embedding model like this:
from google import genai
from google.genai import types
client = genai.Client()
file_search_store = client.file_search_stores.create(
config={
"display_name": "product-catalog",
"embedding_model": "models/gemini-embedding-2"
}
)
The embedding_model parameter is the key decision. Omit it and you get gemini-embedding-001, which is cost-optimized for text-only workloads. Specify gemini-embedding-2 and you get multimodal retrieval. You cannot change this later. Choose at creation time.
Then you upload files. Both documents and standalone images go through the same method:
# Upload a PDF
operation = client.file_search_stores.upload_to_file_search_store(
file_search_store_name=file_search_store.name,
file="product_catalog.pdf",
config={"display_name": "Product Catalog"}
)
# Upload images
for image_file in ["sneaker_red.png", "sneaker_blue.jpeg"]:
op = client.file_search_stores.upload_to_file_search_store(
file_search_store_name=file_search_store.name,
file=image_file,
config={"display_name": image_file}
)
Behind the scenes, the API chunks documents, generates embeddings for both text and images, and indexes everything in the same store. Images embedded inside PDFs get native embedding too. No extraction step required.
Querying works the same way as before:
response = client.models.generate_content(
model="gemini-3-flash-preview",
contents="Which sneakers come in red?",
config={
"tools": [{
"file_search": {
"file_search_store_names": [file_search_store.name]
}
}]
}
)
One tool call. One store. Text and images handled together.
Custom Metadata Filtering
The second feature addresses a problem every RAG system hits at scale: noise. When your store contains thousands of documents across departments, product lines, and time periods, a raw similarity search returns garbage. You need to scope the search.
File Search now lets you attach key-value metadata to documents at upload time. Then you filter on that metadata at query time.
# Upload with metadata
op = client.file_search_stores.upload_to_file_search_store(
file_search_store_name=file_search_store.name,
file="shoes_collection.pdf",
config={
"display_name": "Spring 2026 Shoes",
"custom_metadata": [
{"key": "category", "string_value": "footwear"},
{"key": "season", "string_value": "spring-2026"},
{"key": "price_tier", "numeric_value": 2}
]
}
)
# Query with a filter
response = client.models.generate_content(
model="gemini-3-flash-preview",
contents="Do you have blue spring shoes?",
config={
"tools": [{
"file_search": {
"file_search_store_names": [file_search_store.name],
"metadata_filter": 'category="footwear" AND season="spring-2026"',
}
}]
}
)
Metadata supports string values and numeric values. The filter syntax uses AND logic. This is a simple but powerful feature. Before this, you would need to maintain separate stores per category, or implement your own pre-filtering logic, or accept the noise. Now you push the filtering into the retrieval step where it belongs.
Page-Level Citations
The third feature solves the trust problem. RAG systems give you answers. Users need to verify where those answers came from. File Search now includes page numbers in its grounding metadata.
grounding = response.candidates[0].grounding_metadata
for chunk in grounding.grounding_chunks:
ctx = chunk.retrieved_context
if ctx.media_id:
# Image citation
print(f"Cited image: {ctx.title}")
print(f" Media ID: {ctx.media_id}")
blob = client.file_search_stores.download_media(
media_id=ctx.media_id
)
else:
# Text citation with page number
print(f"Cited text: {ctx.title}")
if ctx.page_number:
print(f" Page: {ctx.page_number}")
For multimodal stores, citations also include a media_id for referenced images. You can download the cited image directly. This means you can show users the actual visual evidence the model used, not just a text description of it.
The grounding supports feature ties specific claims in the model's response to specific source chunks. You can see which sentence came from which document and which page. For compliance-heavy industries, this is not a nice-to-have. It is a requirement.
Why This Matters for RAG Architecture
These three features together change the shape of a production RAG system. Here is how.
Before: The Multi-Pipeline Problem
A typical production RAG system that needed to handle both text and images looked something like this:
- A text ingestion pipeline: chunk documents, embed with a text embedding model, store in a vector database
- An image pipeline: extract images from documents, generate captions or descriptions using a vision model, embed those captions, store separately
- A query router: determine whether a user's question needs text results, image results, or both, then hit the right pipeline
- A fusion layer: merge results from both pipelines, rank them, and pass to the LLM
- A citation system: track which source document and page each chunk came from, then surface that to users
Each piece needs monitoring, error handling, and maintenance. The image pipeline is especially fragile because it depends on caption quality. Bad captions mean bad retrieval.
After: One Store, One Call
With multimodal File Search:
- One store holds both text and images
- One embedding model handles both modalities
- One query retrieves from both
- Citations come built-in with page numbers and image references
The entire image pipeline disappears. The query router disappears. The fusion layer disappears. You keep the citation system, but Google handles it for you.
This is not a small simplification. It removes the parts of RAG that are hardest to get right and most expensive to maintain.
Where It Still Falls Short
A few things to be aware of.
Audio and video formats are not currently supported in File Search stores, even though Gemini Embedding 2 handles them as standalone inputs. This is a File Search limitation, not an embedding model limitation. If you need audio or video retrieval, you still need a custom pipeline.
The metadata filter syntax supports AND logic. Complex boolean queries with OR and NOT are not available yet. For sophisticated filtering, you may need to combine metadata filters with application-level pre-processing.
Chunking configuration exists but is limited to a white-space strategy with token limits. If you need semantic chunking or domain-specific splitting, you still need to pre-process your documents before upload.
The embedding model choice is permanent. You cannot migrate a store from text-only to multimodal after creation. Plan your store architecture before you start.
Practical Use Cases
The combination of multimodal retrieval, metadata filtering, and page citations opens up specific scenarios that text-only RAG cannot handle.
Visual product search. Index a product catalog with images and spec sheets. Users search by visual similarity or natural language descriptions. "Show me red running shoes under $100" works against the actual product photos, not just text descriptions.
Technical documentation. Retrieve specific charts, architecture diagrams, or data visualizations from papers and reports. The citation system points users to the exact page where a diagram appears.
Insurance and claims processing. Combine structured forms with damage photos in a single store. Adjusters can query both the text of a policy and the visual evidence of a claim in one search.
Design systems. Make component libraries searchable by visual appearance, not just naming conventions. A designer can describe what they want and get back matching components with screenshots.
Real estate listings. Match properties based on floor plans, interior photos, and visual preferences. The metadata filter can scope results to a specific neighborhood or price range.
Getting Started
Here is the minimal path to a working multimodal File Search setup.
1. Install the SDK.
pip install -U google-genai
2. Create a multimodal store.
from google import genai
client = genai.Client()
store = client.file_search_stores.create(
config={
"display_name": "my-multimodal-store",
"embedding_model": "models/gemini-embedding-2"
}
)
Remember: omit embedding_model and you get text-only. Specify it and you get multimodal. No going back.
3. Upload documents and images.
import time
files = ["catalog.pdf", "product_photo.png", "diagram.jpg"]
for f in files:
op = client.file_search_stores.upload_to_file_search_store(
file_search_store_name=store.name,
file=f,
config={
"display_name": f,
"custom_metadata": [
{"key": "source", "string_value": "q1-2026"}
]
}
)
while not op.done:
time.sleep(5)
op = client.operations.get(op)
4. Query with grounding.
response = client.models.generate_content(
model="gemini-3-flash-preview",
contents="What does the diagram on page 3 show?",
config={
"tools": [{
"file_search": {
"file_search_store_names": [store.name],
"metadata_filter": 'source="q1-2026"'
}
}]
}
)
print(response.text)
# Check citations
grounding = response.candidates[0].grounding_metadata
for chunk in grounding.grounding_chunks:
ctx = chunk.retrieved_context
if ctx.page_number:
print(f"Source: {ctx.title}, Page {ctx.page_number}")
5. Try the interactive demo. Google has an example app in AI Studio that lets you chat with your documents and image library without writing code. Upload PDFs and images, ask questions, and see citations in real time.
Links to get started:
- File Search documentation
- File Search quickstart notebook
- Developer guide on dev.to
- AI Studio example app
- Get an API key
Pricing
The cost model is straightforward:
- Indexing: You pay for embedding generation at indexing time, at standard Gemini Embedding 2 pricing
- Storage: Free
- Query-time embeddings: Free
- Retrieved tokens: Charged as regular context tokens
This means the main cost driver is how much data you index. Queries themselves are cheap because the storage and query-time embedding costs are zero. For production systems with high query volumes relative to data volume, this is a good deal.
The Bigger Picture
Google is making a specific bet with these updates. The bet is that most developers do not want to build and maintain RAG infrastructure. They want to upload data, ask questions, and get grounded answers. File Search is Google's answer to that desire.
The competition is not other managed RAG services. It is the homegrown pipeline that every team builds once and regrets forever. The chunking logic, the embedding model selection, the vector database operations, the re-ranking, the citation tracking. File Search absorbs all of that into the API layer.
Multimodal support is the move that makes this competitive with custom pipelines. Before this update, File Search was attractive for simple text use cases but fell short for any application that needed visual retrieval. Now it covers the most common gap. Images inside PDFs. Standalone product photos. Charts and diagrams. All indexed and searchable alongside text in a single store.
Page-level citations and metadata filtering fill in the remaining pieces that production systems need. Without citations, you cannot verify answers. Without metadata filtering, you cannot scale retrieval across a large, diverse document set.
The remaining gaps are real. No audio or video support in File Search yet. Limited metadata filter syntax. No migration path between embedding models. These constraints will matter for some teams. But for the majority of RAG use cases, the tradeoff is clear. Let Google handle the infrastructure. Focus on the application.
Suggested title: Gemini File Search Goes Multimodal: What Changed and Why It Matters
Word count: 1,748
Citations:
- Google blog post announcing multimodal File Search: https://blog.google/innovation-and-ai/technology/developers-tools/expanded-gemini-api-file-search-multimodal-rag/
- Google developer guide on dev.to: https://dev.to/googleai/multimodal-rag-with-the-gemini-api-file-search-tool-a-developer-guide-5878
- Gemini Embedding 2 announcement: https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-embedding-2/
- Gemini Embedding 2 documentation (Vertex AI): https://docs.cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/embedding-2
- File Search API documentation: https://ai.google.dev/gemini-api/docs/file-search
- File Search quickstart notebook: https://github.com/google-gemini/cookbook/blob/main/quickstarts/File_Search.ipynb
- Original File Search launch post (Nov 2025): https://blog.google/technology/developers/file-search-gemini-api/
Fact-check notes:
- Audio and video not supported in File Search stores yet. Confirmed in the dev.to guide, which says "Audio and video formats are currently not supported." Verify this is still current before publishing.
- Gemini Embedding 2 supports audio and video as standalone inputs, but File Search does not accept those formats. This distinction is important and should be clear in the article.
- The metadata filter syntax uses AND logic. I did not find documentation for OR or NOT operators. Confirm before stating this definitively.
- Pricing details reference Gemini Embedding 2 pricing. Check https://ai.google.dev/gemini-api/docs/pricing for current rates before publishing.
- The AI Studio example app URL (acb0ca81-7130-43ae-a31f-bedd96d28294) was mentioned in the dev.to guide. Verify it works before publishing.
gemini-3-flash-previewis the model used in code examples from the official guide. Confirm this is the current recommended model name.