Brain by LFI

Personal Media Library

Keep your photos clean

This tool scans your photo library for explicit content and moves anything flagged into a private GCS vault. Anything safe stays in your main library. If the filter gets it wrong, you can put a photo back with one click. Sign in with Google to use the app in production.

Filter strength
—
System
—
Recent activity
—

Console

Set how strict the filter should be, scan your library, and review what's been flagged.

What this does

Use the Photos tab to scan your library. The system looks at each image and moves anything explicit to a private vault. Use the Filter tab to set how aggressive it should be. Check Health if something seems off.

Recent activity

    Nothing has happened yet.

    How strict should the filter be?

    These settings affect future scans. Already-flagged photos aren't re-checked.

    What to flag

    Storage & access settings

    Where the photos live and where the flagged ones go. This app runs in Cloud Run, so these values are managed via gcloud run services update — not editable here. The Health tab has copy-runnable gcloud commands for each value.

    Photos scoring at or above this go to the vault. Lower = stricter.

    Settings are managed by the Cloud Run service via gcloud run services update --update-env-vars KEY=VALUE.

    Scan your library

    Quick scan only checks photos that haven't been classified yet (or were classified at a different threshold). Full re-scan ignores cached results and re-runs every image. Both record a score per photo so you can sort and filter them later.

    Score distribution

    How explicit each photo looks to the model. The dashed line is your current threshold — everything to the right gets quarantined. Use this to pick a threshold that catches what you want without sweeping in too many false positives.

    Loading…

    Live activity

      Start a scan to see photos being processed in real time.

      Your library

      Safe photos that stayed in the main library. Each shows the model's score.

      Loading…

      Private vault

      Photos the filter flagged. If a photo was flagged by mistake, click "Restore" to move it back to your main library.

      Load the vault to view flagged photos.

      Is everything working?

      Each component below is checked live. Green means it's working. Red means it isn't — and the row will tell you what's wrong and what to do about it.

      Checking…

      Documents · PKL

      Your library at a glance

      Same Brain session as Media — where your files live, how they got there, and what needs your attention. On your Mac this uses the SSD-mounted PKL; in production (GCS + Neon) the same controls apply to the cloud mirror. Drop files into _Inbox/ or run routers here when you do not want to wait for the nightly job.

      System
      —
      Inbox
      —
      Files indexed
      —
      Properties
      —
      Last nightly run
      —
      Last indexed
      —

      Console

      Overview, inbox, triage, pipelines, and search — same auth and shell as Media.

      Alerts

      Loading…

      Last nightly run

      Loading…

      Recent file moves

      Loading…

      Queued for routing

      Files waiting in _Inbox/. The nightly router classifies these into the right portfolio and property folder. Stale items (over 7 days) are shown in red.

      Portfolios

      Source of truth is public.properties.portfolio. File counts are from the portfolio:<name> tags in file_registry. No folder means no files have landed there yet.

      Loading…

      Add a property to the database

      Use this for properties that exist on disk but aren't in the database yet. Once added, the auto-router will recognize them.

      System health

      Each component below is checked live. Green means it's working. Red means there's a problem — and the row will tell you what's wrong and what to do.

      Checking…

      Files that didn't auto-classify

      The router put these in _Inbox/_Triage/ because it couldn't tell where they belong. Pick a portfolio + property and the file will move to Portfolios/<portfolio>/<property>/_Documents/. Every move is logged to the manifest so you can reverse it from the History tab.

      Loading…

      Move history (manifest)

      Every file or folder move ever made. The reverse button moves something back to where it came from — useful for undoing a bad route.

      Loading…

      Search the file index

      Search by filename, path, or tag. Looks at every file the nightly indexer has seen (about — files).

      Type something and press Search.

      Brain — guide

      What this is

      Brain is your unified personal data toolbox by Left Field Investments. Two halves run in one app:

      • Media — scans your photo library on GCS for explicit content, moves anything flagged into a private vault bucket, lets you restore false positives.
      • Documents — Triage / Inbox / Portfolios / History / Search across the PKL document mirror on GCS, backed by Neon Postgres.

      Brain is one of five apps in the BRICK family — see the B·R·I·C·K pill strip top-right (or press ⌘K) to switch to Runner, Intel, Cockpit, or Knowledge.

      Media — what each Console tab does

      Overview
      Recent activity feed.
      Filter
      Strictness preset and what kinds of content to flag.
      Settings
      Bucket names, threshold, GCP project — managed via gcloud run services update.
      Health
      Live check of every component (model, library bucket, vault) with copy-runnable fix commands.
      Photos
      Quick scan or Full re-scan, live activity stream, browse the library, view the vault, restore false positives.

      Documents — what each tab does

      Overview
      Alerts, last nightly run summary, recent file moves.
      Inbox
      What's queued in _Inbox/ on GCS waiting for the auto-router. Stale items (over 7 days) shown in red.
      Portfolios
      Source-of-truth list from public.properties. File counts come from the portfolio:<name> tags in file_registry. Form below adds new properties to the DB.
      Triage
      Files the auto-router couldn't classify. Pick portfolio + property and route them by hand.
      History
      Every file/folder move. The Reverse button on a row moves it back.
      Health / Search
      Live system check + free-text search across file_registry.

      Where things live

      Photo library
      GCS bucket from PML_GCS_BUCKET.
      Quarantine vault
      GCS bucket from NSFW_GCS_BUCKET.
      PKL document mirror
      GCS bucket from PKL_GCS_BUCKET.
      Database
      Neon Postgres — DSN in the Cloud Run env var NEON_DSN.
      Service
      Cloud Run pkm-cleaner-engine in us-west1, GCP project graphic-iridium-485814-b2. Public domain brain-api.lfiq.app.
      Brain by Left Field Investments. FastAPI on Cloud Run.