Search photos by content using captions and visual similarity. Use when the user asks to find, search for, or look up specific photos — e.g., "find ironweed photos", "show me purple flowers", "search for pool photos with sunset". Different from /photo which sends a random photo.
Search indexed Google Drive photos by content (captions, tags, visual similarity).
Source credentials in every Bash call that uses gog:
source ~/.secrets 2>/dev/null && source ~/claude-sessions/.claude/accounts.env 2>/dev/null
The photo-search CLI auto-loads its own env, but gog needs GOG_PERSONAL_ACCOUNT from accounts.env.
Parse the query — Extract the search terms from the user's request. Examples:
Run the search — Use photo-search search CLI:
source ~/.secrets 2>/dev/null
photo-search search "<query>" --limit 5 --json
Download and inspect top 2 — Download the top 2 search results to /tmp/photo-search-results/ and visually inspect both using the Read tool. Choose the one that best matches the user's query and send it via Telegram. Include commentary about the photo. When photo_year is present, include it in the caption.
mkdir -p /tmp/photo-search-results
source ~/.secrets 2>/dev/null && source ~/claude-sessions/.claude/accounts.env 2>/dev/null
gog drive download "<drive_file_id_1>" --account "$GOG_PERSONAL_ACCOUNT" --no-input --out /tmp/photo-search-results/<filename_1>
gog drive download "<drive_file_id_2>" --account "$GOG_PERSONAL_ACCOUNT" --no-input --out /tmp/photo-search-results/<filename_2>
# Visually inspect both with Read tool, then send the best match
send_to_telegram /tmp/photo-search-results/<best_filename> --caption "<filename> (<folder_name>, <photo_year>)"
If photo_year is not available, omit it from the caption: "<filename> (<folder_name>)".
Visual refinement (on request) — If the user indicates they want a better match (e.g., "is there something better?", "look harder", "that's not quite right"), download the remaining 3 candidates to /tmp/photo-search-results/, visually inspect them using the Read tool, and either send a better match or explain that you don't see one.
source ~/.secrets 2>/dev/null && source ~/claude-sessions/.claude/accounts.env 2>/dev/null
# Download only files not already cached
[ -f /tmp/photo-search-results/<filename> ] || gog drive download "<drive_file_id>" --account "$GOG_PERSONAL_ACCOUNT" --no-input --out /tmp/photo-search-results/<filename>
If no results — Let the user know. Suggest they might need to index more folders:
No results found for "ironweed". The index currently covers: [list folders from stats].
You can index more folders with: photo-search index --folder <keyword>
The CLI supports three modes via --mode:
combined (default) — embedding similarity first, text search to supplement if fewer than limit resultstext — FTS5 text search only (fast, exact matches in captions/tags/filenames)embedding — visual similarity search (finds semantically similar photos even with different wording)Use --mode embedding when the user's query is abstract or visual (e.g., "photos that look like autumn").
If the user asks to index or re-index photos:
source ~/.secrets 2>/dev/null && source ~/claude-sessions/.claude/accounts.env 2>/dev/null
photo-search index [--folder <keyword>] [--full]
--folder: indexes all known photo folders (meadow, pool, snow, lily, etc.)--folder meadow: indexes only folders matching "meadow"--full: re-indexes everything, ignoring cachephoto-search stats
~/.secrets and accounts.env via config.pydrive_file_id needed for downloadphoto_index.db in the project root (SQLite)