Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Smriti Manual

The full user guide and contributor reference for Smriti, the offline photo library.

User guide

  • Importing Google Photos — migrate a Google Takeout export directly from its ZIP files.

  • Getting Started — first run, picking a library, where data lives.

  • Indexing Photos — what scanning does, what it skips, how to refresh.

  • Timeline — the main view, navigation, keyboard shortcuts.

  • People and Faces — face detection, naming, merging, reviewing.

  • Albums — manual albums and suggested trips / events.

  • Memories — “this day, N years ago” cards.

  • Map View — geographic exploration and tile caching.

  • Insights — heatmaps, top people, top locations.

  • Search — query syntax and examples.

  • Cleanup — duplicates, bursts, and the trash workflow.

  • Settings — every preference and what it changes.

  • Keyboard Shortcuts — full list.

  • FAQ — quick answers to common questions.

  • Troubleshooting — common issues and fixes.

For contributors

Privacy and data

Getting Started

This guide walks through the first ten minutes of using Smriti: choosing a library, what happens during the first scan, and where your data lives.

What Smriti is

Smriti is a desktop photo library — Linux, macOS, Windows. It points at a folder or drive containing your photos and indexes them in place. Your originals stay where they are; Smriti reads them, extracts metadata (dates, GPS, camera, faces), and writes a small SQLite database alongside the photos.

There’s no cloud upload, no account, no server. Open the app, browse, close it.

Install Smriti

Download the installer from the Smriti website or the latest GitHub release.

  • Windows: Smriti does not have a code-signing certificate yet. If SmartScreen shows Windows protected your PC, click More info → Run anyway. Approve Install anyway or the UAC prompt if Windows shows one, finish the installer, then open Smriti from the Start menu.
  • macOS: Smriti is not notarized yet. Open the .dmg and drag Smriti to Applications. Try to open it once, then go to System Settings → Privacy & Security and click Open Anyway if Gatekeeper blocks it.
  • Linux: install the .deb/.rpm, or mark the AppImage executable with chmod +x and run it.

Official releases include SHA256SUMS beside the installers. These warnings are a consequence of the missing signing certificates, not an additional installer or download that you need to find.

First run

  1. Launch Smriti. The Welcome screen invites you to pick or drop a folder.
  2. Pick a library. Drag a folder onto the window, or click Browse to pick one. Smriti remembers it and offers it again next time.
  3. (Optional) Enable smart features. A one-time dialog offers faces, visual search, and offline place names, with the download size shown. Choose Enable smart features to download in the background, or Later to skip without being asked at every launch. You can enable individual features later in People, Search, Map, or Settings. Processing starts automatically after setup; photos remain on your device.
  4. Watch the scan. The timeline populates live as photos are indexed. The first scan on a 10K-photo library typically takes 5–15 minutes. Face detection then runs as a separate pass and can take longer — see People and Faces for how to speed that up with an optional remote GPU.

Already have a Google Photos library? Choose Import Google Photos on Welcome, select every ZIP from the same Takeout export, then choose the destination library. Smriti handles extraction, duplicate album copies and sidecar metadata. See Importing Google Photos.

Where your data goes

  • Originals — untouched, in their folders.
  • Database — at <library>/.photovault/photovault.db, on the same drive as the photos. Unplug the drive, plug it into another machine, point Smriti there: same library, same faces, same albums.
  • Thumbnails — at <library>/.photovault/thumbnails/, three preview sizes plus display renditions for supported non-browser formats.
  • Application settings — in your OS’s user config directory (Linux: ~/.config/smriti/, macOS: ~/Library/Application Support/smriti/, Windows: %APPDATA%\smriti\). Theme preference, sidebar state, recently opened libraries.

The library is fully portable. Backing it up = backing up the drive.

What to do next

  • Browse the Timeline — your main view.
  • Once face detection finishes, head to People to name a few faces.
  • Try Search: paris 2018, dad in tokyo, this month.
  • Open the Map view if your photos have GPS data.

Common first-run questions

Why is the scan so slow? The first scan walks every file under the library root, reads EXIF, hashes each file for dedup, and (with the asset pack installed) runs face detection. Modern 10K-photo libraries take 5–20 minutes total. Subsequent reindexes are incremental — only changed files are revisited. See Indexing.

Where do I add more folders? Smriti indexes one library at a time. Switch libraries via the Welcome screen or Settings → Open another library. Each library has its own .photovault/ database; switching back and forth is instant.

Can I move my library to another drive? Yes. Copy the folder including the hidden .photovault/ directory. Open Smriti on the new machine, point it at the new location. Everything resumes — thumbnails, face names, albums, search history.

Face recognition is disabled — what now? The asset pack wasn’t installed, or your hardware ran out of memory during model load. See Troubleshooting.

See also

Importing Google Photos

Smriti can migrate a Google Photos library directly from Google Takeout ZIP files. You do not need to unzip, combine or rearrange the export first.

Before importing

In Google Takeout, export Google Photos as ZIP files. Large exports are split into numbered ZIPs. Download every part from the same export; Smriti reads them as one set because a media file and its supplemental JSON metadata can be placed in different parts.

Keep enough free space in the destination library for the uncompressed unique originals. Smriti checks this before writing.

Start the import

From Welcome:

  1. Choose Import Google Photos, or drop all Takeout ZIPs together.
  2. Select every ZIP from the export.
  3. Choose the folder or drive that will become the Smriti library.

From an open library:

  1. Open Settings → Library → Google Photos.
  2. Choose Import Takeout ZIPs.
  3. Select every ZIP from the export.

That is the whole migration. Progress remains visible while you browse the app.

What Smriti preserves

  • Each byte-identical original is stored once, even when Takeout repeats it in year and album folders.
  • Distinct edited versions remain distinct files.
  • Google Photos capture dates, including corrected dates in supplemental metadata.
  • GPS coordinates and offline place names when GeoNames is installed.
  • Favorites.
  • User-created Google Photos albums.
  • Embedded EXIF camera, lens and exposure details through Smriti’s normal metadata reader.

Imported originals are ordinary files under:

<library>/Imported from Google Photos/<year>/

Takeout ZIPs are never modified or deleted.

Resume and repeat

The import is restart-safe. Completed originals are atomically placed before being recorded in the library-local Takeout ledger. If the app closes, the drive disconnects, or you cancel the job, select the same ZIP files again. Smriti verifies and reuses completed files instead of creating duplicates.

Re-importing the same export is also safe. A later export can restore additional album or metadata records for an already imported original.

Warnings and unsupported data

Smriti imports photo and video formats supported by the normal scanner. It reports unsupported files, very small invalid media, malformed sidecars and corrupt ZIP entries at completion. A missing sidecar does not block its media file; embedded EXIF and filename dates are used instead.

Only ZIP Takeout exports are supported. TGZ archives must be requested again from Takeout as ZIP. Google comments, sharing permissions and Google’s people labels are not turned into Smriti features. Smriti performs its own local face recognition.

Safety

Archive paths are validated before extraction, files are streamed instead of expanded into a second temporary tree, and a file is moved into the library only after it has been fully written and hashed. Existing files are never overwritten.

Indexing Photos

Smriti’s scanner walks your library folder, extracts metadata from each photo, and writes it to a SQLite database alongside the photos. This page covers what scanning does, what it skips, and how to refresh the index.

What a scan does

For every supported file under the library root:

  1. Reconciles what’s already indexed (see Keeping the index in sync).
  2. Skips files Smriti already knows by path, so a rescan of an unchanged library costs a folder walk, not a re-read of every photo.
  3. Fingerprints new files (size, modification time and the first 64 KB) and adds them to the library.
  4. Reads EXIF. Capture date, GPS coordinates, camera make/model, ISO, aperture, shutter, focal length, orientation.
  5. Resolves a place name if GPS is present, using the local GeoNames database.
  6. Generates thumbnails in the background.
  7. Runs face detection, then visual-search indexing, for features you have enabled.

Smriti never copies, moves, or modifies your originals.

What’s indexed

Image formats: JPEG, PNG, WebP, HEIC / HEIF (if libheif is compiled in), TIFF, BMP, GIF (first frame), plus the common camera RAW formats with embedded JPEG previews: NEF, CR2, CR3, ARW, DNG, ORF, RW2, PEF, SRW, RAF. AVIF is not supported yet.

Skipped:

  • Files smaller than 1 KB (guards against icons and junk).
  • Files without a recognised extension.
  • Hidden folders (those starting with .) — unless Scan hidden folders is enabled in Settings.
  • .photovault/ itself, always.

Keeping the index in sync

Smriti doesn’t run in the background or on a schedule. Instead, every time you open a library it quietly checks the folder for changes (turn this off with Settings → Check for changes when a library opens). To pick up photos added while Smriti is open, reopen the library.

A check:

  • Adds new files.
  • Follows moved and renamed files, keeping their faces, albums and favourites.
  • Re-processes files edited outside Smriti (new size or modification time). Same-size files whose time shifted by a whole number of quarter hours — what FAT/exFAT drives do when the time zone changes — are left alone.
  • Moves photos whose files were deleted to Smriti’s Trash, where you can restore them. If a large share of the library is missing at once (a disconnected folder, share or drive is the usual cause), nothing is trashed; the Timeline asks you first.
  • Leaves photos in unreadable folders alone instead of treating them as deleted.

Maintenance actions

From Settings → Maintenance:

  • Refresh Capture Dates — re-reads capture dates for photos and videos. Smriti prefers embedded metadata, then strict filename dates, and uses file modified time only as a marked fallback.
  • Regenerate Thumbnails — discards all thumbnails and lazy-rebuilds on next view.

How long it takes

  • First scan of a 10,000-photo library on a modern laptop: 5–15 minutes for metadata, then 30 minutes – 3 hours for face detection on CPU (the slow step). A free Kaggle/Colab GPU bridge can cut the face pass to ~5 minutes — see the face GPU bridge doc.
  • Checking for changes on an unchanged library: one folder walk — seconds on an SSD, about a minute for very large libraries on a USB hard drive.
  • Thumbnails are lazy — generated when a view scrolls a photo into the viewport, not upfront. Scrolling the Timeline for the first time is when most thumbnail work happens.

The .photovault/ folder

This hidden directory at the library root contains everything Smriti needs:

<library>/
├── photo1.jpg
├── photo2.jpg
├── trip-2018/
│   └── ...
└── .photovault/
    ├── photovault.db        # SQLite — all metadata
    └── thumbnails/          # three-tier thumbnail cache

Keep this folder when you copy or back up the library. Delete it and Smriti will re-index from scratch on next open.

See also

Timeline

Timeline is the main view — a chronological grid of every photo in your library, grouped by day, with a sticky year header that follows the scroll.

Browsing

  • Scroll in either direction. Thumbnails load as they enter the viewport, so even 250K-photo libraries scroll smoothly.
  • Sticky year header at the top of the grid shows where you are.
  • Day separators label each day’s photos. Empty days are collapsed.
  • Hover a photo to see its filename and camera info as a quick tooltip.
  • Photo stacks collapse conservative burst and duplicate groups into one timeline tile. The tile shows the suggested best photo and a stacked badge with the number of photos in the group.

Keyboard

KeyAction
↑ ↓ ← →Move highlight between thumbnails
EnterOpen the highlighted photo in the viewer
SpaceToggle selection on the highlighted photo
Shift+clickRange-select
Ctrl/Cmd+clickAdd to selection
PageUp / PageDownScroll a viewport
Home / EndJump to start / end
/Focus the search bar

Selection actions

With one or more photos selected, the action bar at the bottom of the window offers:

  • Add to album — pick an existing album or create a new one.
  • Trash — soft-delete; restorable from the Trash view.
  • Open as slideshow — fullscreen with arrow-key navigation.

Photo viewer

Click any photo to open the viewer. Within it:

KeyAction
← / →Previous / next photo
EscBack to gallery
IToggle the info panel (EXIF, location, people)
+ / −Zoom in / out
0Fit to screen
1Actual size (1:1 pixel)
[ / ]Rotate left / right
FToggle fullscreen

The info panel (toggled with I) shows EXIF metadata, detected people, GPS location with a small map preview, and the file path on disk.

If the current photo belongs to a stack, the toolbar shows a small stack button. Opening it reveals the other photos in that stack without changing normal timeline navigation: ← and → still move to the previous or next visible timeline photo. The stack tray lets you browse members, mark a different best photo, remove a member from the stack, unstack the group, or move all non-best members to Trash.

Thumbnail size

Three sizes, switched in Settings → Appearance → Thumbnail size:

  • Compact — denser grid, more photos per row.
  • Default — balanced.
  • Large — fewer per row, more detail per thumbnail.

See also

People and Faces

Smriti detects faces during scanning, groups them into clusters (one cluster per person), and lets you name, merge, and review those clusters in the People view.

Running face processing

Face processing runs automatically during the initial scan and on any rescan when new photos are added. You can also trigger it manually from Settings.

Detection uses SCRFD (face localization) and GLinTR-100 (identity embedding), both running locally via ONNX Runtime.

Clustering pipeline

Clustering happens in two stages:

  1. Gallery retrieval. Each new face is compared against the gallery of existing clusters using k-nearest-neighbor matching with confidence bands. High-confidence matches auto-assign. Everything else drops to stage 2.
  2. Complete-link agglomerative. The remaining unresolved faces are clustered pairwise. If the number of unresolved faces exceeds 2,000 in a single pass, stage 2 is skipped for performance and those faces are matched against galleries by the rescue pass instead. The cap will be lifted in a future release once HNSW-based approximate clustering replaces complete-link.

After clustering, a post-pass unifies clusters that look like the same person split by lighting variance, and a rescue pass matches any remaining orphans against existing galleries with looser thresholds.

What you can do in People

  • Rename a cluster by clicking its title.
  • Open a person to see all photos they appear in.
  • Merge two clusters into one (e.g. when the system split the same person across several clusters).
  • Review ambiguous matches — the review deck walks you through faces the system wasn’t sure about, one at a time.
  • Answer “Same person?” — when two people look alike and never appear in the same photo, People asks. Same person joins them (with Undo), Not now asks again in 30 days, Different people never asks again and keeps clustering from joining them.

Faces in a photo

Press P in the photo viewer (or the face button in its toolbar, or Edit next to People in the info panel). Every face gets a frame with its name.

  • Click a face to confirm it, say who it really is, say it is not that person, or mark it as not a face. Each can be undone. This works any time, not only while reviewing.
  • Drag across a face Smriti missed to add it. Smriti looks again in just that area, finds the face and reads it like any other, so it counts for its person in search and on their page. Pick who it is, or leave it unnamed and Smriti will group it with similar faces. If no face can be found there, nothing is added.

Tuning

  • Face confidence in Settings controls the minimum detection score for a face to be considered valid.
  • Clustering threshold in Settings controls how tolerant the system is about grouping visually similar faces. Lower values mean tighter clusters (more but smaller groups); higher values mean looser clusters (fewer but larger groups). The default works for most libraries.

Privacy

Face embeddings and detection crops never leave the device. See PRIVACY.md for the full data-flow description.

Albums

Albums let you group photos into named collections. Smriti supports both manual albums (you create them) and suggested albums (Smriti detects trips and events automatically and offers them for your review).

Manual albums

Create an album from the Albums view, or directly from a Timeline selection:

  1. Select one or more photos in any view.
  2. Click Add to album in the action bar.
  3. Pick an existing album or type a name to create a new one.

Albums support:

  • Inline rename — click the title in the album header.
  • Cover photo — right-click any photo in the album → Set as cover, or let Smriti pick automatically (landscape with faces scores higher).
  • Reordering — drag photos within an album to change the order.
  • Bulk remove — select photos, Remove from album in the action bar.

Removing a photo from an album doesn’t delete the photo — it stays in the Timeline.

Suggested albums

Smriti analyses your library for two kinds of clusters and proposes them as drafts you can accept, ignore, or dismiss:

  • Trips — runs of photos taken away from your home city for at least a day. Photos must clear a few gates (duration, photo count, distance from home, rarity) before they’re suggested. Detected trips are titled something like “Trip to Tokyo · March 2019”.
  • Events — bursts of activity within your home area: a birthday, a wedding, a concert. Detected events lean on photo density, duration, and face overlap with people you’ve already named.

Open the Albums view to see pending suggestions. Each card shows:

  • A cover photo,
  • The detected title,
  • A photo count,
  • Accept / Dismiss buttons.

Accept promotes the suggestion to a real album that you can edit like any manual one. Dismiss marks it as not-an-album so Smriti doesn’t re-suggest it the next time it scans.

Settings that affect suggestions

  • Home city override in Settings tells trip detection where you live. By default Smriti infers home from the city where most of your photos are taken. Override when you’ve moved or the inference is wrong.
  • Geocoding — trip detection needs your photos to have place names. If GPS data is present but place names are missing, run Settings → Fill in place names.

Album cover photo selection

When you don’t manually set a cover, Smriti picks one with a small heuristic: prefer landscape orientation, prefer photos with faces, break ties with recency. You can always override.

See also

  • Memories — related “on this day” surfacing
  • Map — pivot from a place to all photos there
  • Settings → Map — home-city override

Memories

Surprise me

The ✨ button beside slideshow controls in Timeline and album headers starts an image-first, continuous slowshow. Timeline draws from the library; an album stays within that album. Older days get preference, with occasional related photos and duplicate suppression.

The default is 12 seconds per image. Use the existing timing control, Space to pause, arrow keys to revisit a photo, and Escape to close. Date/place details appear briefly when known; there are no captions to write. Recent selections stay in local app storage, separately for each library. Blocked people are respected. A library with just one eligible photo shows it without autoplay; an empty eligible pool leaves the current view in place.

Memories surfaces “this day, N years ago” style cards when you open Smriti. They’re generated locally, on demand, when you visit the Memories view (or read the banner on the Timeline). Nothing is pre-rendered, no server, no schedule.

How memories are generated

Smriti runs four generators against today’s date, then ranks the results and picks the best ~20 to surface:

  • On this day — photos from the exact same calendar day in any previous year.
  • Fallback window — when “on this day” finds nothing, widens to a ±7-day window so a sparse library still sees something.
  • Seasonal recap — gathers a whole month or season from a past year if there’s enough density.
  • Year recap — ultimate fallback: at least one card from a year with any history at all.

A hero photo is chosen for each memory: landscape orientation preferred, photos with faces ranked higher, recency breaks ties.

When memories appear

  • Library age — Memories only surface once your oldest photo is at least three months old. New libraries see nothing for the first quarter.
  • Photo age — Photos newer than three months don’t appear in memories. The point is nostalgia, not yesterday.
  • Daily refresh — Each day surfaces a new set; yesterday’s cards are recomputed.

What you can do

  • Open a memory card to see all the photos behind it as a filmstrip.
  • Slideshow — autoplay through the photos with arrow-key navigation. Pause with Space.
  • Dismiss a memory if you don’t want to see it again — useful for trips or events you’d rather forget. Dismissed memories don’t resurface in future months.

Privacy

Memories are computed entirely on-device. No server-side generation, no curated highlight reel, no notification that you “should look at this.” The Memories view is something you visit on purpose.

Disabling memories

Settings → Memories → Enable memories toggles the feature entirely. When off, the Timeline banner and the Memories view both hide.

See also

Map View

The Map view plots every geotagged photo in your library on an interactive world map. Pan, zoom, and click clusters to drill into specific places.

What you see

  • Clusters — at zoomed-out levels, nearby photos are grouped into circular badges showing the photo count.
  • Pins — individual photos at high zoom.
  • Filmstrip — clicking a cluster or pin opens a side panel with the photos for that location and a scrollable filmstrip.

Map tiles

Smriti uses OpenStreetMap tiles via MapLibre GL. Tiles are downloaded on demand when you pan to a region for the first time, then cached locally on in the app’s WebView storage. Fresh cached tiles avoid network requests; expired tiles are refreshed when online.

Cache location: the WebView Cache API, shared by Map and the photo-detail minimap. Use Settings to manage it; it is not stored on the photo drive.

Cache size cap: configurable in Settings → Map → Tile cache size. The default 500 MB is enough for the regions you regularly visit; older inserted tiles are evicted first.

Both Map and photo location minimaps can request tiles while visible.

Working offline

Once you’ve panned over a region in Map view, those tiles are available offline until evicted or cleared. Useful before a trip where you know you’ll want to browse without connectivity.

To clear the cache (e.g. before donating the drive), use Settings → Map → Clear tile cache.

Photos without GPS

Photos that lack EXIF GPS tags don’t appear on the map. You can still find them in:

  • The Timeline (everything’s there)
  • A search for the place name (if the place was filled in manually)

Place names

When GPS is present, Smriti resolves it to a city + country via the local GeoNames database (part of the asset pack). Place names feed into Search and album-suggestion detection. If your photos have GPS but no place names yet, run Settings → Fill in place names.

The GeoNames data ships with the asset pack — it’s offline. No request to a geocoding API.

See also

  • Search — find photos by city or country
  • Albums — trip suggestions use geographic clusters
  • Privacy — map tile requests are the one always-on network call

Insights

Insights gives you a one-page summary of how, when, and where you shoot. Heatmap, top people, top locations, monthly breakdown, camera usage. Click anything to pivot into search.

What’s on the page

Heatmap

A 53-week × 7-day grid of your photo activity for the selected year. Each cell is a day; colour intensity scales with the photo count for that day. Hover for the exact count and date. Click a cell to open a search for that specific date.

The default year is the current calendar year; switch via the year selector at the top of the page.

Monthly bars

A bar chart of photo counts per month for the selected year. Hover for the exact count.

Top people

The 10 people who appear in the most photos this year (or this library if no year is filtered). Each row shows:

  • Person’s avatar (their hero face),
  • Name,
  • Photo count.

Click any person to open their detail view — every photo they appear in, across years.

If you have more than 10 people, Show all expands the list.

Top locations

Country and city breakdowns:

  • By country — every country your photos came from, with totals.
  • By city — every city, with totals.

Click any location to search for it.

Camera usage

How often each camera (and lens, when present) appears in your library. Useful for “which lens did I actually use last year?” type questions.

Year filter

The year selector at the top controls every panel on the page. All years shows your entire library; specific years scope everything to that year.

The heatmap defaults to its own year (last year with significant photo activity) regardless of the page filter — heatmaps for empty years are pointless.

Most clickable elements on the Insights page open a search:

  • Heatmap cell → photos from that day
  • Top-people row → that person’s detail
  • Top-location row → photos from that place

This makes Insights the fastest navigation surface for “where was I in 2019” or “who did I shoot the most last summer” type questions.

See also

  • Search — the destination Insights pivots into
  • People — top-people clicks go here
  • Map — geographic counterpart to top-locations

Search

Smriti’s search is one box for the library metadata it already has: named people, dates, places, albums, favourites, media type, filenames, camera names, and optional local visual meaning. It does not use cloud AI.

What Search Understands

QueryMeaning
Goa 2023Photos from Goa taken in 2023
Dad 2024Photos containing Dad from 2024
Dad and MomPhotos containing both Dad and Mom
only DadPhotos where every detected face is Dad
only Dad and MomPhotos where every detected face is Dad or Mom, and both are present
favourites DadFavourite photos containing Dad
videos Goa 2024Videos from Goa taken in 2024
album Goa TripPhotos in the matching album
Nikon GoaFilename/camera/location fallback for unmatched words
beach sunsetVisually similar photos, when visual search is installed and indexed

The interpreted filters appear as chips above the results so you can see what Smriti understood.

People

People search uses names from the People view. Matching is case-insensitive and supports combinations:

Dad
Dad and Mom
Dad with Mom

Multiple people are treated as an intersection: every returned photo must contain every requested person.

Strict only

only is intentionally strict.

only Dad
only Dad and Mom

A photo matches only Dad only when:

  • face processing has completed for the photo
  • Dad appears in the photo
  • no detected face is assigned to another person
  • no detected face is unassigned or unknown

If a photo has an unrecognised face, it is excluded. This avoids showing group photos when you asked for one person only.

Dates

Search recognises:

  • years: 2024
  • month + year: March 2019, Mar 2019, 2019 March
  • exact dates: 2024-03-15
  • relative dates: today, yesterday, this week, last month
  • seasons: spring 2020, fall 2021

Date filters combine with every other filter.

Places

Places are resolved from your library’s stored city/country metadata. There is no hardcoded city list in smart search. If GPS reverse-geocoding has not been run, place search has less to work with.

Albums, Favourites, And Media

Use album <name> or in album <name> to filter by album.

Use favourites, favorites, or starred to filter to favourite items.

Use videos, video, photos, or photo to filter media type.

Visual Meaning

Visual search is optional. Click Enable visual search in Search or Settings; Smriti installs the local model and runtime, then indexes automatically. The model lives outside the app binary and per-library vectors stay under .photovault/semantic.

When visual search is ready, natural queries such as:

beach sunset
food photos 2024
videos mountains

are matched against local image/video-poster embeddings. Structured filters still apply: food photos 2024 is semantic food plus photo media type plus the 2024 date range, not a separate loose search path.

What It Does Not Do Yet

  • No cloud lookup.
  • No OCR dependency in the main search path.
  • No regex or wildcard syntax.
  • Trashed photos are excluded.

Pivots From Elsewhere

Several views open Search with a pre-filled query:

  • Insights -> click a heatmap cell, person, or location
  • Map -> click a cluster or place
  • People -> click a person card

See Also

  • Timeline - full chronological view
  • People - naming faces makes them searchable
  • Map - geographic counterpart

Cleanup

Cleanup brings the three tools for thinning out a library into one place: Duplicates, Bursts, and Trash. Each surfaces a different kind of clutter; all of them keep your originals safe until you confirm a deletion.

Duplicates

Smriti detects two kinds of duplicates during indexing:

  • Exact duplicates — files with identical SHA-256 hashes. These are byte-for-byte copies, often the result of importing the same card twice or copying photos between folders.
  • Perceptual near-duplicates — files that look the same to the eye but aren’t byte-identical. Detected via a DCT perceptual hash (pHash) with a tight threshold (~94% bit agreement). This catches re-encoded copies, JPEG-from-RAW exports, watermarked variants, and rescaled exports of the same source.

The Duplicates view groups suspected matches together. For each group:

  • Smriti suggests a keeper (typically the largest / highest- resolution version with the most-original-looking filename).
  • The rest are flagged for trash.
  • Override the suggestion with a click; Apply moves the marked copies to trash.

Why the threshold is tight

Perceptual hashing is fuzzy by design. A loose threshold flags visually similar but compositionally different photos as “duplicates” — same wall, same lighting, but different subjects. Smriti uses a strict threshold so you don’t have to second-guess every group. Photos that look similar but were taken seconds apart belong to the burst detector, not duplicates.

Bursts

Bursts are short rapid-fire sequences — your phone’s burst mode, or a photographer firing off frames at a moving subject. Smriti detects them by:

  • Time gap — consecutive photos within 10 seconds of each other.
  • Burst length — 2+ photos.
  • Similarity — ≥ 65% visual similarity between consecutive shots.

The Bursts view shows each detected burst as a card; opening it reveals the full sequence. Smriti picks a “best” frame as the keeper (sharpest, with eyes-open if faces are present); the rest can be trashed in bulk.

Bursts are detected on demand the first time you visit the view, then cached. New photos trigger a re-scan.

Tuning burst detection

  • Burst window in Settings (default 10s) widens or tightens the time gap used.
  • Detection ignores folder boundaries by default — modern phones group photos by month, not by burst session, so requiring same- folder grouping misses real bursts.

Trash

Trashing a photo doesn’t delete it. It moves the row’s is_trashed flag to true; the photo is hidden from Timeline, Search, Memories, and every other view. The file on disk is untouched until you permanently delete it.

The Trash view lists trashed photos. From it you can:

  • Restore — return a photo to the active library.
  • Delete permanently — remove the file from disk and the database row. There’s no undo for this.
  • Empty trash — permanent-delete everything in trash.

There is no automatic age-based deletion. Empty the trash explicitly after reviewing it.

Workflow

A typical cleanup pass:

  1. Open Duplicates → review the suggested keeps → trash the redundant copies.
  2. Open Bursts → review each burst → keep the best, trash the rest.
  3. Browse the Timeline for anything obviously bad you missed.
  4. Open Trash → verify the list → empty trash when ready.

See also

Settings

Settings control theme, indexing behavior, face thresholds, burst windows, map cache, updates, and maintenance actions.

Changes are persisted locally in user config storage.

Appearance

  • Theme — dark, light, or follow the system theme.
  • Show photo stacks in timeline — collapse conservative burst and duplicate groups into one timeline tile. Turn this off to show every photo individually.

Indexing

  • Scan hidden folders — include directories starting with .. Off by default because hidden folders often contain metadata, not photos.
  • Date format — how dates render in day headers and insights.
  • Thumbnails (Library) — where thumbnails and face crops are kept. Inside the library by default, so they travel with it. For a library on an external or slow drive, Keep on this computer copies them to this computer’s own disk (or a folder you choose) and browsing gets much faster. Your photos and the library’s database stay on the drive, and the library keeps its own copy, so another computer still shows everything. Keep in the library moves them back.

Assets

  • Asset inventory — shows local runtimes, models, and offline data Smriti can use, including their status, size, and on-disk location.
  • Asset locations — each row shows the exact file path Smriti is using. In development checkouts and portable installs, assets may be resolved from different search roots.

Assets live outside the main app binary so the installer stays small. Timeline browsing still works when optional assets are missing; local face recognition, place lookup, and local visual search depend on the matching assets being installed.

  • Download visual model — installs the optional local ViT-B-32 SigLIP2 256 semantic search model. The download is large and is stored in the user asset directory, not bundled into Smriti.
  • Index visual search — creates per-library image vectors under <library>/.photovault/semantic. It also requires the ONNX Runtime installed by smart setup. It is resumable; the Welcome setup starts it automatically and later scans pick up pending files.
  • Recheck visual search — refreshes the status counts shown in Settings.

Once installed and indexed, Search can match text such as beach sunset against image meaning, and Photo Detail can show visually similar photos.

Face Recognition

  • Face confidence — minimum detection score for a face to be stored. Lower values catch more faces but also more false positives.
  • Clustering threshold — how tolerant the system is when grouping visually similar faces. Lower means tighter clusters (more groups, cleaner), higher means looser (fewer groups, more mixing). Default works for most libraries.

See the People and Faces guide for the full pipeline.

Burst detection

  • Burst window — time window (in seconds) used to group burst shots. Default 3 seconds matches most camera apps.

Photo stacks reuse burst and duplicate detection results. After either detector runs, Smriti refreshes stack suggestions and chooses a best photo using the detector’s suggestion plus quality signals such as resolution, file size, faces, sharpness, and exposure.

Trash

Trashing is reversible. Permanent deletion is explicit; there is no automatic age-based deletion.

Map

  • Tile cache size — how much disk space tile caching can use. Clearing the cache forces a redownload on next view.
  • Home city override — used for trip-detection and “photos from this trip” grouping.

Memories

  • Enable memories — toggle the “on this day” cards in the Timeline banner and the dedicated Memories view.

Updates

  • Automatically check for updates — when enabled, Smriti queries api.github.com at most once every 24 hours to see if a new release has been published. This is opt-in and off by default. See PRIVACY.md for the full disclosure.
  • Check for updates now — run the check immediately, regardless of the automatic-check setting.

When an update is available, a banner appears at the top of the app with a Download button. What the button does depends on how you installed Smriti:

  • AppImage, portable Windows zip — downloads the new artifact, verifies its SHA256 against the published SHA256SUMS, and atomically replaces the running binary. You’ll be prompted to relaunch.
  • Windows MSI — downloads the new MSI, triggers the Windows installer with a UAC prompt. Smriti exits; relaunch from the Start menu when the install completes.
  • macOS .dmg — downloads the new .dmg and opens it. Drag the new .app into /Applications as you did for the first install.
  • System package manager (apt, brew, flatpak, winget) — the banner shows the matching upgrade command instead of self-replacing. Smriti won’t interfere with your package manager.
  • Source build — the banner suggests git pull && cargo build --release.

Maintenance actions

These are one-shot operations — Smriti doesn’t run them on a schedule.

  • Import Takeout ZIPs — migrate all parts of a Google Photos Takeout export into the open library without manually extracting it.
  • Rescan Library — re-walk the drive and pick up newly added, moved, or deleted files.
  • Rebuild Faces (Full) — re-run face detection + clustering from scratch. Useful after a face-model update.
  • Check for Changes — scan for moves and deletions without re-indexing unchanged files.
  • Regenerate Thumbnails — invalidate cached paths and run the thumbnail pass.
  • Refresh Capture Dates — re-read capture dates for photos and videos. Smriti prefers embedded metadata, then strict filename dates, and uses file modified time only as a marked fallback.
  • Asset Inventory — inspect which local model/runtime/data files are present and which exact paths Smriti resolved.
  • Enable smart features — shows the one-time download size and installs missing runtimes, models, and offline place data in the background. Enable individual features lets you choose only faces, visual search, or offline place names. Recheck refreshes readiness; failed downloads offer Retry. Existing valid files are kept.
  • Fix Rotated Photos — regenerate cached data for photos whose EXIF orientation wasn’t previously applied.

Keyboard shortcuts

See the Keyboard shortcuts guide for the full list. Settings also renders an inline reference at the bottom.

Keyboard Shortcuts

Full reference of every keyboard shortcut in Smriti. The in-app overlay (press ? anywhere) shows a condensed version of this list.

Anywhere

KeyAction
?Toggle the keyboard-shortcuts overlay
/Focus the search bar
EscBack · close overlay · cancel selection
Ctrl/Cmd+,Open Settings
Ctrl/Cmd+1 … 9Jump to sidebar section 1–9
Tab · Shift+TabMove focus between cards / controls

Timeline (and any grid view)

KeyAction
↑ ↓ ← →Move highlight
EnterOpen the highlighted photo in the viewer
SpaceToggle selection on the highlighted photo
Shift+clickRange-select
Ctrl/Cmd+clickToggle a single photo’s selection
Ctrl/Cmd+ASelect all photos currently in view
PageUp · PageDownScroll a viewport
Home · EndJump to first / last
Delete / BackspaceMove selection to Trash

Photo viewer

KeyAction
← · →Previous · next photo
EscBack to gallery
IToggle the info panel
PPeople in the photo: fix who a face is, or add a missed face
+ · −Zoom in · out
0Fit to screen
1Actual size (1:1 pixel)
[ · ]Rotate left · right
FToggle fullscreen
SpaceToggle selection on this photo

Slideshow

KeyAction
SpacePlay · pause
← · →Previous · next
EscExit slideshow
FToggle fullscreen

People & Person Detail

KeyAction
EnterOpen the highlighted person
MOpen the merge-person dialog (in Person Detail)
ROpen the rename dialog (in Person Detail)

Face review

When stepping through ambiguous face assignments:

KeyAction
YConfirm — yes, this is the suggested person
NReject — no, queue for a different person
SpaceSkip — decide later
←Previous face
→Next face

Map

KeyAction
+ · −Zoom in · out
↑ ↓ ← →Pan
EscClose pin popover

See also

  • Timeline — where most shortcuts apply
  • Settings — preferences that affect navigation

FAQ

Does Smriti upload my photos?

Processing is local by default. If enabled, the GPU bridge uploads face crops and the provider-backed assistant sends conversation and library context to your configured service. Maps and photo-location minimaps fetch tiles; optional model/asset downloads and update checks also use the network.

See PRIVACY.md for the full disclosure.

Where is my database stored?

On the indexed drive inside .photovault/photovault.db. That keeps the library fully portable — unplug the drive, plug it into another machine, and Smriti can resume.

Can I use Smriti without internet?

Yes, after the optional assets are installed. Once the asset pack is in place, everything — scanning, face recognition, clustering, search, map (for previously-cached tiles), insights — works offline.

Why does Windows or macOS warn during installation?

Smriti does not have paid platform signing certificates yet. On Windows, click More info → Run anyway, then approve Install anyway or UAC if prompted. On macOS, try opening Smriti once and then choose Open Anyway under System Settings → Privacy & Security. Download only from the Smriti website or GitHub releases; every release includes SHA256SUMS.

How do updates work?

Smriti can check for new releases automatically, but the check is opt-in — disabled by default. On first run a prompt asks whether you want it; you can change the answer later in Settings → Advanced.

When an update is available and you click Download in the banner, what happens depends on how you installed Smriti:

  • AppImage or portable Windows zip — Smriti downloads the new artifact, verifies its SHA256 checksum, and atomically replaces the running binary. You’ll be prompted to relaunch.
  • Windows MSI — triggers the Windows installer with a UAC prompt; relaunch from the Start menu when it completes.
  • macOS .dmg — opens the downloaded .dmg; drag the new .app into /Applications as you did for the first install.
  • Package manager (apt, brew, flatpak, winget) — the banner shows the matching upgrade command instead of self-replacing. Smriti won’t interfere with your package manager.

No photo data or telemetry leaves your machine during the check — only a standard User-Agent and your IP, which are implicit in any HTTP request. See PRIVACY.md.

Why does my face-recognition pass take a long time?

Face detection runs ONNX models on the CPU by default. A 10K-photo library typically takes 5-20 minutes on a modern laptop. Progress is shown in the People view. The pass is resumable — close and re-open the app, it picks up where it left off.

Why don’t I see results for very large libraries (>250K photos)?

The v1.0 release ships with a load cap of 250,000 photos per drive to keep memory use bounded. Libraries larger than that are on the post-v1.0 roadmap (full cursor-based streaming from the database); for now, you can split the library across multiple indexed drives to stay under the cap.

I built from source — is auto-update still safe?

Smriti detects source builds by looking at the executable path (anything under a target/debug or target/release directory). For source builds, the update banner won’t try to self-replace the binary; it just suggests git pull && cargo build --release.

Something’s broken. Where do I report it?

Use the issue tracker with the bug-report template, which asks for the info that helps most (OS, version, install method, logs). For questions or feature ideas, prefer Discussions.

Security vulnerabilities go through GitHub Security Advisories privately — see SECURITY.md.

Troubleshooting

Common issues and how to resolve them. If something here doesn’t match what you’re seeing, open a GitHub Discussion with your OS, Smriti version, and the symptom.

Face features are disabled

Symptom: People offers to enable face recognition instead of finding faces.

Causes & fixes:

  1. Face files not installed. Click Enable face recognition in People or under Settings → Assets → Enable individual features. The download size is shown before you proceed. Setup requires internet once; processing runs locally and starts automatically when the files are ready.
  2. Asset download was interrupted. Click Retry in the feature prompt. Installation is staged, so an interrupted attempt does not replace previously working assets.
  3. Disk space. Leave room for both downloaded archives and unpacked files. Visual search alone needs about 1.5 GB for its models; enabling all features needs several GB of free space during installation.
  4. Source build without assets. Run ./scripts/setup_assets.sh (Linux/macOS) or .\scripts\setup_assets.ps1 (Windows) at the repo root.

The scan is stuck

Symptom: Progress bar hasn’t moved in several minutes.

Causes & fixes:

  1. Face detection is the slow step. Once metadata extraction completes, face detection runs as a separate pass that can take 30 minutes to several hours on CPU for a large library. The progress reads “0 / N faces” while it’s working its way through. Don’t close the app — close-and-resume works but the pass starts over for the current photo. See the GPU bridge doc for a 10–70× speedup via free Kaggle/Colab.
  2. A single huge file is hanging the decoder. If progress restarts on a specific file every time, that file may be corrupt or unsupported. Move it out of the library and rescan.

Map tiles aren’t loading

Symptom: The Map view shows a grey background or “Failed to load tile” placeholders.

Causes & fixes:

  1. No internet. Map tiles come from tile.openstreetmap.org on first view. Without internet, only previously-cached regions render.
  2. Cache size cap reached. Settings → Map → Tile cache size limits cache size; older tiles are evicted. If you’ve heavily panned, the most-distant tiles got dropped. Increase the cap or re-pan to reload.
  3. OSM rate-limiting. Excessive panning in a short window may trigger temporary throttling. Wait a few minutes.

Photos aren’t showing up after I added them

Symptom: New photos copied into the library folder don’t appear in the Timeline.

Fix: Smriti doesn’t watch the filesystem for new files. Run Settings → Maintenance → Rescan Library (full rescan) or Check for Changes (faster incremental).

A face is in the wrong cluster

Fix:

  1. Open the Person view that has the wrong photo.
  2. Click the photo’s face thumbnail in the person’s face strip.
  3. Choose Reassign → pick the correct person, or Remove from this person to send it back to the unknown queue.

For “the same person is split across multiple clusters,” open one of the clusters and click Merge person to combine them.

The wrong city shows for a photo

Fix: Smriti resolves GPS → city/country via the local GeoNames database. If the resolved city looks wrong:

  1. Check the photo’s EXIF GPS — it may be wrong at the source.
  2. If GPS is correct but the city is wrong, the GeoNames data may not have the specific village/town. Smriti falls back to the nearest admin-seat city by population. Open an issue if the fallback is unhelpful.

Build fails on Linux due to missing system libraries

Install the GUI toolkit headers:

sudo apt-get install libxkbcommon-dev libwayland-dev \
                     libxcb-shape0-dev libxcb-xfixes0-dev

See BUILD.md for the full list.

Windows SmartScreen warned me before launching Smriti

Smriti does not have a code-signing certificate yet, so Windows cannot show a verified publisher and SmartScreen may stop the installer on first use.

Installation path: On Windows protected your PC, click More info → Run anyway. Approve Install anyway or the UAC prompt if it follows, complete the installer, and launch Smriti from the Start menu. Download Smriti only from its website or GitHub release page; the SHA256SUMS file alongside each release lets you verify the downloaded file.

macOS Gatekeeper warned me before launching Smriti

Smriti isn’t notarized (Apple Developer ID costs $99/year, currently deferred). Gatekeeper warns on any non-notarized app.

Workaround: Right-click the app → Open → Open anyway. Or in System Settings → Privacy & Security, click Open Anyway after the first launch attempt.

My library is huge — Smriti only shows 250K photos

Symptom: Smriti caps display at 250,000 photos per library.

Workaround for now: Split the library across multiple indexed drives, each under the cap. Cursor-based streaming for arbitrarily large libraries is on the post-1.0 roadmap.

Updates aren’t checking

Symptom: Settings → Check for updates now does nothing visible.

Causes:

  1. The update check is opt-in and off by default. Enable Automatically check for updates in Settings first.
  2. If you’re on a source build, Smriti detects this from the executable path and won’t try to self-replace. The update banner suggests git pull && cargo build --release instead.
  3. If you installed via a system package manager (apt, brew, flatpak, winget), the update banner shows the upgrade command instead.

See also

Build from Source

Smriti builds natively on Linux, Windows, and macOS.

Prerequisites

Linux

  • Rust toolchain (stable, MSRV 1.89+) via rustup
  • Node 20.19+ and npm (the frontend is Vite 8 + Svelte 5)
  • Tauri build deps. On Ubuntu/Debian:
sudo apt-get update
sudo apt-get install -y \
  libwebkit2gtk-4.1-dev \
  libgtk-3-dev \
  libayatana-appindicator3-dev \
  librsvg2-dev \
  libsoup-3.0-dev \
  libjavascriptcoregtk-4.1-dev \
  libdbus-1-dev \
  pkg-config \
  libheif-dev          # only if you want HEIC decoding

Windows

  • Rust toolchain via rustup
  • Node 20.19+ via the official installer or winget install OpenJS.NodeJS
  • Visual Studio Build Tools (Desktop development with C++) — provides the MSVC linker that cargo build and Tauri’s bundler both need.
  • WebView2 Runtime — preinstalled on Windows 11; auto-downloaded by Tauri on Windows 10 if missing.

macOS

  • Xcode command line tools (xcode-select --install)
  • Rust toolchain via rustup
  • Node 20.19+ via Homebrew (brew install node) or the official installer

One-time tooling

cargo install tauri-cli --version "^2" --locked

Smriti now ships a small core application. Face recognition and offline geocoding use an optional asset pack (ONNX runtime + models + geonames DB) that can be installed in-app with one click.

Manual setup scripts are still available:

Linux/macOS:

./scripts/setup_assets.sh

Windows PowerShell:

powershell -ExecutionPolicy Bypass -File scripts\setup_assets.ps1

Both scripts are idempotent and useful for local development/testing.

Build and run

Smriti is a Tauri 2 app: the Rust engine + Tauri shell live in src/ and src-tauri/, the Svelte 5 frontend lives in src-ui/. The cargo tauri CLI orchestrates both halves.

Dev mode (hot reload via Vite, opens a native window):

cd src-ui && npm install && cd ..   # one-time
./scripts/dev.sh                    # Linux / macOS
# .\scripts\dev.ps1                 # Windows PowerShell

Production bundle (.deb + AppImage on Linux, .msi on Windows, .dmg / tar.gz on macOS):

cargo tauri build

Engine-only build (useful when iterating on src/ without a window):

cargo build -p smriti -p smriti-tauri

Test and lint

cargo fmt --check
cargo clippy --all-targets -p smriti -p smriti-tauri -- -D warnings
cargo test -p smriti -p smriti-tauri
(cd src-ui && npm run check && npm run build)

Linux packaging (.deb + AppImage)

The official path is cargo tauri build — it produces both .deb and AppImage in target/release/bundle/. Tag-driven CI (.github/workflows/release.yml) runs the same command on a fresh Ubuntu runner for every v* tag.

For a local .deb build through the same Tauri path as CI:

./scripts/release_local.sh ubuntu

Output:

  • target/release/bundle/deb/*.deb

Install test:

sudo dpkg -i target/release/bundle/deb/*.deb
smriti-tauri

Uninstall test:

sudo apt remove smriti

Linux AppImage

AppImage is built in CI from release tags (v*) via .github/workflows/release.yml. Output directory:

  • target/release/bundle/appimage/

Run:

chmod +x target/release/bundle/appimage/*.AppImage
target/release/bundle/appimage/*.AppImage

Windows packaging (MSI + ZIP)

MSI packaging should run on native Windows with the MSVC build tools.

Prerequisites

  • Tauri CLI:
cargo install tauri-cli --version "^2" --locked

Build MSI installer

From repository root:

cd src-tauri
cargo tauri build --ci --bundles msi

Output:

  • target\release\bundle\msi\*.msi

MSI installs the core app. Optional assets are installed separately.

Troubleshooting

  • Optional assets not detected: install via startup prompt, or run setup script and restart app.
  • GUI linking errors on Linux: install missing Wayland/X11 dev packages listed above.
  • Slow Windows builds on UNC path: expected; primary development should happen in WSL.

Local installer verification scripts

Linux/macOS shell:

./scripts/verify_installers_local.sh

Windows PowerShell:

powershell -ExecutionPolicy Bypass -File scripts\release_local.ps1 -Mode full

These scripts summarize installer packaging status locally before you create release tags.

Mandatory push gate before any git push:

cargo fmt --all --check
cargo clippy --all-targets
cargo test --no-run

Automated release orchestration (draft-only publish flow)

From Windows PowerShell, once local checks are green:

powershell -ExecutionPolicy Bypass -File scripts\release_publish.ps1 -Version v0.1.0-rc3 -RunLocalChecks -Wait

Behavior:

  • validates repo state and branch sync
  • optionally runs local verification first
  • creates and pushes the release tag
  • waits for release.yml workflow
  • verifies expected assets in the GitHub draft release
  • prints draft release URL for manual publish

By design, this script does not auto-publish the release.

Asset installer URL behavior

In-app optional asset installation resolves in this order:

  1. SMRITI_ASSET_PACK_PATH (local zip path override; legacy PHOTOVAULT_ASSET_PACK_PATH is also accepted)
  2. SMRITI_ASSET_PACK_URL (custom URL override; legacy PHOTOVAULT_ASSET_PACK_URL is also accepted)
  3. version-pinned release URL (.../releases/download/v<app-version>/Smriti-Assets.zip)
  4. latest published release fallback (.../releases/latest/download/Smriti-Assets.zip)

If you are testing locally before publishing a release, set SMRITI_ASSET_PACK_PATH.

Testing in Smriti

This document explains how Smriti is tested and how you should test the code you add. Tests are the contract: if your PR’s tests pass, your code lands; if they fail, the failure is the conversation.

Pyramid

                ┌──────────────────────────────┐
   Level 4      │  Frontend unit (Vitest)      │   per util / per store
                └──────────────────────────────┘
                ┌──────────────────────────────┐
   Level 3      │  Workflow integration (Rust) │   one per critical user journey
                └──────────────────────────────┘
                ┌──────────────────────────────┐
   Level 2      │  DTO snapshots + service     │   wire-format + business logic
                │  integration (Rust)          │
                └──────────────────────────────┘
                ┌──────────────────────────────┐
   Level 1      │  Unit tests (Rust + TS)      │   per pure function
                └──────────────────────────────┘

All four levels run on every PR. CI blocks merge if any test fails.

What we don’t test (and why)

  • The Tauri runtime itself. Commands like library_close are thin wrappers: state.library.write().await; *guard = None;. Testing through Tauri’s IPC layer needs mock_app(), which on some platforms (Windows specifically) hits Tauri runtime initialization bugs in the test binary. Instead, we test:

    • The engine service the command wraps (Level 3 workflow tests)
    • The DTO it returns (Level 2 snapshot tests)
    • The args struct it takes (free via serde tests if anything funky)

    This means commands should be thin: the body is one call to a service. If you find yourself writing branching logic inside a #[tauri::command], push that logic down into a service and call the service from the command. The service tests cover it.

  • End-to-end browser flows. No tauri-driver / WebDriverIO yet. The pyramid above is robust enough that runtime bugs are caught at Level 3 before they hit the UI. We may add browser tests later for the most-trafficked workflows, but they’re not a contributor obligation today.

Where tests live

tests/                                # Engine integration tests
├── common/mod.rs                     # Shared helpers (image gen, library factory)
├── common_smoke.rs                   # Smoke tests for the helpers themselves
├── db_integration.rs                 # DB schema, photo repo, queries
├── face_clustering_integration.rs    # Face pipeline w/ synthetic embeddings
├── thumbnail_pipeline.rs             # Thumbnail gen across formats
├── timeline_scale.rs                 # 50k-photo SLA test (ignored by default)
└── workflow_*.rs                     # One file per critical user journey

src-tauri/tests/
└── dto_snapshots.rs                  # Wire-format contract — every From<E> for Dto

src-ui/src/lib/
├── slideshowQueue.test.ts            # Vitest — pure logic
└── thumbnailQueue.test.ts            # Vitest — pure logic

Conventions

Hard rules (CI-enforced)

  1. cargo fmt --all --check passes.
  2. cargo clippy --all-targets -D warnings passes.
  3. cargo test passes (engine + Tauri integration tests).
  4. npm run check passes (Svelte + TypeScript type-checking).
  5. npm run test passes (Vitest).
  6. DTO snapshot changes are intentional. When dto_snapshots.rs fails, you must either revert the unintended change or run cargo insta review to accept the new wire format. The diff must be reviewed by a maintainer.

Soft rules (reviewers apply)

  • Test names follow <subject>_<scenario>_<expected>. E.g. geocoding_rural_photo_returns_none, slideshow_next_after_last_when_loop_off_pauses. A reviewer reading test names alone should understand what’s being checked.
  • Arrange / Act / Assert with comments separating the three. Long setup gets its own helper in tests/common/mod.rs.
  • Hermetic. No shared mutable state. No tests that depend on test order. tempfile::TempDir for the filesystem; in-memory SQLite or per-test tempdir for the DB.
  • No thread::sleep for synchronisation. Use channel sends, atomic flags, tokio::time::timeout. A test that sleeps will flake under CI load.
  • Rust: prefer assert!(... , "<why>") — the message shows up in the failure output and saves a reviewer from git blame.
  • **TS: prefer expect(...).toEqual(...) with descriptive describe
    • it text** that reads like a sentence.

Decision tree: “what kind of test do I write?”

Did you add a pure function?
├── yes → unit test next to it (same file's `#[cfg(test)] mod tests`
│         for Rust, sibling `.test.ts` for TypeScript).
└── no  → continue
Did you add a `#[tauri::command]`?
├── yes → make sure the body is a single call to a service. Test
│         the service in `tests/workflow_*.rs` or via direct
│         service-level unit test. If the command returns a new DTO
│         shape, add a snapshot in `src-tauri/tests/dto_snapshots.rs`.
└── no  → continue
Did you add a new service or change an existing service's contract?
├── yes → integration test in `tests/` that constructs a tempdir
│         library, exercises the service, asserts DB / file state.
└── no  → continue
Did you add or rename a `From<EngineType> for SomethingDto`?
├── yes → add a snapshot test in dto_snapshots.rs. Construct the
│         engine type with deterministic values, convert, snapshot.
└── no  → continue
Did you fix a bug?
└── yes → add a regression test that fails *before* the fix and
          passes after. Reviewer will check this is true by reverting
          your fix locally and re-running the test.

Running tests

# Everything CI runs:
scripts/ci_local.sh ci

# Just the Rust suite (engine + tauri):
cargo test -p smriti -p smriti-tauri

# Just the engine:
cargo test -p smriti

# A single test file:
cargo test -p smriti --test workflow_scan_pipeline

# Just one test by name:
cargo test -p smriti scanner_picks_up_supported_extensions

# Vitest (frontend):
cd src-ui && npm run test            # one-shot
cd src-ui && npm run test:watch      # repl

# When a snapshot intentionally changes:
cargo insta review                   # interactive, per-snapshot
# OR:
INSTA_UPDATE=always cargo test       # accept all

Fixtures

  • Synthetic images are built in-memory by helpers in tests/common/mod.rs. The test runner generates a valid JPEG / PNG / TIFF in a tempdir. No license issues, no large files in git.
  • No real photo fixtures yet. If you need to test a real-RAW edge case, prefer a synthetic NEF (via common::write_nef) over shipping a 30 MB binary in the repo. We may add a small set of CC0-licensed reference photos later if synthetic generators don’t cover a real scenario.

When tests are slow

If your test takes longer than ~1 second, ask:

  • Is it doing actual image decoding? Try a 16×16 image, not 4000×3000.
  • Is it spawning subprocesses? Don’t.
  • Is it sleeping? See “no thread::sleep” above.
  • Is it the only test in its target? Consider grouping related tests into one integration file — each tests/<name>.rs is a separate binary that links the whole engine, and linking is expensive.

The 50k-photo timeline_scale.rs test is marked #[ignore] so it doesn’t run by default.

Snapshot tests in detail

src-tauri/tests/dto_snapshots.rs contains one test per From<EngineType> for SomethingDto impl in src-tauri/src/dto.rs. The first time you run it, insta writes .snap.new files into src-tauri/tests/snapshots/. Run cargo insta review to accept them; the accepted files get committed.

When you change a DTO field (rename, type change, addition, removal), the test for that DTO fails with a unified diff showing old vs new. The contributor reviews their own change, runs cargo insta review if intentional, and commits the updated .snap file alongside the source change. The reviewer reads the .snap diff in the PR to sanity-check the wire-format implications at a glance.

If a DTO change isn’t intentional (a typo, an accidental field-rename during a refactor), the failing test catches it before the frontend breaks at runtime.

Smriti Release Checklist

A tick-off list of everything that needs to happen outside the code before tagging a release. The pipeline is Tauri-bundler based — cargo tauri build produces .deb, .AppImage, .msi, .dmg from the same tauri.conf.json and the GitHub Actions workflow at .github/workflows/release.yml runs that on every v* tag push.

Two ways to cut a release:

  • Automated (recommended for rc + stable): scripts/release.ps1 v0.2.0-rc.3 (Windows) or scripts/release.sh v0.2.0-rc.3 (Linux/macOS). Bumps every manifest, commits, pushes, tags, pushes the tag. See Automated release below.
  • Manual: follow the Per-release checklist. Use this when the automation isn’t appropriate (e.g. you want a bespoke commit message, you’re amending a previous release, or you’re publishing from a non-master branch).

Where the version lives

Smriti’s user-facing version lives in two files. A third file updates itself when cargo runs:

FileFieldPurpose
Cargo.toml[package] version (line ~16)Engine crate version. Reported by cargo --version.
src-tauri/tauri.conf.json"version" (line ~4)The Tauri app version. Drives .msi / .deb / .dmg package metadata, the Windows “About” panel, macOS bundle info. Most user-visible.
Cargo.lock(auto)Rewritten by cargo update -p smriti when the engine bumps. Commit the diff.

Files that look like they have a version but don’t matter for releases:

  • src-tauri/Cargo.toml — version is the placeholder "0.0.0". The Tauri build reads tauri.conf.json for the real version.
  • src-ui/package.json — version is the placeholder "0.0.0". npm doesn’t publish anything from here.

Tag naming

Use strict SemVer 2.0 for tags. The leading v is a tag convention; it does NOT appear in the version field inside files.

Release kindTagManifest versionNotes
Stablev0.2.00.2.0
Release candidatev0.2.0-rc.30.2.0-rc.3The dot before the number is SemVer-correct; cargo, npm, and release.yml all handle it.
Betav0.2.0-beta.10.2.0-beta.1Same shape.

Earlier tags in this repo used v0.2.0rc-2 (no dot, dash on wrong side). That format is not strict SemVer and confuses tooling — prefer -rc.N going forward.


Automated release

The fastest path. One command:

# Windows
scripts\release.ps1 v0.2.0-rc.3
# Linux / macOS
./scripts/release.sh v0.2.0-rc.3

What it does, in order:

  1. Validates the version format.
  2. Validates working tree is clean, on master, in sync with origin.
  3. Rewrites [package] version in Cargo.toml.
  4. Rewrites "version" in src-tauri/tauri.conf.json.
  5. Runs cargo update -p smriti to refresh Cargo.lock.
  6. Shows the diff and pauses for confirmation.
  7. Commits chore(release): vX.Y.Z and pushes to master.
  8. Creates vX.Y.Z annotated tag and pushes it.
  9. Prints the URL of the running release.yml workflow.

Flags:

  • -DryRun (PS) / --dry-run (sh) — show what would change without modifying anything.
  • -NoTag (PS) / --no-tag (sh) — bump + commit + push only, skip the tag (useful when you want to make additional changes before tagging).
  • -AllowDirty — proceed even if the working tree has uncommitted changes. Default is to refuse.

After the script finishes, see Post-tag steps.


Per-release checklist

Use this if you’re doing it by hand.

1. Pre-flight

  • cargo fmt --all --check
  • cargo clippy --all-targets -p smriti -p smriti-tauri -- -D warnings
  • cargo test -p smriti -p smriti-tauri
  • npm run check --prefix src-ui and npm run test --prefix src-ui
  • npm run build --prefix src-ui produces a clean dist/.
  • cargo tauri build produces a working bundle locally.
  • Manual smoke test of the dev build: open a library, scan a folder, verify thumbnails / faces / map / search all render.
  • Local Rust matches CI’s stable — rustup update stable if you’ve fallen behind. Newer clippy versions catch new lints that older local toolchains miss; CI is on whatever stable was published last.

2. Bump the version

Update both files in lock-step:

  • Cargo.toml — [package] version
  • src-tauri/tauri.conf.json — "version"
  • cargo update -p smriti → updates Cargo.lock

Commit with chore(release): vX.Y.Z.

3. Push the bump

  • git push origin master

4. Tag and push the tag

  • git tag -a vX.Y.Z -m "Smriti vX.Y.Z"
  • git push origin vX.Y.Z

The v* tag triggers .github/workflows/release.yml, which:

  • Builds Linux (.deb, .AppImage), Windows (.msi), and macOS (.dmg) via the Tauri bundler.
  • Builds the optional Smriti-Assets.zip (face models + GeoNames + ORT).
  • Renames every installer to a stable download name (Smriti-Windows-Setup.exe, Smriti-macOS-Apple-Silicon.dmg, Smriti-Ubuntu-Debian-x64.deb, plus the MSI, AppImage and RPM) and removes Tauri’s versioned originals, so each installer is attached once. The website and the in-app updater match these names.
  • Drafts a GitHub release with all artifacts attached.

5. Post-tag steps

While the workflow runs (~15–30 minutes):

  • Watch the workflow at Actions → Release → run for vX.Y.Z. Every job must be green.
  • Once drafted, open Releases → vX.Y.Z (Draft) and confirm:
    • All expected artifacts attached (matrix output × 3 OSes + assets pack).
    • SHA256SUMS file is attached and lists every artifact.
    • Release notes state that Windows/macOS builds are currently unsigned and give the exact More info → Run anyway / Open Anyway install path.

For release-candidate (-rc.N) tags

  • Confirm the draft is marked as a pre-release. The workflow detects the SemVer prerelease separator in the tag. For a pre-release, the website’s /releases/latest/download/... links keep pointing at the previous stable (which is what you want — rc users come find rc explicitly).

Smoke test

  • Install at least one artifact on a clean VM. CI smoke tests cover binary launch; eye-on verification catches first-run UX regressions.
  • On supported OSes, exercise open → scan → detail → slideshow → trash → restore → close/reopen, rapid library switching, and Timeline paging/selection/scroll anchors.
  • Use real RAW/HEIC/TIFF/video files and actual ONNX inference. Verify CSP, removable-drive asset access and offline behavior in both Map and photo minimaps; inspect optional network traffic.
  • Verify OS credential set/change/clear, legacy-key migration and locked/unavailable-store errors. Unit tests use a mock store.
  • Exercise disk-full and interrupted import/export/delete on target filesystems, including Windows junctions. SQL failure tests are not power-loss certification.
  • Verify upgrades from retained historical library fixtures and restore a backup. Recent migration tests do not cover every historical schema.
  • Verify installer/update failure paths and trusted signing. Signing keys/certificates require maintainer setup; unsigned checksums alone do not establish authenticity.
  • Confirm hosted dependency-audit jobs pass. The local CI script does not run Rust advisory/license audits.

Decoder timeout checks are cooperative: they cannot interrupt a native decoder inside a call. Include corrupt/oversized media in native testing; do not interpret a timeout setting as process isolation.

6. Publish

  • Edit the draft release. Write release notes summarising what changed (see CHANGELOG.md).
  • Click Publish release.

7. Announce

  • GitHub Discussions post.
  • (Stable only) r/selfhosted, r/privacy, Hacker News if it’s a significant release. Skip for rc.

Release automation

Releases are tag-driven. Commit the version bump directly on master, then push the matching vX.Y.Z tag. The tag triggers .github/workflows/release.yml, which builds and uploads the official artifacts.

Do not use a GitHub Actions job to open a release PR for version bumps. This repository keeps release ownership on master + tags so manual patch releases and rc releases follow the same path.


One-time setup (skip if already done)

Branch protection on master

Settings → Branches → Add branch protection rule for master.

  • Require PR before merging (1 approval is fine for a solo project).
  • Require status checks matching the current CI workflow: Format, Quality ubuntu-latest, Quality windows-latest, Quality macos-latest, MSRV (1.89) and Supply chain (audit + deny).
  • Require branches up-to-date before merging.
  • Include administrators.

Private vulnerability reporting

  • Settings → Code security and analysis → Private vulnerability reporting → Enable. SECURITY.md already points users at /security/advisories/new.

GitHub Discussions

  • Settings → Features → Discussions → tick the checkbox.
  • Create + pin a welcome post linking to CONTRIBUTING.md and PRIVACY.md.

Seed issue labels

  • Actions tab → Sync issue labels → Run workflow. One-shot. Re-run any time .github/labels.yml changes.

GitHub Pages

  • Settings → Pages → Source: GitHub Actions (not “Deploy from a branch”). .github/workflows/docs.yml uses actions/deploy-pages and needs this setting.

Explicitly not doing

  • Microsoft Store / MSIX — significant packaging effort, low reach vs. the MSI path.
  • Bundling InsightFace model weights — they’re downloaded by the user’s own setup script. Each user’s terms come from the upstream project, not Smriti.

  • scripts/release.ps1 / scripts/release.sh — the automation described in Automated release.
  • scripts/release_publish.ps1 — older, more thorough version that also drives gh to watch the workflow and verify artifacts. Does NOT bump versions; assumes you’ve already done that. Useful when you want to monitor the build from the terminal.
  • scripts/release_local.ps1 / scripts/release_local.sh — runs the release build locally for smoke testing before tagging.
  • scripts/ci_local.sh — runs the full CI gate locally (fmt + clippy + test + frontend).

Linux Release Guide (Ubuntu + AppImage)

This is the canonical maintainer flow for Linux releases.

Scope

Supported Linux artifacts:

  • Smriti-ubuntu-amd64.deb
  • Smriti-x86_64.AppImage

Published by tag-driven CI workflow:

  • .github/workflows/release.yml

CI builds each package on its native runner. A clean-machine launch remains the manual smoke test before publishing the draft release.

1) Pre-release checks

Run from repo root:

cargo fmt --all --check
cargo check
cargo test

Optional:

cargo clippy --all-targets

2) Local Linux packaging smoke tests

2.1 Build Ubuntu/Debian package

./scripts/release_local.sh ubuntu

Expected output:

  • target/release/bundle/deb/*.deb

Install test:

sudo dpkg -i target/release/bundle/deb/*.deb
smriti-tauri

2.2 Build AppImage

./scripts/release_local.sh linux-appimage

Expected output:

  • target/release/bundle/appimage/*.AppImage

Run test:

chmod +x target/release/bundle/appimage/*.AppImage
target/release/bundle/appimage/*.AppImage

3) Publish Linux artifacts via CI

Create and push a release tag:

git checkout master
git pull origin master
git tag -a vX.Y.Z -m "Smriti vX.Y.Z"
git push origin vX.Y.Z

CI will create a draft release with assets.

4) Verify release assets

Ensure draft release contains at least:

  • Smriti-ubuntu-amd64.deb
  • Smriti-x86_64.AppImage
  • SHA256SUMS

Note: Draft release creation is blocked unless the native package build jobs pass.

Verify checksums:

sha256sum -c SHA256SUMS

5) Publish release

Open draft release, review notes, publish.

6) Post-release checks

Validate website links:

  • Ubuntu .deb: /releases/latest/download/Smriti-ubuntu-amd64.deb
  • AppImage: /releases/latest/download/Smriti-x86_64.AppImage

7) Troubleshooting

If app starts but models/GeoNames are not found:

  • verify assets are inside package/AppImage
  • verify SMRITI_ASSET_DIR is set in AppImage AppRun
  • verify runtime path resolution handles /usr/lib/smriti (and the legacy /usr/lib/photovault fallback for upgrading users)

Architecture Overview

Smriti is a desktop app split across three crates / workspaces:

  • src/ — pure Rust engine, published as the smriti library.
    • src/services/ — scanner, thumbnailer, face pipeline, duplicates, bursts, geocoding, update checker.
    • src/db/ — SQLite repositories, schema, migrations. The on-drive database lives at <drive>/.photovault/photovault.db (kept under that name for backwards compatibility with libraries indexed before the rename).
    • src/ml/ — ONNX Runtime wrapper, face detector, embedder.
    • src/config/, src/models/, src/search/ — config, domain types and query parsing.
    • src/bootstrap.rs — runtime asset checks (ONNX runtime, models, GeoNames DB).
  • src-tauri/ — Tauri 2 shell. One bin crate that mounts every #[tauri::command] from src-tauri/src/commands/. The contract is in docs/COMMAND_SURFACE.md. DTOs live in src-tauri/src/dto.rs and translate one-way from engine types.
  • src-ui/ — Vite + Svelte 5 frontend. Routes call into the typed Tauri client at src-ui/src/lib/api/; state lives in runes-based stores under src-ui/src/lib/stores/.

The engine has no UI dependencies and is independently testable. The Tauri shell is a thin adapter; anything more than ~15 lines of logic in a handler is a service-layer change, not a handler change.

Database

Smriti uses a single SQLite database per library, stored at <library>/.photovault/photovault.db. Access goes through rusqlite with a small Database wrapper and per-table repository modules in src/db/.

Where it lives

The DB sits on the same drive as the photos. This is deliberate: the library is portable — unplug the drive, plug it elsewhere, open Smriti, point it at the new mount path, and everything resumes. Faces, albums, tags, search history all travel with the photos.

(The folder is named .photovault/ for backwards compatibility with libraries indexed under the project’s earlier name.)

Migrations

Schema migrations live in src/db/migrations/. Each migration is an SQL file; Database::open applies any unapplied migrations in order. There’s no “rollback” — migrations are forward-only and must remain idempotent across versions.

Core tables

TableWhat it stores
photosThe canonical photo record: path, hash, EXIF, GPS, dates, dimensions.
albumsManual + accepted-suggestion albums.
album_photosJoin table; ordered for manual album reordering.
album_suggestionsDetected-but-not-accepted trip / event suggestions.
google_takeout_items / google_takeout_albumsContent-hash ledger, Google-only sidecar metadata, and imported album membership used for safe resume/refresh.
facesPer-photo detected faces: bbox, embedding, quality score.
clusters (a.k.a. persons)Named identity groups; one row per person.
face_assignmentsWhich face belongs to which cluster, with confidence.
duplicatesExact and perceptual duplicate groups.
burstsDetected burst groups with timestamps.
photo_stacks / photo_stack_membersTimeline stack suggestions derived from duplicate and burst groups, with cover photo and per-member quality scores.
memory_blocksUser dismissals for surfaced memories.
trash (via photos.is_trashed)Soft-deleted photos.
search_historyRecent search queries, capped.

Conventions

  • All tables use INTEGER PRIMARY KEY row IDs (SQLite’s implicit rowid aliases).
  • Timestamps are stored as RFC-3339 strings in UTC.
  • File paths are stored as relative_path from the library root, so moving the library to a new mount point doesn’t break references.
  • Soft-delete is the default — is_trashed = TRUE on photos rather than DELETE FROM photos. Permanent deletion is a separate explicit action.

Repositories

src/db/<entity>_repo/ modules provide typed access to each table. Repos are split into read.rs (queries) and write.rs (mutations) so the read side can be borrowed independently from the write side when needed.

Engine code uses repos directly; the Tauri shell never touches the DB directly — it goes through the engine services.

Concurrency

SQLite is opened with WAL mode for concurrent read-while-write performance. Smriti spawns one writer task and many reader tasks. The async scanner and frontend reads coexist through the WAL.

Network shares

WAL keeps its index in shared memory (-shm), which does not work over SMB or NFS. A library on a network filesystem therefore opens with the rollback journal (journal_mode=DELETE), synchronous=FULL, no memory mapping and a longer busy timeout (src/db/network_drive.rs). Detection is automatic (Windows: UNC paths and mapped drives; Linux: the mount’s filesystem type, including named FUSE mounts; macOS: smbfs, nfs, afpfs and similar). For shares the detector misses, Settings → Library → “Library is on a network drive” writes a .photovault/network-drive marker that travels with the library. The journal mode is stored in the database file and set by the connection that opens the library; the background connections follow the file. A library moved between a NAS and a local disk switches modes on its next open. One computer at a time should have a network library open.

Backup

The library folder including .photovault/ is the entire database. Standard file-level backup works. SQLite is robust to crash — the WAL (or, on network shares, the rollback journal) keeps the DB consistent across power loss.

See also

  • Indexing — what populates these tables.
  • Services — the layer that reads / writes them.

Services Layer

Services live in src/services/ and encapsulate domain workflows. Each service is a pure Rust module — no UI dependencies, no Tauri dependencies, no async runtime baked in unless the workflow demands it. Services are the unit of integration testing in tests/.

Service responsibilities

ServiceRole
takeout_importSafely streams Google Photos Takeout ZIPs, deduplicates originals, and restores sidecar metadata/albums.
scannerWalks the library, dispatches per-photo work. Async, cancellable.
metadata_processorEXIF + GPS + file-hash extraction per photo.
exif_extractorPulls and normalises EXIF tags.
thumbnailThree preview sizes plus decoded-resolution display renditions, lazy + cached.
image_ioDecodes JPEG/PNG/WebP/HEIC + RAW preview extraction.
raw_previewExtracts embedded JPEG previews from TIFF-based RAWs.
geocodingResolves GPS → city/country via local GeoNames DB.
face_processorDetection + embedding + clustering orchestration.
searchTranslates SearchQuery → SQL → result rows.
insightsAggregates per-day / per-month / per-person counts.
memories“On this day” / fallback / seasonal generators + ranker.
album_suggestionsTrip and event detection from geographic + temporal clusters.
burst_detectorTime-window-based grouping with similarity gate.
duplicate_detectorSHA-256 exact + DCT-pHash perceptual dedup.
photo_stacksConservative timeline stack generation from duplicate/burst results, including best-photo scoring.
trashSoft-delete, restore and staged permanent deletion with recovery.
update_checkerOpt-in version check against the GitHub releases API.
self_replaceVerified-download staging, native installer launch and AppImage replacement; unsupported portable archives use the release page.
library_healthAsset-pack presence, DB integrity, model availability.
path_utilCross-platform path normalisation.
reindexerDetects moves, deletions, and changed files.
camera_namesNormalises EXIF make/model into human-readable names.
image_utilsMisc image-processing helpers (rotation, resize).
drive_detectorIdentifies the indexed drive’s filesystem ID.
install_methodDetects how Smriti was installed (apt, brew, msi, …).

Boundary discipline

  • Services accept primitive types or &rusqlite::Connection, not Tauri AppState. This keeps them testable without launching a runtime.
  • Tauri command handlers in src-tauri/src/commands/ are thin wrappers: deserialize args, call the service, serialize the result. Anything over ~15 lines in a handler is a sign the logic should move down to a service.
  • Engine services never call back into Tauri. The frontend invokes commands; commands invoke services.

Testing

Each service has a #[cfg(test)] mod tests block alongside it for unit tests, plus integration tests in tests/workflow_*.rs that exercise multi-service workflows (scan → metadata → thumbnail → faces, trash lifecycle, etc.). See Testing.

ML Pipeline

Smriti’s face-recognition pipeline runs entirely on-device by default, with an opt-in remote-GPU bridge for the embedding step. All models ship as ONNX and are loaded via the ONNX Runtime crate.

Pipeline stages

photo  ──►  detection  ──►  alignment  ──►  embedding  ──►  clustering  ──►  identity
           (SCRFD)          (112×112)        (AdaFace /         (gallery +     (per-person
                                              GLinTR-100)        agglom.)       clusters)

1. Detection

SCRFD locates faces in each photo and produces:

  • Bounding box,
  • 5-point landmark set (eyes, nose tip, mouth corners),
  • Detection score.

Only faces above the face-confidence threshold (configurable in Settings) are retained.

2. Alignment

Each detected face is rotated and scaled to a canonical 112×112 crop using the landmarks. The crop is what the embedder sees — the embedder doesn’t see the original photo.

3. Embedding

A face-recognition model produces a 512-dimensional unit vector that captures identity:

  • Default: AdaFace IR-101 trained on WebFace12M.
  • Alternative: GLinTR-100 — selectable in Settings.

Embeddings from different models are not interchangeable. Smriti refuses to mix them in the same library.

Embedding is the compute-heavy step. The optional GPU bridge offloads this to a free Kaggle/Colab notebook for a 10–70× speedup on the one-time pass.

4. Clustering

A two-stage process:

  1. Gallery retrieval: each new face is compared against the gallery of existing per-person clusters via k-nearest-neighbor match with confidence bands. High-confidence matches auto-assign; ambiguous matches are queued for review; low-confidence faces drop to stage 2.
  2. Agglomerative complete-link clusters the remaining unresolved faces pairwise. Bounded at 2,000 faces per pass for performance; beyond that, faces route to the ambiguous queue or wait for the next rescue pass. The cap will lift when HNSW-based approximate clustering replaces the current complete-link implementation.

After clustering:

  • A unify pass merges clusters that look like the same person split by lighting variance.
  • A rescue pass matches orphan clusters against the existing gallery with looser thresholds.

5. Identity

Each cluster becomes a “person” record with:

  • A hero face (highest-scoring detection),
  • An aggregated embedding centroid,
  • A confidence score per assigned face.

The user names the cluster from the People view. Naming is purely a display label — the embedding is what identifies the cluster.

Tuning

  • Face confidence (Settings) — minimum detection score to retain a face. Lower catches more faces, including more false positives.
  • Clustering threshold (Settings) — controls how aggressively faces are grouped. Lower → tighter clusters (more, smaller groups); higher → looser (fewer, larger).

Defaults work for most libraries. Adjust only if you see consistent over- or under-clustering after running a full pass.

Privacy

  • Models run locally by default. Nothing leaves your machine unless you explicitly enable the GPU bridge.
  • When the bridge is enabled, only the 112×112 aligned face crop is sent — never the original photo, EXIF, or filename.
  • Embeddings and detection metadata are stored only in your library’s local SQLite database.

Code map

  • src/ml/ — ONNX runtime wrapper, model loaders, inference glue.
  • src/services/face_processor.rs — orchestration (detection → embedding → clustering).
  • src/services/face_processor/ — submodules per stage.
  • src/db/face_repo/ — persistence of faces and clusters.

See also

Cloud GPU face acceleration (opt-in)

Smriti can offload face embedding to a free GPU notebook you own. Default behaviour is unchanged — local ONNX Runtime stays primary. The bridge is strictly additive and never required.

What it sends

Only 112×112 aligned face JPEG crops (~5 KB each, quality 85). No photos, no metadata, no telemetry. You control the endpoint URL.

Model must match

The notebook’s /health advertises which face-embedding model it has loaded. Smriti refuses to send work when the bridge’s model differs from the one configured in Settings — embeddings from different models live in incompatible metric spaces, and mixing them would corrupt clustering.

Smriti uses AdaFace (adaface_ir101_webface12m) as its face recognizer. The notebook downloads the same ONNX model as scripts/setup_assets.*; nothing to change.

Setup paths

Kaggle (free, 30 hrs GPU/week, T4×2)

  1. Open kaggle.com, create an account (free).
  2. Create a new Notebook. Choose GPU T4×2 as the accelerator.
  3. Upload notebooks/face_bridge.ipynb from the Smriti repo.
  4. Sign up for ngrok (free). Copy your auth token from the dashboard.
  5. Paste your ngrok token in the notebook’s cell 5.
  6. Run all cells. The last cell prints a public URL — copy it.

Colab (free with limits / Pro $10/mo for A100)

  1. Open colab.research.google.com.
  2. File → Upload notebook → notebooks/face_bridge.ipynb.
  3. Runtime → Change runtime type → T4 GPU (or A100 on Pro).
  4. Set up ngrok as above (or use the cloudflared alternative commented out).
  5. Run all cells. Copy the printed URL.

Local LAN GPU server (no internet)

  1. Run notebooks/face_bridge.ipynb on a local machine with a GPU.
  2. Skip the tunnel cells. The server binds to 0.0.0.0:8000.
  3. In Smriti Settings, enter http://<lan-ip>:8000 as the bridge URL.

How to connect Smriti

  1. Open Smriti → Settings → Cloud face acceleration (advanced).
  2. Toggle “Use a remote GPU for face embedding” on.
  3. Paste the bridge URL (e.g. https://abc.ngrok.io).
  4. Click Test connection → should show “✓ CUDAExecutionProvider @ XXms”.
  5. Run face detection. Embedding goes remote; detection stays local.

ngrok auth token (60-second setup)

  1. Sign up at ngrok.com (free, no credit card).
  2. Copy your authtoken from dashboard.ngrok.com/get-started/your-authtoken.
  3. Paste it in the notebook’s ngrok.set_auth_token("YOUR_TOKEN_HERE") cell.

cloudflared alternative (no account needed)

The notebook includes a commented-out cloudflared section. It doesn’t need an account but requires fetching the binary and parsing the tunnel URL from its stdout.

Automatic fallback

If the bridge is unreachable or returns errors on 3 consecutive batches, Smriti falls back to local CPU embedding for the remainder of the job. The job completes normally — just slower.

Expected speed

Library sizeLocal (i7-7567U)T4 GPUSpeed-up
10k photos (~30k faces)~5 min~30 s10×
90k photos (~200k faces)~3 hrs~2.5 min70×

Troubleshooting

Test connection says “Unreachable”

  • Check that the notebook is still running. Colab/Kaggle sessions time out after 30–90 min of inactivity.
  • Verify the ngrok URL hasn’t changed (free ngrok URLs rotate on restart).

Embedding is slow — still on CPU

  • Check the Smriti logs (Help → Open logs folder). You should see either “Remote GPU bridge at unhealthy or wrong model” or “Remote bridge model mismatch” if the bridge failed.
  • The most common cause is a model mismatch — see the Model must match section above.
  • Restart the notebook. Get a fresh ngrok URL. Update in Settings.

ngrok free plan limits

  • 1 online tunnel at a time, 40 connections/min, 1 GB/month bandwidth. Face crops at 5 KB each × 200k faces = ~1 GB. For a 90k-photo library, this fits within the free plan but is near the limit.
  • If you hit the limit, use cloudflared (no limits) or Colab Pro ($10/mo).

Privacy notes

  • Smriti sends only 112×112 face crops, not the original photos.
  • No metadata (location, filenames, EXIF) is sent.
  • No telemetry or analytics from Smriti itself.
  • The bridge URL is set by you; Smriti never phones home.
  • The notebook runs on your Kaggle/Colab account, not a shared service.

Cost

All paths are free or nominal:

  • Kaggle: Free (30 hrs/week GPU quota, resets weekly)
  • Colab free: Free (limits apply; sessions may throttle)
  • Colab Pro: $10/mo (A100 GPU, unmetered)
  • ngrok: Free (1 online tunnel, 1 GB/month)
  • cloudflared: Free (no account needed)