← All work

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 pipeline
2,358photographs in the reconciled inventory
1,472photos searchable by meaning after the latest run
0indexed privacy-eligibility violations found in validation
16/16live BigQuery transaction tests passed

02 · 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
TechnologyPurpose
PythonProcessing pipelines, backend logic and automation
Google Drive APIInventory discovery, metadata checks and authenticated image retrieval
Vertex AI Gemini 2.5 FlashMultimodal privacy screening and image description
Vertex AI Gemini Embedding768-dimensional semantic vectors
Google BigQueryInventory, processing state, vector storage, semantic retrieval and audit history
StreamlitInternal search and privacy review app
Docker, Cloud Build, Cloud RunContainerized app hosting and the scheduled processing job
Cloud IAM, Identity-Aware Proxy, Secret ManagerDedicated identities, restricted access and secure configuration
Cloud SchedulerDaily trigger for the processing pipeline
Cloud Logging, Cloud Monitoring and SlackExecution health tracking and automated failure alerts
GitHubSource 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.

New photoFound in an approved collection
AI privacy screeningGemini checks for people, children and personal details; results validated
One of four categoriesEach with its own rule, below
CLEAR

No people or identifying details detected.

Indexed automatically
LIMITED_HUMAN_PRESENCE

Incidental presence only, like a hand holding a toy.

Held until a reviewer approves
FLAGGED

An identifiable person, a child or personal details.

Excluded; reviewers can't override
UNCERTAIN

The AI can't tell confidently.

Held for human consideration
Fail-closed by design. When the system can't establish that indexing is allowed, it doesn't index. Uncertainty is never treated as permission.

Human-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:

  1. The reviewer's identity and authorization are verified.
  2. The file's current metadata is checked in Google Drive.
  3. The system confirms the photo hasn't changed since it was screened.
  4. The decision is recorded and indexing is authorized in one database transaction.
  5. The photo becomes eligible for the next incremental indexing run.
  6. The pipeline generates its description and embedding.
  7. 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.

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 DriveWhat the platform does
New photoAdds it to the inventory and queues it for privacy screening
Unchanged photoKeeps its existing state
Metadata-only changeUpdates metadata without any AI processing
Renamed or moved indexed photoKeeps valid privacy decisions; refreshes the embedding when its searchable context changes
Changed content or versionResets screening and authorization; requires fresh screening
Deleted or unavailable photoWithholds it from search and removes derived searchable content
Restored photoRevalidates 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.

  1. Cloud Scheduler triggers a dedicated Cloud Run Job every day.
  2. The job scans the four approved collections and compares them with BigQuery.
  3. New, changed, moved, deleted and restored files are reconciled. If this fails, processing stops.
  4. New photos are screened; previously approved ones awaiting indexing are picked up.
  5. Authorized photos get descriptions and embeddings; others wait in Privacy Review.
  6. Deleted or unavailable photos are removed from search results automatically.
  7. 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.
No manual runs. Dedicated service accounts, scoped permissions and safeguards against overlapping runs keep the daily pipeline safe to leave running.

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.

How I built it. I designed the architecture, privacy rules and workflows, and built the code with an AI coding assistant, reviewing and testing each component as it was added.

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
A dedicated integration suite passed 16 of 16 live BigQuery transaction tests on isolated test tables. In production, a real human approval went all the way through the indexing pipeline to search.

Measured · media inventory after reconciliation

3,294unique inventory records across 4 collections
1,472searchable indexed photos
869photos awaiting first human review
0duplicates, privacy violations or withheld photos keeping search data

Measured · one live reconciliation run

2,430inventory changes committed
2,227metadata-only updates, no AI needed
148embedding refreshes
0unnecessary privacy screening resets

Measured · the following incremental processing run

177photos processed in about 73 minutes
17 / 11of 28 new photos auto-authorized / sent to review
166photos indexed, with zero processing errors
296AI calls avoided by refreshing embeddings instead of reprocessing 148 photos

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

Have a library nobody can search?

I'd love to hear about the data, documents or media your team struggles to use.