Case study · AI engineering · Data engineering · Privacy
AI Media Search Platform, with privacy built in
An internal platform that turns a scattered Google Drive photo library into a collection anyone can search in plain English, with privacy screening and human review before a single photo becomes searchable.
Deployed · fully automated daily pipeline02 · CONTEXT & PROBLEM
Thousands of valuable photos, almost impossible to find
An ecommerce company with several pet-focused brands regularly runs campaigns around animal rescue, shelter donations, products and the impact of customer purchases. Over time, its marketing and operations teams built up thousands of photos across four restricted Google Drive collections: dog campaigns, cat campaigns, dog impact and cat impact.
The photos show dogs, cats, rescue animals, donated toys and treats, shelter activities and campaign events. They're valuable assets, but they sit in many folders and subfolders with inconsistent names. Drive search relies on filenames, so it can't find "a dog lying on its back" or "a cat playing with a donated toy" unless someone happened to name the file that way.
The challenge: make the existing library discoverable without asking anyone to hand-label thousands of photos or move the library out of Google Drive.
Before: finding a photo by hand
- Search by filename, which rarely describes what's in the photo
- Browse folder after folder, opening photos one by one
- Rely on memory of past campaigns
- Ask colleagues who might remember where something is
With the platform
- Describe the photo you need in plain English
- Search all four collections at once, or filter by brand, collection and date
- See descriptions alongside results
- Open the original straight from Google Drive
04 · THE SOLUTION
Search by meaning, not by filename
The platform screens every photo for privacy, writes an AI description of each approved one, and turns that description into a vector embedding. When someone searches, their words are converted the same way and compared by meaning, so "dog playing with a rope toy" finds the right photos even if no filename says so.
The originals never leave Google Drive. The platform stores only searchable metadata, approved descriptions, embeddings and links back to each file, not a second copy of the library.
05–06 · USER EXPERIENCE
Two workspaces, one simple app
An internal web app with two workspaces, designed so people never need to know about the AI or the database underneath.
Media Search
- Natural-language search across all four collections
- Filters for brand, collection, campaign and date
- Results based on what's in the photo, not its filename
- Descriptions and context for each result
- One click to open the original in Google Drive
Privacy Review
- Restricted to designated reviewers
- Separate views for pending reviews, unresolved cases and approved photos
- Approve, exclude or mark a photo as uncertain
- Revoke an earlier approval at any time
- Open the original in Google Drive before deciding
07 · TECHNICAL ARCHITECTURE
End-to-end architecture
The interactive app, the batch pipeline, media storage, AI services and the data layer are kept separate. Illustrative diagram.
Media source
- Google Drive, 4 approved collections
- Read-only access
- Originals stay in Drive
Processing pipeline
- Python on a scheduled Cloud Run Job
- Inventory reconciliation
- Privacy screening
- Descriptions and embeddings
AI and data
- Vertex AI Gemini 2.5 Flash
- Vertex AI Gemini Embedding
- BigQuery: inventory, state, vectors, audit history
Application
- Streamlit on Cloud Run
- Identity-Aware Proxy and Google sign-in
- Media Search and Privacy Review
| Technology | Purpose |
|---|---|
| Python | Processing pipelines, backend logic and automation |
| Google Drive API | Inventory discovery, metadata checks and authenticated image retrieval |
| Vertex AI Gemini 2.5 Flash | Multimodal privacy screening and image description |
| Vertex AI Gemini Embedding | 768-dimensional semantic vectors |
| Google BigQuery | Inventory, processing state, vector storage, semantic retrieval and audit history |
| Streamlit | Internal search and privacy review app |
| Docker, Cloud Build, Cloud Run | Containerized app hosting and the scheduled processing job |
| Cloud IAM, Identity-Aware Proxy, Secret Manager | Dedicated identities, restricted access and secure configuration |
| Cloud Scheduler | Daily trigger for the processing pipeline |
| Cloud Logging, Cloud Monitoring and Slack | Execution health tracking and automated failure alerts |
| GitHub | Source control, documentation and change governance |
08 · PRIVACY AS A CORE REQUIREMENT
Privacy screening comes before indexing, not after
The collections can include shelter staff, volunteers, members of the public and children. Company policy doesn't allow searchable descriptions or embeddings of identifiable people without authorization. So instead of indexing everything and cleaning up later, every new photo is screened first, and only photos that pass ever get described or embedded.
CLEARNo people or identifying details detected.
Indexed automaticallyLIMITED_HUMAN_PRESENCEIncidental presence only, like a hand holding a toy.
Held until a reviewer approvesFLAGGEDAn identifiable person, a child or personal details.
Excluded; reviewers can't overrideUNCERTAINThe AI can't tell confidently.
Held for human considerationHuman-in-the-loop approval
Excluding every photo with any person in it would throw away useful assets, like a dog taking a treat from a volunteer's hand. So eligible photos with limited human presence go to a reviewer. When one is approved:
- The reviewer's identity and authorization are verified.
- The file's current metadata is checked in Google Drive.
- The system confirms the photo hasn't changed since it was screened.
- The decision is recorded and indexing is authorized in one database transaction.
- The photo becomes eligible for the next incremental indexing run.
- The pipeline generates its description and embedding.
- The photo becomes searchable in Media Search.
Revoking an approval removes the stored description, keywords and embedding, so the photo stops appearing in search. Every decision is written to an audit history with the reviewer, time, decision and file version.
09 · AI PROCESSING & SEMANTIC SEARCH
From photo to search result
Indexing (authorized photos only)
Searching
10 · AUTOMATED INVENTORY RECONCILIATION
Keeping search in sync with a library that keeps changing
Campaign folders change constantly: photos get added, renamed, moved, edited, deleted and restored. A one-time index would go stale quickly, so the platform compares the current Drive inventory with BigQuery and handles each kind of change differently. It supports dry runs, produces a change report and applies changes in transactions.
| Change in Google Drive | What the platform does |
|---|---|
| New photo | Adds it to the inventory and queues it for privacy screening |
| Unchanged photo | Keeps its existing state |
| Metadata-only change | Updates metadata without any AI processing |
| Renamed or moved indexed photo | Keeps valid privacy decisions; refreshes the embedding when its searchable context changes |
| Changed content or version | Resets screening and authorization; requires fresh screening |
| Deleted or unavailable photo | Withholds it from search and removes derived searchable content |
| Restored photo | Revalidates it through the right privacy workflow |
Fully automated daily pipeline
The whole workflow runs on its own every day, independently of anyone's computer, and processes only what has changed.
- Cloud Scheduler triggers a dedicated Cloud Run Job every day.
- The job scans the four approved collections and compares them with BigQuery.
- New, changed, moved, deleted and restored files are reconciled. If this fails, processing stops.
- New photos are screened; previously approved ones awaiting indexing are picked up.
- Authorized photos get descriptions and embeddings; others wait in Privacy Review.
- Deleted or unavailable photos are removed from search results automatically.
- Cloud Logging and Monitoring track every run. Failed runs, timeouts and missed schedules send Slack alerts to the business owner, IT and the platform maintainer.
11 · SECURITY & GOVERNANCE
Built for internal use, with least-privilege access
- Access through Google sign-in and Identity-Aware Proxy
- Separate permissions for search users and privacy reviewers
- Dedicated service accounts for hosting, builds, processing and scheduling
- Automated Slack alerts for failed, timed-out or missed runs
- Read-only access to explicitly approved Drive folders
- Dataset-scoped BigQuery access
- Managed cloud identities, no downloaded service-account keys
- Secrets kept in Secret Manager
- No permanent copy of the original photos
- Version-aware privacy authorization
- Transactional review decisions with full audit history
- Search eligibility checks that exclude unauthorized or outdated media
- AI descriptions are never used as a substitute for access control
12 · ENGINEERING CHALLENGES & DECISIONS
The hard parts
Discoverability vs privacy
A screening gate plus human approval for incidental human presence keeps useful photos available without weakening privacy controls.
Avoiding unnecessary AI costs
Selective reconciliation, incremental processing and embedding-only refreshes reuse valid work instead of reprocessing the library.
Consistency across systems
Drive, BigQuery, AI services and reviewers work independently, so metadata checks, version checks and guarded transactions prevent stale approvals.
Long-running processing
The pipeline records its state, recovers incrementally and reports failures rather than starting over after an interruption.
Designing for non-technical users
Multimodal AI, embeddings and cloud infrastructure sit behind a plain search box and a simple review screen.
From prototype to production
Local experiments grew into a deployed, authenticated app with dedicated identities, audit trails, a scheduled daily pipeline and failure alerts.
13 · TESTING, RESULTS & IMPACT
Tested step by step, measured honestly
What was tested
- Privacy screening and authorization logic
- Drive folder and file metadata checks
- Duplicate record detection
- Dry-run reconciliation
- Approval, exclusion and uncertainty workflows
- Approval revocation
- Rejection of stale file versions
- Prevention of unauthorized approvals
- Database transaction rollback
- Audit history integrity
- Production sign-in and app access
- Search filters and privacy eligibility
Measured · media inventory after reconciliation
Measured · one live reconciliation run
Measured · the following incremental processing run
Business value it's designed to deliver
Not yet formally measured, so listed as intended outcomes, not results.
- Less time spent browsing media folders
- Less reliance on individual memory of past campaigns
- More reuse of existing marketing assets
- Faster campaign preparation
- Consistent privacy controls across collections
- Less repetitive manual tagging
- Lower AI processing costs through incremental updates
- Clear accountability for privacy decisions
14 · STATUS & WHAT'S NEXT
Where it stands
The platform is deployed, in use and fully automated. Inventory reconciliation, privacy screening, human review, semantic search and incremental indexing run on a daily schedule, with monitoring and Slack alerts if anything fails.
Future opportunities
- Measure search usage and time saved
- Collect feedback on result relevance
- Add new media collections as campaigns grow
- Extend the same privacy-first approach to other media