google-gemini-file-search
Build document Q&A and searchable knowledge bases with Google Gemini File Search - fully managed RAG with automatic chunking, embeddings, and citations. Upload 100+ file formats (PDF, Word, Excel, code), configure semantic search, and query with natural language. Use when: building document Q&A systems, creating searchable knowledge bases, implementing semantic search without managing embeddings, indexing large document collections (100+ formats), or troubleshooting document immutability errors (delete+re-upload required), storage quota issues (3x input size for embeddings), chunking configura
npx skills add majiayu000/claude-skill-registry --skill google-gemini-file-search --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Instructs the agent to set up Google Gemini File Search as a fully managed retrieval-augmented generation (RAG) system, enabling uploading 100+ file formats, automatic embeddings, semantic search, and built-in citations. Provides templates and configurations for multiple deployment scenarios and includes guidance to avoid common errors (immutability, storage quotas, chunking, metadata limits, pricing, polling, force delete, and model compatibility).
How it works
The skill guides the agent through:
- Initializing a GoogleGenAI client with an API key.
- Creating a File Search Store to hold documents and optional metadata.
- Uploading documents to the store with a configurable chunking strategy, custom metadata (up to 20 fields), and awareness of storage/input token considerations (multiplier ~3x for embeddings/metadata).
- Polling the asynchronous upload operation until done: true, and handling potential errors.
- Managing stores with force delete when non-empty and ensuring use of Gemini 2.5 Pro/Flash models for compatibility.
- Estimating costs and storage prior to indexing based on file sizes and tokenization assumptions.
- Providing step-by-step code examples for Upload, List, Delete, and model usage using the @google/genai SDK.
When to use it
Use this skill when you need a fully managed document search and Q&A system that does not require a separate vector DB, supports many file formats, provides built-in citations, and aims for predictable indexing costs and simple deployment. It is particularly suitable for building customer support knowledge bases, internal documentation search, legal/compliance document analysis, research tools, code documentation search, and product information retrieval.
What it can touch
- Tools: Bash, Read, Write, Glob, Grep, WebFetch are declared as allowed-tools in the frontmatter. The skill relies on the @google/genai SDK and standard Node.js modules for file I/O and HTTP interactions. It references commands and file names in code blocks exactly as shown (e.g.,
ai.fileSearchStores.create,uploadToFileSearchStore,ai.operations.get,gemini-2.5-flash).
Caveats
- Immutability of indexed documents means updates require a delete+re-upload pattern.
- Storage quanta are approximately 3x the input size due to embeddings and metadata.
- Indexing costs are one-time per input token at $0.15/1M tokens.
- File Search stores with documents require force: true to delete.
- File Search supports Gemini 2.5 Pro/Flash models; Gemini 1.5 is not supported.
- Uploads are asynchronous; polling is required to determine when indexing completes.
- Chunking configuration is adjustable; recommended defaults vary by content type (e.g., 500 tokens per chunk with 50 overlap for technical docs).
# Google Gemini File Search Setup ## Overview Google Gemini File Search is a fully managed RAG (Retrieval-Augmented Generation) system that eliminates the need for separate vector databases, custom chunking logic, or embedding generation code. Upload documents (PDFs, Word, Excel, code files, etc.) and query them using natural language—Gemini automatically handles intelligent chunking, embedding with its optimized model, semantic search, and citation generation. **What This Skill Provides:** - Complete setup guide for @google/genai File Search API - TypeScript/JavaScript SDK configuration patterns - Working templates for 3 deployment scenarios (Node.js, Cloudflare Workers, Next.js) - 8 documented common errors with prevention strategies - Chunking best practices for optimal retrieval - Cost optimization techniques - Comparison guide (vs Cloudflare Vectorize, OpenAI Files API, Claude MCP) **Key Features of File Search:** - **100+ File Formats**: PDF, Word (.docx), Excel (.xlsx), PowerPoint (.pptx), Markdown, JSON, CSV, code files (Python, JavaScript, TypeScript, Java, C++, Go, Rust, etc.) - **Automatic Embeddings**: Uses Google's Gemini Embedding model (no custom embedding code requi
- Overview
- When to Use This Skill
- When NOT to Use This Skill
- Prerequisites
- 1. Google AI API Key
- 2. Node.js Environment
- 3. Install @google/genai SDK
- 4. TypeScript Configuration (Optional but Recommended)
- Common Errors Prevented
- Error 1: Document Immutability
- Error 2: Storage Quota Exceeded
- Error 3: Incorrect Chunking Configuration
- Error 4: Metadata Limits Exceeded
- Error 5: Indexing Cost Surprises
node --version # Should be >=18.0.0 npm install @google/genai or pnpm add @google/genai yarn add @google/genai cd templates/basic-node-rag npm install npm run dev cd templates/cloudflare-worker-rag npx wrangler deploy
What does the google-gemini-file-search skill do?
Build document Q&A and searchable knowledge bases with Google Gemini File Search - fully managed RAG with automatic chunking, embeddings, and citations. Upload 100+ file formats (PDF, Word, Excel, code), configure semantic search, and query with natural language. Use when: building document Q&A systems, creating searchable knowledge bases, implementing semantic search without managing embeddings, indexing large document collections (100+ formats), or troubleshooting document immutability errors (delete+re-upload required), storage quota issues (3x input size for embeddings), chunking configura
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill google-gemini-file-search --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
