Introducing the File Search Tool in Gemini API
Today, we're launching the File Search Tool, a fully managed RAG system built directly into the Gemini API that abstracts away the retrieval pipeline so you can focus on building. File Search provides a simple, integrated and scalable way to ground Gemini with your data, delivering responses that are more accurate, relevant and verifiable.
To make File Search simple and affordable for all developers, we’re making storage and embedding generation at query time free of charge. You only pay for creating embeddings when you first index your files, at a fixed rate of $0.15 per 1 million tokens (or whatever the applicable embedding model cost is, in this case gemini-embedding-001). This new billing paradigm makes the File Search Tool both significantly easier and very cost-effective to build and scale with.
How File Search works
File Search accelerates your development workflow by handling the complexities of RAG for you. It provides a user-friendly alternative to a self-managed setup.
- Simple, integrated developer experience: We've streamlined the entire RAG process. File Search automatically manages file storage, optimal chunking strategies, embeddings and the dynamic injection of retrieved context into your prompts. It works within the existing `generateContent` API, making it easy to adopt.
- Powerful vector search: Powered by our latest state-of-the-art Gemini Embedding model, File Search uses vector search to understand the meaning and context of a user's query. It can find relevant information from your documents, even if the exact words aren't used.
- Built-in citations: The model’s responses automatically include citations that specify which parts of your documents were used to generate the answer, simplifying verification.
- Support for a wide range of formats: You can build a comprehensive knowledge base using a vast array of file formats, including PDF, DOCX, TXT, JSON and many common programming language file types (see the full list of supported formats in the docs)
You can see the File Search Tool in action through one of our new demo app in Google AI Studio (needs a paid API key).
Ask the Manual demo app powered by the new File Search tool in Gemini API
How developers are using File Search
Developers in our early access program are already using it to build incredible things from intelligent support bots, to internal knowledge assistants and creative content discovery platforms. Hear more from an early access developer.
Beam, an AI-driven game generation platform developed by Phaser Studio, is seeing strong early results. Beam integrates file search into its workflow, running thousands of searches daily against a growing library of template data. File Search routinely handles parallel queries across all corpora, combining results in under 2 seconds, a significant improvement over manual cross-referencing that previously took hours.
Get started with the File Search Tool
You can start building with File Search right now:
Head over to the File Search documentation to learn more or check out our demo app in Google AI Studio and remix it to make it your own.