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…
Об этом скилле
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 required)
- Semantic Search: Vector-based search understands meaning and context, not just keywords
- Built-in Citations: Grounding metadata automatically points to specific document sections
- Custom Metadata: Filter queries by up to 20 custom key-value pairs per document
- Configurable Chunking: Control chunk size (tokens) and overlap for precision tuning
- Cost-Effective: $0.15/1M tokens for one-time indexing, free storage (up to limits), free query-time embeddings
When to Use This Skill
Ideal Use Cases:
- Building customer support knowledge bases (manuals, FAQs, troubleshooting guides)
- Creating internal documentation search (company wikis, policies, procedures)
- Legal/compliance document analysis (contracts, regulations, case law)
- Research tools (academic papers, articles, textbooks)
- Code documentation search (API docs, SDK references, examples)
- Product information retrieval (specs, datasheets, user guides)
Use File Search When:
- ✅ You want a fully managed RAG solution (no vector DB setup)
- ✅ Cost predictability matters (pay-per-indexing, not continuous storage fees)
- ✅ You need broad file format support (100+ types out of the box)
- ✅ Citations are important (built-in grounding metadata)
- ✅ Simple deployment is priority (single API setup)
- ✅ Documents are relatively static (updates are infrequent)
Use Cloudflare Vectorize/AutoRAG Instead When:
- ✅ Global edge performance is critical (low-latency worldwide)
- ✅ Building full-stack apps on Cloudflare (Workers, R2, D1)
- ✅ You need custom embedding models or retrieval logic
- ✅ Real-time data updates from R2 or external sources
Use OpenAI Files API Instead When:
- ✅ Already using OpenAI Assistants API (conversational threads)
- ✅ Need to attach knowledge to persistent assistant threads
- ✅ Working with very large file collections (10,000+ files per store)
- ✅ Prefer storage-based pricing model ($0.10/GB/day)
When NOT to Use This Skill
Skip this skill if:
- ❌ Need custom embedding models (File Search locks you to Gemini Embeddings)
- ❌ Documents update frequently (no streaming updates, must delete+re-upload)
- ❌ Building conversational AI agents (use OpenAI Assistants or Claude MCP instead)
- ❌ Need BM25/hybrid search (File Search is vector-only)
- ❌ Require advanced reranking configuration (automatic only)
- ❌ Need to parse images/tables from PDFs (text extraction only)
Prerequisites
1. Google AI API Key
Create an API key at https://aistudio.google.com/apikey
Free Tier Limits:
- 1 GB storage (total across all file search stores)
- 1,500 requests per day
- 1 million tokens per minute
Paid Tier Pricing:
- Indexing: $0.15 per 1M input tokens (one-time)
- Storage: Free (Tier 1: 10 GB, Tier 2: 100 GB, Tier 3: 1 TB)
- Query-time embeddings: Free (retrieved context counts as input tokens)
2. Node.js Environment
Minimum Version: Node.js 18+ (v20+ recommended)
node --version # Should be >=18.0.0
3. Install @google/genai SDK
npm install @google/genai
# or
pnpm add @google/genai
# or
yarn add @google/genai
Current Stable Version: 0.21.0+ (verify with npm view @google/genai version)
4. TypeScript Configuration (Optional but Recommended)
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
"skipLibCheck": true
}
}
Common Errors Prevented
This skill prevents 8 common errors encountered when implementing File Search:
Error 1: Document Immutability
Symptom:
Error: Documents cannot be modified after indexing
Cause: Documents are immutable once indexed. There is no PATCH or UPDATE operation.
Prevention: Use the d
Установить google-gemini-file-search в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadWriteGlobGrepWebFetchВложенные файлы
FAQ
Что делает скилл 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 configuration (500 tokens/chunk recommended), metadata limits (20 key-value pairs max), indexing cost surprises ($0.15/1M tokens one-time), operation polling timeouts (wait for done: true), force delete errors, or model compatibility (Gemini 2.5 Pro/Flash only).
Как установить скилл google-gemini-file-search?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл google-gemini-file-search запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic