gemini_file_search
Author: r3-yamauchi
Version: 0.0.1
Type: tool
English | Japanese
Description
brings Google's Gemini File Search capabilities to your Dify workflows. This plugin provides nine focused tools for managing file search stores and performing semantic search with RAG (Retrieval-Augmented Generation):
- Store Management: Create, list, view, and delete file search stores
- Document Ingestion: Upload files with automatic chunking and embedding
- Document Visibility & Hygiene: List, inspect, and remove the files that live inside a store
- Semantic Search: Query indexed documents with AI-generated answers and citations
The source code of this plugin is available in the GitHub repository.
Features
Tier 1: Core RAG Functionality
- Create Store (): Initialize new file search stores with optional display names
- Upload File (): Upload and import files directly with automatic chunking, embedding, and indexing
- Search (): Perform semantic search across indexed documents with AI-generated answers and citations
Tier 2: Store Management
- List Stores (): View all file search stores in your project
- Get Store Details (): Inspect specific store properties and metadata
- Delete Store (): Remove stores and their data permanently
Tier 3: Document Visibility
- List Files (): Enumerate the documents stored in a given file search store with paging controls
- Get File Details (): Retrieve metadata, ingestion state, and timestamps for a single document
- Delete File (): Remove individual documents without touching the rest of the store
Key Capabilities
- Automatic Chunking: Files are automatically split into optimal chunks for embedding
- Custom Metadata: Tag documents with searchable metadata (author, date, category, etc.)
- Metadata Filtering: Search within document subsets using filter expressions
- Citation Support: AI answers include references to source documents
- Configurable Chunking: Customize token limits and overlap for fine-grained control
- Multi-Model Support: Works with gemini-2.5-flash and gemini-2.5-pro
- Synchronous Operation: All long-running operations poll automatically until completion
Prerequisites
- Dify SaaS or self-hosted instance with plugin support enabled
- Google Gemini API key from Google AI Studio
- Supported file formats: PDF, TXT, DOCX, Markdown, code files, and many more
Installation & Setup
- Install the plugin from the Dify Marketplace or upload this package manually
- Configure provider credentials:
- Gemini API Key (required): Your API key from Google AI Studio
- Default Model (optional): Defaults to
- Add tool nodes to your workflow and configure parameters as described below
Tool Parameters
1. Create File Search Store ()
Creates a new file search store for storing document embeddings.
Returns: Store name (e.g., ), display name, creation timestamp
2. Upload File ()
Upload and import a file with automatic chunking and indexing.
Returns: Operation status, store name, display name, completion details, and (document resource name) for downstream tools
Example metadata (can be provided as JSON text or list objects):
Note: Gemini File Search currently enforces a 100 MB per-file limit. The upload tool validates this locally and will raise an error before calling the API if a file exceeds the limit.
3. Search ()
Perform semantic search with AI-generated answers.
Returns: AI-generated answer, citations with source references, grounding metadata
Example filter syntax:
- - Exact match
- - Numeric match
- - Combined filters
4. List Stores ()
List all file search stores in your project.
No parameters required
Returns: Array of stores with names, display names, and creation timestamps
5. Get Store Details ()
Get detailed information about a specific store.
Returns: Store name, display name, creation time, update time
6. Delete Store ()
Delete a file search store and all its data permanently.
Returns: Deletion status
7. List Files ()
List the documents that currently reside in a specific file search store.
Returns: Array of document metadata (name, display name, state, size, timestamps), count, and for pagination
8. Get File Details ()
Retrieve metadata and ingestion status for a single document.
Note: Provide either or . If both are supplied, takes precedence.
Returns: Document metadata including ingestion state, file size, timestamps, and custom metadata
9. Delete File ()
Delete one document inside a store without removing the entire store.
Returns: Deletion status with store name, document name, and whether force mode was used
Workflow Examples
Example 1: Document Upload and Search
Example 2: Filtered Search with Metadata
Example 3: Store Management
Supported File Formats
Gemini File Search supports a wide range of file formats including:
- Documents: PDF, DOCX, ODT, TXT, Markdown, RTF
- Spreadsheets: XLSX, CSV, TSV
- Presentations: PPTX
- Code: Python, JavaScript, Java, C++, Go, Rust, and many more
- Data: JSON, XML, YAML, SQL
See the Gemini API documentation for the complete list.
Rate Limits & Quotas
- Max file size: 100 MB per document
- Stores per project: 10
- Total storage (tier-dependent):
- Free: 1 GB
- Tier 1: 10 GB
- Tier 2: 100 GB
- Tier 3: 1 TB
- Recommended store size: < 20 GB per store for optimal retrieval latency
Pricing
- Indexing: $0.15 per million tokens (based on embedding pricing)
- Storage: Free
- Query-time embeddings: Free
- Retrieved document tokens: Charged as normal context tokens
Troubleshooting
Privacy Policy
See PRIVACY.md [blocked] for detailed information about data handling and security.
Data Handling
This plugin processes:
- Files: Uploaded documents are sent to Gemini API for chunking and embedding
- API Credentials: Gemini API key is stored securely in plugin settings
- Store IDs: File search store names are used to organize embeddings
Storage
- Uploaded files (via Files API) are deleted after 48 hours
- File search store data persists until manually deleted
- No data is stored locally by the plugin
Security
- All API communications use HTTPS encryption
- API keys are stored securely by Dify's credential management system
License
This project is released under the MIT License [blocked].