Couchbase Lite · Vector Search · App Services · Capella

FIELDPROOF

Works where the signal doesn’t.

A database, a vector index and five AI models, on the phone. The report is captured, checked for duplicates, and hashed with the radio off, then synced to Capella when the signal comes back.

FieldProof's duplicate check: two open reports within 200 metres look like this one, 98% alike.

The phone is not a thin client.

It holds a database, an index and the models. It answers a similarity question in a canyon.

Offline first

The database is on the phone.

Airplane mode, and the app is not degraded. It is home. The list, the photographs, the filters and the search all come out of Couchbase Lite: collections, indexes, SQL++ and transactions, on the device.

Every capture is one batch. The report, the photo and the parent update land together or not at all, even on a dying battery.

  • Same names both sides. evidence.reports on the phone is evidence.reports in Capella. Nothing is translated.
  • No outbox code. The pending count comes from the database itself.
How Couchbase Lite is used →
The report list with an amber banner: offline, reports safe on device.

On-device AI

Three models. A third of a second. No network.

The moment a photograph is taken, Apple’s Vision framework classifies it, reads any text in it, and writes a 768-number fingerprint of what it shows. No API key, no invoice, no upload.

257–323 ms for all three, on the phone.1

Two more run when the crew asks. Dictate the note with gloves on: speech recognition stays on the device. And the report writes its own one-line summary with Apple’s on-device language model.2

AI is supporting evidence, never a gate. If a model is missing or refuses, the report is still filed, hashed and synced.

How the on-device AI works →
The review screen: labels, recognised text, GPS, heading, time and the SHA-256 of the photo.

Vector search, on the device

Looks familiar.

Before the report is filed, the app has already searched every report on the phone for a photograph like this one, within 200 metres, still open. Four crews, one pothole, one work order.

98% alike, 29 m away, found with no signal.3

The duplicate check is a query, not a service. One statement mixes a vector distance with a status filter and a map box. There is no second system to run, and nothing to pay per query.

How vector search runs on the phone →
SELECT META().id, category, status,
       APPROX_VECTOR_DISTANCE(embedding,
         $queryVector, 'COSINE') AS distance
FROM evidence.reports
WHERE status != 'resolved'
  AND location.lat BETWEEN $minLat AND $maxLat
  AND location.lon BETWEEN $minLon AND $maxLon
  AND APPROX_VECTOR_DISTANCE(embedding,
        $queryVector, 'COSINE') < $maxDistance
ORDER BY APPROX_VECTOR_DISTANCE(embedding,
         $queryVector, 'COSINE')
LIMIT $maxResults

Evidence integrity

Hashed at capture. Checked on demand.

SHA-256 runs on the phone over exactly the bytes that will be stored, before anything syncs. Verify does not look up a stored answer. It re-hashes what the server holds right now.

Swap the photo with valid credentials, and Verify catches it in one click. The tampered photo even reaches the crew’s phone, and it fails there too.

What it does not prove: that the camera saw what the metadata claims. That takes a Secure Enclave signature, a small addition.

How evidence integrity works →
Evidence card stamped VERIFIED: the server's bytes hash to the value recorded at capture. Evidence card stamped MISMATCH after the photo was swapped on the server.

Sync with Capella App Services

Eleven lines decide who sees what.

A sync function validates each document, checks the writer’s access, and routes it to a district channel. The access model lives with the data, not in the app.

25 reports on this phone. 30 in the cluster.

The other district is not filtered in the UI. It never arrives. Lose access to a channel and those documents leave the device on their own. No admin credential anywhere.

How sync and channels work →
Settings: the signed-in crew member, their district, and sync status.

Capella and the supervisor dashboard

Once it syncs, it is just data.

Data a phone wrote in a canyon is ordinary Capella data the moment it lands: SQL++, indexes and joins. One query draws the map. A change feed puts a new report on the supervisor’s screen with no polling.

~3 s from filing on the phone to a new pin on the map.4
How the dashboard reads Capella →
The supervisor dashboard: a map of reports with status pins and a list beside it.

Thirty seconds, start to finish

Watch it happen.

Offline. Pick the photograph. Three models read the scene. The review shows GPS, heading, time and the SHA-256. The duplicate check finds two open reports nearby. Attach, and the pending count goes to two.5

Why this approach, and why now

The compute moved into the pocket. The database followed.

The models ship with the phone

Vision, on-device speech and an on-device language model are part of the operating system now. The crew already carries the hardware that runs them, and replaces it on a cycle.

Vector search moved to the edge

Couchbase Lite puts a vector index beside the documents, in the same embedded database. The second AI workload, “have we seen this before,” is a local index lookup, not a call to a vector service.

The bill inverts at the edge

Every phone you add brings its own inference capacity. Two hundred crew, forty photographs a day: 8,000 inferences a day that never reach an invoice.6

The field never got better signal

Canyons, basements, tunnels and rural spans are still dark. Even with full bars, networks drop: the Wi-Fi in your own living room still does. The moment capture depends on a round trip, the app stops working where the work is.

Where the AI runs changes everything else
On the deviceIn the cloud
Marginal cost per photoZeroPer-call inference, plus egress
Latency257–323 ms, predictableRound trip, queueing, rate limits
Works with no signalYesNo. Capture cannot complete
Data leaving the deviceThe photo, later, over syncEvery photo, immediately, to a third party
Cost as the fleet growsFlatLinear in photographs
When a model failsWeaker metadata. Evidence still capturedCapture blocked or queued

On the phone

Classification, text, embeddings, dictation, summaries. The duplicate search. Evidence hashing. Every read and write the app makes.

In Capella

The system of record. Access control, in the sync function. The questions that span every district at once.

Inference at the edge, aggregation in the cloud. That split is the architecture, not an optimisation.

Tech specs

What’s inside.

Embedded database
Couchbase Lite Swift Enterprise 4.1.2, with the Vector Search extension. Scope evidence, collections reports and photos.
Vector index
768 dimensions, 8 centroids, cosine. Duplicate threshold 0.15, measured on real photographs.7
Duplicate radius
200 m bounding box, open reports only, served by an ordinary value index before the vector ranks.
Image models
Vision: classification, text recognition, feature print revision 2 (pinned so vectors stay comparable).
Language and speech
On-device speech recognition for notes. Apple Foundation Models for the summary: 4.455 s on iPhone 15 Pro Max.2
Integrity
SHA-256 over the stored bytes, at capture. Re-verified on the phone and on the dashboard.
Sync
Capella App Services 4.1.2 over a WebSocket. One replicator, both collections, channels per district.
Cloud
Capella cluster, SQL++ via the Node SDK. Live updates from the App Services changes feed.
Requirements
iOS 17 or later. The summary needs iOS 26 on a device with Apple Intelligence (iPhone 15 Pro or newer).
Room to grow
On a paid Capella cluster, the AI Data Plane adds AI Functions in SQL++, hosted models, vectorization workflows and an MCP server. Not used by this demo.8
Size
About 3,000 lines of Swift and 530 of JavaScript. Two Swift packages, no JavaScript build step.

Get FieldProof.

Free. Open source. MIT licensed.

The app, the dashboard, the sync functions, the setup and reset scripts, and an architecture note for every component. Fork it, point it at your own Capella, and run the five minutes on your own photographs.

Get the code Watch the deck Run the demo