Connect

Sources

This page lists the source kinds Groundwork can read today, those that are planned, and how ingest and in-place sources differ.

How sources work

A source reader takes something outside Groundwork and emits IngestRecords, one shape for every kind (see Concepts). Readers live in src/sources/. Each record has a stable id built from the connection and the item's own id, and a version hash of its content, so a second sync of unchanged data produces the same hashes and every pipeline stage is a cache hit.

A mix of sources describing the same things is the normal case. Canonical entities are what join them: in the San Francisco demo, a business row, a building permit, a 311 case and a meeting where the address came up all link to the same address entity.

Source kinds that exist

Reader File What it emits
Table src/sources/table.ts One record per row of a CSV or JSON file. The row stays whole in metadata.row, so the agent path can also query it with SQL
Places src/sources/places.ts One record per Overture GeoJSON feature, with name, address, category and source licence
Transcript src/sources/transcript.ts One record per meeting from SRT, WebVTT or JSON, with timed segments kept so chunks can cite a moment
YouTube src/sources/youtube.ts One transcript record per video. yt-dlp fetches the audio and any captions, and a transcribe adapter writes the transcript, cached on the audio hash and adapter id
PDF src/sources/pdf.ts One record per file, pages kept so chunks can cite a page. Pages with no text layer go to an OCR adapter (default ocr/routed)
Folder src/sources/folder.ts One record per text file under a directory. Stands in for S3 and Drive in the prototype

The San Francisco demo (src/sf/) wires these together: DataSF tables for businesses, permits and 311 cases, Overture places, Board of Supervisors caption text, and optional YouTube videos and Board PDFs. deno task sf fetch pulls them, with --pdfs and --youtube for the optional sets. The video set needs yt-dlp and ffmpeg. Places are sliced from an Overture extract at ~/.om/geo/overture/san-francisco.geojsonseq; without it the places step reports an error and the other sources still fetch. deno task sf ingest indexes everything, and --skip youtube,pdfs leaves folders out.

The public domain art demo (src/art/demo.ts) runs museum records from the Art Institute of Chicago and the Met through the same ingest as one artworks table, keeping each artwork's image beside the index. The images are fetched once and served by Groundwork, since the Art Institute's image server turns away requests from other sites.

sh
deno task art images
deno task art ingest

In progress: web sources

Readers for web pages, web search results and YouTube channels are being built, with a watch loop that re-checks them on an interval and indexes only what changed. They are not on the main branch yet. When they land:

  • A web page record keeps its readable text, title, the time it was fetched and the page's own modified date when it states one.
  • A web search runs a query and ingests the top results as web pages. It needs a search API key.
  • A YouTube channel lists its newest videos and hands new ones to the YouTube reader.
  • Answers that cite a web page will carry kind="web" and the fetched time.

Planned sources

These are in the spec and not in code. The record shape already has kind values reserved for several of them.

Source Notes
S3 Read-only access from a template the customer applies. The folder reader stands in for now
Google Drive and other drives Event-driven updates where the drive supports them
Postgres, Aurora, Parquet Long-text columns ingested; the rest queried in place with text-to-SQL
Neo4j, Weaviate, pgvector, OpenSearch Queried in place: Cypher, or a federated vector search over the existing index
Change data capture Postgres and Aurora change streams, through Debezium for heavy loads
Webhooks, Kinesis, Kafka Realtime streams, sent to the incremental lane
Uploads Drag and drop in the setup flow
Slack, Notion Ingested like documents

Connectors are planned on dlt for databases and files, with thin adapters of our own for S3, Drive and vector stores.

Ingest and in place

Every source is one of two classes, set per source.

  • Ingest sources go through the whole pipeline: transform, chunk, embed, extract, resolve and index.
  • In place sources are queried live at answer time and never re-embedded. They still emit catalog records (tables, columns, sample values, entity names), so the agent knows what exists and the graph can link to it.

Promotion moves a source from in place to ingest when evals show it improves answers. It is a setting on the source, not a rebuild.

Only ingest exists today. The demo's tables are ingested, and because each row also lands in a SQL table, the agent path can query them with SQL. That is the closest thing to an in-place source in the prototype.

Freshness

How soon a change at the source becomes searchable depends on the lane it goes through and the work it needs (parsing, OCR, transcription). The targets and what is measured today are on the Freshness page.

In the planned hosted API, text can be pushed straight in as a record:

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"] }'

See Records in the API reference. This endpoint is in design.