How abiramr12317-png/hnsw-vault works
HNSW Vault lets users bulk-upload event photos, then search with a face photo to retrieve matching originals and thumbnails. Uploads are stored, face embeddings are generated and indexed, and metadata links index IDs back to images. Searches embed the query, traverse the HNSW index, filter candidates by distance, resolve image metadata, and lazily create thumbnails. The README documents these capabilities; the shown source establishes the main API-owned calls and persistence steps.
Main entry points: main.py FastAPI endpoints · pipeline.py Image ingestion · db.py Metadata helpers · script.js Browser UI
Components 13
User interface
- Browser UI
frontend/script.js - FastAPI endpoints
app/main.py - Runtime configuration
app/config.py
Photo ingestion
- Image ingestion
app/pipeline.py - Face embeddings
app/embeddings.py
Face search
- HNSW index
app/hnsw.py - Thumbnail generation
app/thumbnails.py
Storage and metadata
- Original images
storage/originals - Persisted index
storage/index_data - Metadata helpers
app/db.py - Metadata database
storage - Cached thumbnails
storage/thumbnails
Other components
- User
Connections 17
- User → Browser UI: uses
README.md - Browser UI → FastAPI endpoints: calls API
frontend/script.js - FastAPI endpoints → Runtime configuration: reads settings
app/main.py - FastAPI endpoints → Image ingestion: dispatches upload
app/main.py - Image ingestion → Original images: copies images
app/pipeline.py - Image ingestion → Face embeddings: extracts faces
app/pipeline.py - Image ingestion → HNSW index: inserts vectors
app/pipeline.py - Image ingestion → Metadata helpers: records image and faces
app/pipeline.py - FastAPI endpoints → HNSW index: loads, searches, saves
app/main.py - FastAPI endpoints → Face embeddings: embeds query
app/main.py - FastAPI endpoints → Metadata helpers: looks up matches
app/main.py - FastAPI endpoints → Thumbnail generation: requests thumbnails
app/main.py - FastAPI endpoints → Persisted index: loads and saves index
app/main.py - Metadata helpers → Metadata database: reads and writes
app/db.py - Thumbnail generation → Cached thumbnails: creates and caches
app/thumbnails.py - FastAPI endpoints → Original images: serves images
app/main.py - FastAPI endpoints → Cached thumbnails: serves thumbnails
app/main.py