智算多多
官方邮箱:service@zsdodo.com

公司地址:北京市丰台区南四环西路188号总部基地三区国联股份数字经济总部


京公网安备11010602202532号 We’re introducing three major updates to the Gemini API File Search tool: multimodal support, custom metadata and page-level citations. These features help developers bring structure to unstructured data for efficient, verifiable RAG.
File Search now processes images and text together. Powered by the Gemini Embedding 2 model, the tool understands native image data, providing your agents contextual awareness.
Think of a creative agency trying to dig up a specific visual asset. Instead of relying on keywords or filenames, your app can search an entire archive for an image matching a specific emotional tone or visual style described in a natural language brief.
See how developers are already using it:
Dumping files into a database is easy. Finding the right one at scale is the real challenge. Custom metadata allows you to attach key-value labels to your unstructured data — things like department: Legal or status: Final.
By applying metadata filters at query time, your application can scope requests to the data slice required. This significantly reduces noise from irrelevant documents, increasing both the speed and accuracy of your RAG workflows.
When your application pulls an answer from a massive PDF, users need to verify exactly where that answer came from.
File Search now ties the model’s response directly to the original source. It captures the page number for every piece of indexed information. This level of granularity allows you to point users directly to the right spot, which helps build trust and makes your tool immediately useful for rigorous fact-checking.
We want to make it as easy as possible to store and retrieve the data that makes your ideas work. The File Search tool handles the heavy infrastructure so you can focus on building the product.
Uploading files and searching across them is simple:
from google import genai
client = genai.Client()
# Initialize a multimodal file store
store = client.file_search_stores.create(
config={
"display_name": "my-knowledge-base",
"embedding_model": "models/gemini-embedding-2"
}
)
print(f"Created store: {store.name}")
# Upload documents and images
operation = client.file_search_stores.upload_to_file_search_store(
file="example.png",
file_search_store_name=store.name,
config={"display_name" : "my example image"}
)
# Now the system can search across your files
response = client.models.generate_content(
model="gemini-3-flash-preview",
contents="What files are in my knowledge base?",
config={
"tools": [{
"file_search": {
"file_search_store_names": [file_search_store.name]
}
}]
}
)
print(response.text)
Explore more code snippets in our developer guide and Gemini API documentation to learn how to build with File Search.
