app icon
Gemini File Search
0.0.1

Manage Gemini File Search Stores and perform semantic search with RAG using Google's Gemini API

r3-yamauchi/gemini_file_search415 installs

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

  1. Install the plugin from the Dify Marketplace or upload this package manually
  2. Configure provider credentials:
    • Gemini API Key (required): Your API key from Google AI Studio
    • Default Model (optional): Defaults to
  3. 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.

ParameterRequiredDescription
Optional human-readable name for the store

Returns: Store name (e.g., ), display name, creation timestamp


2. Upload File ()

Upload and import a file with automatic chunking and indexing.

ParameterRequiredDescription
Target store name (e.g., )
File to upload (PDF, TXT, DOCX, Markdown, etc.)
Unique name for citations (visible in search results)
Metadata as JSON array or direct list/dict (e.g., )
Maximum tokens per chunk (custom chunking)
Overlapping tokens between chunks (custom chunking)

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.

ParameterRequiredDescription
Store to search (e.g., )
Search query or question
Model override (defaults to provider setting)
Filter expression (e.g., )
Include citation information (default: )

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.

ParameterRequiredDescription
Store name to retrieve

Returns: Store name, display name, creation time, update time


6. Delete Store ()

Delete a file search store and all its data permanently.

ParameterRequiredDescription
Store name to delete
Force deletion even if store contains documents (default: )

Returns: Deletion status


7. List Files ()

List the documents that currently reside in a specific file search store.

ParameterRequiredDescription
Store that owns the documents (e.g., )
Optional page size between 1 and 100. Defaults to the API setting.
Pass the from a previous response to continue listing.

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.

ParameterRequiredDescription
Store containing the document
Full document resource name as returned by
Document identifier when you do not have the full resource name (with or without the prefix)

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.

ParameterRequiredDescription
Store containing the document
Full document resource name (preferred). Overrides when supplied.
Document identifier when you do not have the full resource name
Must be set to to prevent accidental deletions
Force deletion even if the document is in use

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

ErrorSolution
API key invalidVerify your Gemini API key in provider settings
Quota exceededCheck your API usage limits and upgrade tier if needed
Store not foundConfirm the store name exists using
File upload timeoutLarge files may take time; operation polling handles this automatically
Metadata filter syntax errorUse correct syntax: for strings, for numbers

Privacy Policy

See PRIVACY.md for detailed information about data handling and security.

Data Handling

This plugin processes:

  1. Files: Uploaded documents are sent to Gemini API for chunking and embedding
  2. API Credentials: Gemini API key is stored securely in plugin settings
  3. 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.

CATEGORY
Tool
VERSION
0.0.1
r3-yamauchi·11/10/2025 06:09 AM
REQUIREMENTS
Tool invocation
Maximum memory
256MB