Skip to content

webcomunicasolutions/Gemini-File-Search-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ” Gemini File Search Manager

Python Flask Google Gemini License

A powerful, full-featured web application for managing File Search Stores and performing Retrieval Augmented Generation (RAG) using Google's Gemini File Search API with bilingual support (Spanish/English).

Webcomunica Solutions Optimizaconia


✨ Features

🎨 Modern Web Interface

  • Bilingual Support: Complete Spanish/English translation system
  • 3 Main Tabs: Chat, File Stores Management, Documentation & HTTP Generator
  • Real-time Chat: Interactive RAG queries with document citations
  • Enhanced File Upload:
    • 60+ file extensions supported (PDF, DOCX, XLSX, CSV, code files, and more)
    • Smart MIME type detection with 70+ pre-mapped formats
    • Dual-method upload system (direct + fallback) for maximum reliability
    • Automatic handling of problematic file formats (CSV, large files)
  • AI-Powered Metadata ⭐ NEW:
    • Automatic metadata extraction using Gemini models
    • Bilingual metadata generation - respects your interface language
    • DOCX/XLSX analysis support - extract metadata from Office documents
    • Smart text extraction for unsupported file types
    • Quality over quantity (5-12 metadata fields)

πŸ“¦ File Store Management

  • Create and manage multiple File Search Stores
  • Upload documents with automatic chunking and embedding
  • View documents with state tracking (PENDING, ACTIVE, FAILED)
  • Edit metadata with visual tag system
  • Delete stores and documents with safety confirmations

πŸ”§ HTTP Request Generator

  • 6 Output Formats: cURL, Python, JavaScript, n8n, Make.com, Postman
  • 8 Operations: Create Store, List Stores, Upload Document, Chat RAG, List Documents, Delete Document, Delete Store, Get Operation Status
  • Dynamic parameter forms for each operation
  • Ready-to-copy code with explanations
  • Fully translated interface

🌐 Multi-language Support

  • Complete translation system (Spanish/English)
  • Persistent language preference
  • All UI elements translated including:
    • Forms and labels
    • Buttons and messages
    • Code explanations
    • Error messages

🎯 Advanced Features

  • Smart Citations: Automatic grounding metadata extraction
  • Conversation History: Full chat history with timestamps
  • Model Selection: Support for multiple Gemini models
  • Metadata Editor: Visual interface for custom metadata
  • Store Selector: Easy switching between File Search Stores
  • Responsive Design: Works on desktop and mobile devices

πŸ“Έ Screenshots

Main Interface

Main Interface Modern bilingual interface with upload, chat, file stores, and settings tabs

AI Metadata Suggestions

AI Metadata Automatic metadata extraction powered by Gemini AI

Chat with Documents

Chat Interface Interactive RAG chat with real-time responses

File Stores Management

File Stores Manage multiple file search stores with document tracking

Settings Configuration

Settings Configure API keys and model preferences

API Documentation & HTTP Generator

API Docs Built-in HTTP request generator with 6 output formats


πŸš€ Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/webcomunicasolutions/gemini-rag.git
    cd gemini-rag
  2. Create and activate virtual environment

    cd web_app
    python -m venv venv
    
    # On Windows:
    venv\Scripts\activate
    
    # On Linux/Mac:
    source venv/bin/activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Set up your API key

    • Copy .env.example to .env
    • Add your Gemini API key:
      GEMINI_API_KEY=your_api_key_here
      
  5. Run the application

    python app.py
  6. Open in browser

    http://localhost:5001
    

πŸ“– Usage

1. Configure Your API Key

Go to Settings tab and enter your Gemini API Key. The app will remember it for future sessions.

2. Create or Select a Store

  • Create a new File Search Store in the File Stores tab
  • Or select an existing store from the dropdown

3. Upload Documents

  • Click Browse Files or drag & drop
  • 60+ file extensions supported including:
    • πŸ“„ Documents: PDF, DOC, DOCX, ODT, RTF
    • πŸ“Š Spreadsheets: CSV, XLSX, XLS, XLSM, ODS
    • πŸ“ˆ Presentations: PPTX, PPT, ODP
    • πŸ’Ύ Data: JSON, XML, YAML, SQL
    • πŸ’» Code: 30+ programming languages (Python, JavaScript, Java, C++, Go, Rust, TypeScript, PHP, Ruby, Swift, Kotlin, Scala, and more)
    • πŸ“ Markup: HTML, Markdown, LaTeX, Jupyter Notebooks
  • Smart MIME type detection with automatic fallback
  • Robust upload system: Direct upload with Files API fallback for problematic files
  • See complete list: SUPPORTED_FORMATS.md - 200+ MIME types officially supported by Gemini
  • Add custom metadata (optional)
  • Select AI model for metadata generation (optional)

4. Chat with Your Documents

  • Go to Chat tab
  • Ask questions about your uploaded documents
  • Get answers with citations and source references
  • View full conversation history

5. Generate HTTP Requests

  • Go to Docs & Help tab
  • Select an operation
  • Configure parameters
  • Choose output format (cURL, Python, JavaScript, etc.)
  • Copy ready-to-use code

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           User (Browser)                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
                 β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      Flask Web Application                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  Frontend (HTML/CSS/JS)             β”‚   β”‚
β”‚  β”‚  - Bilingual UI                     β”‚   β”‚
β”‚  β”‚  - Real-time chat                   β”‚   β”‚
β”‚  β”‚  - File upload                      β”‚   β”‚
β”‚  β”‚  - HTTP generator                   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  Backend (Python/Flask)             β”‚   β”‚
β”‚  β”‚  - API endpoints                    β”‚   β”‚
β”‚  β”‚  - State management                 β”‚   β”‚
β”‚  β”‚  - File processing                  β”‚   β”‚
β”‚  β”‚  - Smart MIME detection             β”‚   β”‚
β”‚  β”‚  - Upload fallback system           β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
                 β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Google Gemini File Search API            β”‚
β”‚  - Document vectorization                   β”‚
β”‚  - Semantic search                          β”‚
β”‚  - RAG responses                            β”‚
β”‚  - Citations & grounding                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”„ Enhanced File Upload System

The application implements a robust dual-method upload system to ensure maximum compatibility:

Primary Method: Direct Upload

  • Uses uploadToFileSearchStore API
  • Single-step process
  • Automatic MIME type detection by API
  • Fastest and most efficient

Fallback Method: Files API + Import

  • Activates when direct upload fails
  • Two-step process: upload to Files API β†’ import to store
  • Explicit MIME type specification
  • Handles edge cases (CSV, large files, etc.)

Smart MIME Type Detection

  • 70+ pre-mapped file extensions
  • Fallback to Python mimetypes module
  • Safe default for unknown types
  • Optimized for Gemini File Search API

Supported Extensions:

Documents:    txt, pdf, doc, docx, odt, rtf, md
Spreadsheets: csv, tsv, xlsx, xls, xlsm, xlsb, ods
Presentations: pptx, ppt, odp
Data Formats: json, xml, yaml, yml, sql
Code Files:   py, js, jsx, ts, tsx, java, c, cpp, cs, go, rs, php, rb, swift, kt, scala, pl, r, hs, erl, lua, sh, dart
Web:          html, htm, css, scss, sass
Scientific:   ipynb, bib, tex
Archives:     zip
... and more (60+ total)

This dual-method approach ensures files are uploaded successfully even when encountering API-specific issues with certain formats.


πŸ› οΈ Technology Stack

  • Backend: Flask (Python 3.8+)
  • Frontend: Vanilla JavaScript, HTML5, CSS3
  • AI/ML: Google Gemini 2.5 Flash API
  • Storage: JSON-based state persistence
  • Dependencies:
    • google-genai: Official Gemini SDK
    • flask: Web framework
    • python-dotenv: Environment management

πŸ“š Documentation


🀝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

Development Setup

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments


πŸ“ž Contact & Support


⭐ Star History

If you find this project useful, please consider giving it a star on GitHub!


Last Updated: November 21, 2025 Version: 1.2.0 Status: Production Ready βœ…

πŸ†• Recent Updates (v1.2.0 - Nov 21, 2025)

  • βœ… Bilingual Metadata Generation: AI now generates metadata in your interface language (Spanish/English)
  • βœ… DOCX/XLSX Metadata Analysis: Extract metadata from Word and Excel documents with AI
  • βœ… Text Extraction: Smart local text extraction for Office documents
  • βœ… Windows File Lock Fix: Proper file handle management prevents locking issues

Previous Updates (v1.1.0 - Nov 21, 2025)

  • βœ… Enhanced File Upload System: Dual-method upload with automatic fallback
  • βœ… Smart MIME Detection: Comprehensive MIME type mapping for 70+ formats
  • βœ… Extended Format Support: 60+ file extensions supported
  • βœ… CSV/Excel Upload Fix: Resolved upload issues with spreadsheet formats

🌍 Available Languages

About

Professional management tool for Google Gemini's File Search API. Create and manage stores, upload documents, handle metadata, and streamline RAG implementations with an intuitive interface.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors