Before writing any agent code, you need a Google Cloud project, the demo repository, and a Gemini API key. This page walks you through each step. The setup takes around ten minutes and usesDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/derailed-dash/gemini-file-search-demo/llms.txt
Use this file to discover all available pages before exploring further.
uv as the Python package manager — either via make install if you are on Linux, macOS, or WSL, or directly via uv sync on Windows.
Create a Google Cloud project
You need a Google Cloud project to run this codelab. You can use an existing project or create a new one.Make sure billing is enabled on your project. See the billing verification guide if you are unsure how to check the billing status.
Completing this codelab is not expected to cost more than a few pennies.
Clone the demo repo
Run the following commands from your terminal, or from the terminal integrated into Google Cloud Shell Editor. Cloud Shell is convenient because all required tools are pre-installed.The repository has this structure:
Set up your development environment
Install the project dependencies using
uv. The --extra jupyter flag includes the Jupyter kernel needed to run the notebook in a later step.make is available on Linux, macOS, and WSL. If you are on Windows without WSL, use the uv sync command directly.make install also checks for uv and installs it automatically if it is not already present.Create a Gemini API key
To use the Gemini Developer API — which is required for the Gemini File Search Tool — you need a Gemini API key.The easiest way to obtain one is through Google AI Studio, which provides a convenient interface for creating and managing API keys linked to your Google Cloud project. Follow the API key guide for the specific steps.Once your key is created, copy it and keep it somewhere safe. You will use it in the next step.
Configure your .env file
The repo includes an Open The three variables configure the following:
.env.template file. Copy it to a new file called .env:.env and replace your-api-key with your actual Gemini API key. The file should look like this:.env
| Variable | Value | Purpose |
|---|---|---|
GEMINI_API_KEY | Your API key from Google AI Studio | Authenticates requests to the Gemini Developer API |
MODEL | gemini-2.5-flash | The Gemini model used by all agents in this codelab |
STORE_NAME | demo-file-store | The display name for your Gemini File Search Store |