Index

Freshness

This page covers how soon new or changed data becomes searchable: the two indexing lanes, the proposed guarantee, and what is measured today.

Two lanes

The planned pipeline has two lanes with separate queues and workers.

  • Incremental lane. Small, warm and always served first. New files, changed rows, pushed text and realtime streams go here.
  • Backfill lane. Initial imports and large re-indexing jobs. It runs on spot capacity and batch APIs, and never delays the incremental lane.

Fairness is per customer, so one customer's backfill does not slow another's updates.

Both lanes run the same cached stages. Because a stage's output is keyed on its input and the config it reads, a record that has not changed is a cache hit in either lane, and a retry or duplicate event does no extra work. See Concepts.

The proposed guarantee

These are targets at the 95th percentile, from the spec. They are not yet promised to anyone and not yet met by running code.

Content Searchable within
Text pushed through the API or a realtime stream 60 seconds
A new document found through S3 or Drive events 2 minutes, or 5 with OCR
A folder of up to 10,000 pages 15 minutes
Up to 50 hours of audio or video 30 minutes, speaker labels within 1 hour
Facts in the knowledge graph 1 hour
Initial import of up to 1 TB 72 hours

Above 10,000 pages in one burst, the promise becomes throughput (100,000 pages an hour per customer) instead of a deadline. The setup flow is planned to show live progress against these numbers.

What is measured today

The prototype has no incremental lane on the main branch. A change to the San Francisco data is picked up by running ingest again:

sh
deno task sf ingest

Unchanged records are cache hits at every stage, so only new or changed records do real work. The scorecard's freshness row records a full cached rebuild of the demo at 37 seconds, from tmp/review/ingest-warm.txt. The scorecard uses it as the time for a new file to become searchable when nothing else has changed. A new video adds about 8 seconds per minute of audio for transcription.

Use case Value Source
San Francisco 37 s tmp/review/ingest-warm.txt, full cached rebuild
Video and PDF 37 s, plus transcription Same rebuild

The scorecard threshold is green at or under 120 seconds and amber at or under 600 seconds, measured from a new file to searchable. See Scorecard.

In progress

A watch loop and a freshness benchmark are being built and are not on the main branch yet. The watch loop re-checks web pages, web searches and YouTube channels on an interval, ingests only what changed by content hash, and adds an incremental path to ingest so one new record does not rebuild the whole index. For each new item it records three times:

  • when the item appeared at the source,
  • when Groundwork fetched it,
  • when it became searchable.

The benchmark measures fetch to searchable for a new web page, a new PDF and a short video, and writes BenchResult rows to tmp/bench/freshness.json for the scorecard to read.

What adds time

Step Effect on freshness
Parse Small for born-digital files with pymupdf
OCR Large: a vision model reads a scanned page in about 15 seconds locally
Transcribe Proportional to audio length
Embed Small per record; only new texts reach the model
Extract and resolve Resolution reads the whole corpus, so graph facts lag text search

The last row is why the proposed guarantee gives knowledge graph facts an hour, against minutes for search.

Planned API

Text pushed through the planned Records endpoint goes to the incremental lane with the 60 second target. This endpoint is in design.

sh
curl https://api.groundwork.dev/v1/projects/acme/records \
  -H "Authorization: Bearer $GW_KEY" \
  -d '{ "id": "ticket-4411", "text": "Customer asks about coverage...", "tags": ["support"] }'