A portable Python interface for Google's Gemini File Search API. Create queryable knowledge bases from local documents with citation support.
- Store Management - Create/retrieve file search stores
- Document Ingestion - Recursive upload of PDF, TXT, MD, DOCX, and 30+ file types
- Semantic Search - Query documents with natural language
- Citations - Automatic source attribution in responses
- Hot-Reload - Add documents without recreating stores
Edit project_config.json:
{
"gemini_api_key": "YOUR_API_KEY_HERE",
"store_display_name": "My Knowledge Base",
"documents": ["./documents"],
"model": "gemini-2.5-flash"
}python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install google-genai python-dotenv
python validate_setup.py
python setup_gemini.pypython test_query.py| File | Purpose |
|---|---|
setup_gemini.py |
Core GeminiFileSearch class |
validate_setup.py |
Pre-flight environment check |
verify_system.py |
Verify existing stores |
test_query.py |
Query testing |
project_config.json |
User configuration |
- Python 3.8+
google-genai(NOTgoogle-generativeai)python-dotenv- Google AI Studio API key
- AI Setup Prompt - AI assistant instructions
- Guide - Full SDK reference & troubleshooting
- Use Cases - Example applications
N/A