This page covers the ports a Groundwork pipeline is made of, the adapters available for each, how adapters are named and versioned, and the benchmark each port runs.
Ports
Every step in the pipeline is a port: a small interface in src/core/ports.ts that any number of adapters implement. Every model and every store is an adapter, so every model and store can be swapped by changing an id in the config.
| Port | Interface | What it does |
|---|---|---|
| parse | Parser |
Turns a file into text, page by page, with an optional per-page confidence |
| transcribe | Transcriber |
Turns audio into timed segments, optionally with speakers |
| chunk | Chunker |
Cuts text into overlapping pieces with character offsets |
| embed | Embedder |
Turns texts into vectors, as queries or as documents |
| store | StoreOpener |
Opens an IndexStore for keyword search, vector search and read-only SQL |
| route | Router |
Picks an answer path for a question, with a confidence and a reason |
| rerank | Reranker |
Reorders and trims search hits |
| generate | Generator |
Writes text from a prompt |
extract is also a port name in src/core/adapter.ts, but the demo's extractor is a rule-based stage with no adapter registry yet.
The adapter registry
An adapter is one file under src/adapters/<port>/, exporting one Adapter (src/core/adapter.ts):
type Adapter<P> = {
id: string; // stable id used in configs, such as "local/bge-small"
port: PortName;
version: string; // bump when output changes for the same input
local: boolean; // true when it runs on this machine and sends nothing out
describe: string; // one line for listings and audit pages
cost?: { usd: number; per: string };
impl: P;
};Each port has a registry.ts that registers its adapters. pick(registry, id) returns the adapter, or an error that lists every known id.
import { pick } from "./src/core/adapter.ts";
import { embedders } from "./src/adapters/embed/registry.ts";
const embedder = pick(embedders, "local/bge-small");
if (embedder.status === "ok") await embedder.data.impl.embed(["150 Hayes St"], "query");Python-backed adapters call a worker script in scripts/ with uv run --script. Models used at question time (query embeddings, the reranker, the embedding router and the MLX models) stay loaded behind a localhost port through scripts/resident.py, shared by every process, and stop after 15 idle minutes.
Adapter ids
Ids name the provider and the model. These are registered today:
| Port | Adapter ids |
|---|---|
| parse | pymupdf, docling, docling/ocr, docling/ocrmac, docling/granite, tesseract, mlx/qwen2.5-vl-3b, ocr/routed, mistral/ocr |
| transcribe | faster-whisper/tiny.en, faster-whisper/small.en, whisper/base.en |
| chunk | builtin/words, chonkie/token, chonkie/sentence, chonkie/recursive, chonkie/semantic |
| embed | local/bge-small, local/potion, ollama/nomic-embed-text |
| store | store/sqlite-vec, store/sqlite-brute, store/pgvector |
| route | rules/keywords, embed/centroid, mlx/qwen3-4b, claude/inline, cascade/centroid-mlx@0.3, cascade/centroid-claude@0.3 |
| rerank | none, cross-encoder/ms-marco-minilm-l6 |
| generate | mlx/qwen3-4b, mlx/qwen3-8b, ollama/qwen3-1.7b, claude/inline, anthropic/claude-haiku |
A cascade router runs a fast router first and hands the question to a slower one when the fast router's confidence is under the threshold in its id. cascade/centroid-mlx@0.3 uses the embedding centroid, then Qwen3 4B.
Adapters for paid services (mistral/ocr, anthropic/claude-haiku) exist but are off unless explicitly enabled. claude/inline runs through a local Claude subscription.
Choosing adapters
On the San Francisco demo, adapters are picked with command line options (see Ask and search):
deno task sf ingest --embed local/potion --store store/sqlite-vec
deno task sf ask "Who raised the Hayes Street closure?" --embed local/potion --store store/sqlite-vec \
--path auto --router cascade/centroid-mlx@0.3 --rerank cross-encoder/ms-marco-minilm-l6 --model mlx/qwen3-8bIngest and ask with the same --embed and --store values. --store builtin (the default) keeps chunk search in the demo's own SQLite file. store/pgvector needs scripts/pgvector.sh start first. Videos take --transcriber <id> at ingest.
The ingest chunk stage uses its own word-window chunker, read from index.chunkSize and index.overlap. The chunk adapters are benchmarked but not yet selectable at ingest.
Versioning rules
- Bump an adapter's
versionwhen its output changes for the same input, so audits can tell the runs apart. - Bump a stage's
versionwhen the stage's own logic changes. The stage name and version are the first part of its cache key. - The adapter id is part of the config the stage reads, so changing the id reruns that stage and the ones after it, and nothing before it.
- Model ids belong in the config, including the provider's model version where there is one, so a silent model update counts as a change.
Audit rows
Adapter calls made while answering a question go through audited (src/core/audit.ts), which writes one ledger row per call: run id, port, adapter id and version, input and output hashes, time, cost and cache hit. Today the demo audits routing, reranking and generation. See the audit command in the Quickstart and the planned Audit resource.
Benchmarks per port
Each port has a general benchmark that runs before any customer data, on generated questions from a corpus or on small public sets. Every run writes BenchResult rows (src/core/bench.ts) to tmp/bench/<port>.json, so all ports report into one table.
| Task | Measures |
|---|---|
deno task bench:store |
Recall at 10 against exact search, query latency p50 and p95, ingest rate, size on disk |
deno task bench:chunk |
Retrieval recall at 10 on synthetic questions per chunk set |
deno task bench:embed |
Recall at 10 and MRR on synthetic question and passage pairs, texts per second |
deno task bench:parse |
Character accuracy against born-digital text layers |
deno task bench:ocr, bench:ocr-routing |
Character error rate on damaged and real scans |
deno task bench:transcribe |
Word error rate on LibriVox clips against the book text |
deno task bench:route, bench:cascade |
Accuracy against labeled best paths, and latency |
deno task bench:rerank |
nDCG at 10 on the retrieval set |
deno task bench:generate |
Citation validity and fact recall on the golden set |
Current defaults
Defaults hold until a customer's own evals say otherwise. From the first benchmark round:
| Port | Default |
|---|---|
| store | store/sqlite-vec for one machine; store/pgvector past about 100,000 vectors |
| chunk | builtin/words |
| embed | local/bge-small; local/potion when speed matters |
| parse | pymupdf for born-digital files |
| transcribe | faster-whisper/small.en |
| route | cascade/centroid-mlx@0.3 |
| rerank | none |
| generate | claude/inline; mlx/qwen3-8b when nothing may leave the machine |
The demo's store default is still builtin, its own SQLite file, rather than store/sqlite-vec.
Groundwork