FLAMEHAVEN FileSearch - Open source semantic document search with API authentication powered by Google Gemini
Project description
FLAMEHAVEN FileSearch
Your documents. Searchable in minutes. No infrastructure needed.
Search your local documents with RAG instantly
[>] Why FLAMEHAVEN FileSearch?
[!] FastFrom zero to production in under 5 minutes. No complex infrastructure. |
[#] Private100% self-hosted. Your data never leaves your servers. |
[$] AffordableLeverages Gemini's generous free tier. Process thousands of docs free. |
Comparison with Alternatives
| Feature | FLAMEHAVEN | Pinecone | Weaviate | Custom RAG |
|---|---|---|---|---|
| Setup Time | < 5 min | ~20 min | ~30 min | Days |
| Self-Hosted | [+] Yes | [-] No | [+] Yes | [+] Yes |
| Free Tier | Generous | Limited | Yes | N/A |
| Code Complexity | Low | Medium | High | Very High |
| Maintenance | Minimal | None | Medium | High |
| Best For | Quick POCs, SMBs | Enterprise scale | ML teams | Full control |
UI Preview (3×2)
| Dashboard | Search | Upload |
|---|---|---|
| Cache | Metrics | Admin |
[&] Key Features
| Feature | Description |
|---|---|
| [*] Multi-Format Support | PDF, DOCX, TXT, MD files up to 50MB |
| [*] Semantic Search | Natural language queries with AI-powered answers |
| [*] Source Attribution | Every answer links back to source documents |
| [*] Store Management | Organize documents into separate collections |
| [*] Dual Interface | Python SDK + REST API with Swagger UI |
| [*] Docker Ready | One-command deployment with persistence |
| [*] Enterprise Auth | v1.2.2: API keys, audit logging, rate limiting |
| [*] Batch Processing | Process 1-100 queries per request |
Admin Dashboard (v1.2.2)
Problem: Your Situation
✗ You have PDF, Word, and text documents scattered across your local drive
✗ You want to search them intelligently, not keyword-by-keyword
✗ You don't want to upload your data to external services (Pinecone, Cloudflare, etc.)
✗ You need production-ready security without complex setup
✗ You want zero infrastructure costs for prototype phase
Solution: FLAMEHAVEN FileSearch
✓ Local RAG search engine in 5 minutes
✓ 100% self-hosted (your data stays yours)
✓ Single Docker command deployment
✓ Free tier Google Gemini (up to 1500 queries/month)
✓ v1.2.2: Enterprise-grade authentication & multi-user support
✓ Batch search API for 1-100 queries per request
✓ Optional Redis for distributed caching across workers
[>] 3-Minute Quick Start
1. Docker (No Setup)
# Start with one command
docker run -d \
-e GEMINI_API_KEY="your_gemini_api_key" \
-p 8000:8000 \
-v $(pwd)/data:/app/data \
flamehaven-filesearch:1.2.2
# Available at http://localhost:8000 in 3 seconds
2. Your First Search (cURL)
# Step 1: Generate API key (v1.2.2 requirement)
curl -X POST http://localhost:8000/api/admin/keys \
-H "X-Admin-Key: your_admin_key" \
-H "Content-Type: application/json" \
-d '{
"name": "My First Key",
"permissions": ["upload", "search"]
}'
# Response: {"key_id": "...", "plain_key": "sk_live_abc123..."}
# SAVE this key - it won't be shown again!
# Step 2: Upload a document
curl -X POST http://localhost:8000/api/upload/single \
-H "Authorization: Bearer sk_live_abc123..." \
-F "file=@sample.pdf" \
-F "store=documents"
# Step 3: Search
curl -X POST http://localhost:8000/api/search \
-H "Authorization: Bearer sk_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"query": "What are the main points in this document?",
"store": "documents"
}'
# Response:
# {
# "answer": "The main points are...",
# "sources": [
# {
# "file": "sample.pdf",
# "page": 3,
# "excerpt": "..."
# }
# ]
# }
3. Python Code Example
from flamehaven_filesearch import FlamehavenFileSearch, FileSearchConfig
# Configuration
config = FileSearchConfig(
google_api_key="your_gemini_api_key",
environment="offline" # or "remote" for online
)
# Initialize
searcher = FlamehavenFileSearch(config)
# Create document store
searcher.create_store("my_documents")
# Upload files
searcher.upload_file("path/to/document.pdf", "my_documents")
searcher.upload_file("path/to/document.docx", "my_documents")
# Search with RAG
result = searcher.search(
"Summarize the key findings",
store="my_documents"
)
print(f"Answer: {result['answer']}")
print(f"Sources: {result['sources']}")
Installation
Option 1: Pip (Recommended for Development)
# Core functionality
pip install flamehaven-filesearch
# With API server
pip install flamehaven-filesearch[api]
# With Redis support
pip install flamehaven-filesearch[api,redis]
# Everything (for development)
pip install flamehaven-filesearch[all]
Option 2: Docker (Recommended for Production)
# Build image
docker build -t flamehaven-filesearch:1.2.2 .
# Run standalone
docker run \
-e GEMINI_API_KEY="your_key" \
-e FLAMEHAVEN_ADMIN_KEY="your_admin_key" \
-p 8000:8000 \
flamehaven-filesearch:1.2.2
# With Docker Compose (includes Redis)
docker-compose up -d
Option 3: Kubernetes (For High Availability)
See the Kubernetes deployment example above for complete manifests with StatefulSets, ConfigMaps, and Secrets.
Configuration
Required Environment Variables
# Google Gemini API key (get free tier at ai.google.dev)
export GEMINI_API_KEY="your_api_key"
# Admin key for creating API keys in v1.2.2
export FLAMEHAVEN_ADMIN_KEY="your_secure_admin_password"
export FLAMEHAVEN_ENC_KEY="base64_32byte_key_for_AES256" # required for encrypted key/perm storage
# Optional OIDC admin validation (HS256 shared secret)
# export FLAMEHAVEN_IAM_PROVIDER="oidc"
# export FLAMEHAVEN_OIDC_SECRET="your_oidc_hs256_secret"
# export FLAMEHAVEN_OIDC_ISSUER="https://issuer.example.com"
# export FLAMEHAVEN_OIDC_AUDIENCE="your-audience"
Optional Environment Variables
# Server settings
export HOST="0.0.0.0" # Default: 127.0.0.1
export PORT="8000" # Default: 8000
export ENVIRONMENT="production" # Default: development
# Database location
export FLAMEHAVEN_API_KEYS_DB="/path/to/api_keys.db"
# Redis (for multi-worker deployments)
export REDIS_HOST="localhost" # Default: localhost
export REDIS_PORT="6379" # Default: 6379
export REDIS_PASSWORD="password" # Optional
# API limits
export MAX_FILE_SIZE_MB="50" # Default: 50
API Key Management (v1.2.2)
Admin access requires an API key with
"admin"permission (default for newly created keys) or theFLAMEHAVEN_ADMIN_KEYenvironment value. Existing keys withoutadminwill receive 403 on admin routes.
Generate API Key
curl -X POST http://localhost:8000/api/admin/keys \
-H "X-Admin-Key: $FLAMEHAVEN_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production API Key",
"permissions": ["upload", "search", "stores", "delete"],
"rate_limit_per_minute": 100
}'
List Your Keys
curl http://localhost:8000/api/admin/keys \
-H "Authorization: Bearer sk_live_your_key..."
Revoke a Key
curl -X DELETE http://localhost:8000/api/admin/keys/{key_id} \
-H "Authorization: Bearer sk_live_your_key..."
View Usage Statistics
curl "http://localhost:8000/api/admin/usage?days=7" \
-H "Authorization: Bearer sk_live_your_key..."
Performance
| Operation | Response Time | Throughput |
|---|---|---|
| Health check | <10ms | - |
| Search (cache hit) | <10ms | >2 searches/sec |
| Search (cache miss) | 500ms - 3s | Depends on Gemini API |
| Batch search (10 queries) | 2-5s | >1 batch/sec |
| File upload | 1-5s | >1 file/sec |
Resource Usage
- Memory: ~200MB baseline + 50MB per 1000 cached queries
- CPU: <5% idle, <50% under sustained load
- Disk: 10MB per 100,000 cached queries
Security Features (v1.2.2)
- [#] API Key Encryption: SHA256 hashing (plain keys never stored)
- [#] Rate Limiting: Per-API-key customizable limits (default 100/min)
- [#] Permission Control: Fine-grained access (upload, search, stores, delete)
- [#] Audit Logging: Complete request trail with timestamps
- [#] OWASP Headers: Security headers on all responses
- [#] Request Tracking: Unique request IDs for debugging
- [#] Key Expiration: Optional time-limited API keys
Roadmap
v1.2.2 (Q4 2025)
- Improved admin authentication (IAM integration)
- Redis UI configuration in dashboard
- Encryption at rest for sensitive data
- Fix deprecated FastAPI
on_eventdecorators
v1.3.0 (Q1 2026)
- OAuth2/OIDC integration
- API key rotation
- Billing/metering system
- Advanced analytics dashboard
v2.0.0 (Q2 2026)
- Multi-language support
- Enhanced file type support (XLSX, PPTX, RTF)
- Export search results (JSON, CSV, PDF)
- WebSocket streaming support
Good First Issues (Contributions Welcome!)
Looking to contribute? Start with these issues:
-
Add XLSX Support (Difficulty: Medium)
- Extend file upload to handle Excel spreadsheets
- Reference:
flamehaven_filesearch/loaders.py - Estimated time: 2-3 hours
-
Implement Search Result Caching UI (Difficulty: Easy)
- Display cache hit rate in admin dashboard
- Reference:
flamehaven_filesearch/dashboard.py - Estimated time: 1-2 hours
-
Add Batch Search Progress Tracking (Difficulty: Medium)
- Implement WebSocket endpoint for real-time batch progress
- Reference:
flamehaven_filesearch/batch_routes.py - Estimated time: 3-4 hours
-
Create Integration Tests (Difficulty: Easy)
- Write end-to-end tests for common workflows
- Reference:
tests/test_api_integration.py - Estimated time: 2-3 hours
-
Add Dark Mode to Admin Dashboard (Difficulty: Easy)
- Extend dashboard.py with CSS dark theme toggle
- Reference:
flamehaven_filesearch/dashboard.py - Estimated time: 1-2 hours
See CONTRIBUTING.md for complete contribution guidelines.
Troubleshooting
Issue: 401 Unauthorized on API requests
Solution:
- Verify FLAMEHAVEN_ADMIN_KEY environment variable is set
- Check Authorization header format:
Authorization: Bearer sk_live_your_key - Ensure API key hasn't expired
Issue: "Redis connection refused"
Solution:
- Verify Redis is running:
redis-cli ping - Check REDIS_HOST and REDIS_PORT environment variables
- Remove Redis if not needed (system falls back to LRU cache)
Issue: High memory usage
Solution:
- Configure Redis eviction policy:
maxmemory-policy allkeys-lru - Reduce cache TTL in configuration
- Monitor cache metrics:
curl http://localhost:8000/prometheus | grep cache
Issue: Slow searches
Solution:
- Check if caching is working (view
cache_hits_totalmetric) - Verify Gemini API is responsive
- Check network latency to Redis instance
Migration from v1.1.0 to v1.2.2
Breaking Changes
All protected endpoints now require API key authentication.
Migration Steps
-
Update dependencies:
pip install -U flamehaven-filesearch[api]
-
Set admin key:
export FLAMEHAVEN_ADMIN_KEY="your_secure_admin_key"
-
Generate first API key:
curl -X POST http://localhost:8000/api/admin/keys \ -H "X-Admin-Key: your_admin_key" \ -H "Content-Type: application/json" \ -d '{"name":"Production","permissions":["upload","search","stores","delete"]}'
-
Update application code:
# Old (v1.1.0) requests.post("http://localhost:8000/api/search", json={"query": "test"}) # New (v1.2.2) api_key = "sk_live_your_key" requests.post( "http://localhost:8000/api/search", json={"query": "test"}, headers={"Authorization": f"Bearer {api_key}"} )
-
Test before production deployment
Rollback Plan
If issues occur, v1.1.0 remains available. No data loss on downgrade.
Support & Community
- Documentation: CHANGELOG | Release Notes
- Issues & Bugs: GitHub Issues
- Discussions: GitHub Discussions
- Security Issues: security@flamehaven.space
Architecture Overview
[Your Documents]
|
v
[File Upload Endpoint] ---> [File Parser] ---> [Store Manager]
| | |
+---- (REST API) --------+---- (SQLite DB)----+
|
[Search Endpoint] ---> [Semantic Search] ---> [Gemini API]
| |
+--- (Cache) -------+
|
[Prometheus Metrics] <--- [Audit Log]
Performance Metrics
Recent v1.2.2 benchmark (Docker on M1 Mac):
Health Check: 8ms
Search (cache hit): 9ms
Search (cache miss): 1250ms
Batch Search (10 queries, parallel): 2500ms
Upload (50MB file): 3200ms
License
FLAMEHAVEN FileSearch is released under the MIT License. See LICENSE file for details.
Acknowledgments
Built with:
- FastAPI - Modern Python web framework
- Google Gemini API - Semantic understanding
- SQLite - Lightweight database
- Redis (optional) - Distributed caching
Questions? Open an issue or email support@flamehaven.space
Last Updated: December 09, 2025 (v1.2.2)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flamehaven_filesearch-1.2.2.tar.gz.
File metadata
- Download URL: flamehaven_filesearch-1.2.2.tar.gz
- Upload date:
- Size: 59.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7865ecb3c45ecf32b0cf721f0fa8cec3e61b8ed7f0e61c5f054c75137ca05bd6
|
|
| MD5 |
cc387775d662f9a508617a6cdf173b2d
|
|
| BLAKE2b-256 |
18e0731efabb915e843c0b16d0ee1a2957a9522ea275ffb38df36e69e5d734f6
|
Provenance
The following attestation bundles were made for flamehaven_filesearch-1.2.2.tar.gz:
Publisher:
publish.yml on flamehaven01/Flamehaven-Filesearch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flamehaven_filesearch-1.2.2.tar.gz -
Subject digest:
7865ecb3c45ecf32b0cf721f0fa8cec3e61b8ed7f0e61c5f054c75137ca05bd6 - Sigstore transparency entry: 753216708
- Sigstore integration time:
-
Permalink:
flamehaven01/Flamehaven-Filesearch@7a743a327992ac5a13fbe96772ab177836745514 -
Branch / Tag:
refs/tags/v1.2.2 - Owner: https://github.com/flamehaven01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7a743a327992ac5a13fbe96772ab177836745514 -
Trigger Event:
release
-
Statement type:
File details
Details for the file flamehaven_filesearch-1.2.2-py3-none-any.whl.
File metadata
- Download URL: flamehaven_filesearch-1.2.2-py3-none-any.whl
- Upload date:
- Size: 59.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47e42b0baccff7febdd189f9aa0db73765a5f16c70fd798611d3b5330677985a
|
|
| MD5 |
0698e25d283d522778c974757c19c52d
|
|
| BLAKE2b-256 |
24808ab1f63e4705e02ec2f55d15e3f318da0ae5b188cd9a0b2675a74dc33cf4
|
Provenance
The following attestation bundles were made for flamehaven_filesearch-1.2.2-py3-none-any.whl:
Publisher:
publish.yml on flamehaven01/Flamehaven-Filesearch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flamehaven_filesearch-1.2.2-py3-none-any.whl -
Subject digest:
47e42b0baccff7febdd189f9aa0db73765a5f16c70fd798611d3b5330677985a - Sigstore transparency entry: 753216712
- Sigstore integration time:
-
Permalink:
flamehaven01/Flamehaven-Filesearch@7a743a327992ac5a13fbe96772ab177836745514 -
Branch / Tag:
refs/tags/v1.2.2 - Owner: https://github.com/flamehaven01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7a743a327992ac5a13fbe96772ab177836745514 -
Trigger Event:
release
-
Statement type: