Skip to main content
Match new records against existing data in real time. GoldenMatch supports single-record matching, micro-batch streaming, and CLI-based incremental matching.

match_one

The core primitive for streaming. Matches a single record against an existing DataFrame.
match_one works with fuzzy (weighted) matchkeys. For exact matchkeys (threshold=None), use find_exact_matches with a Polars join instead.

StreamProcessor

Incremental record matching with immediate or micro-batch processing. Wraps match_one and add_to_cluster for continuous operation.

Immediate mode

Each record is matched and clustered as it arrives:

Micro-batch mode

Buffer records and process them together for better throughput:

Incremental cluster updates

When a new record matches existing records, update the cluster structure:
add_to_cluster handles three cases:
  1. New record matches records in one cluster — joins that cluster
  2. New record matches records in multiple clusters — merges those clusters
  3. New record has no matches — creates a singleton cluster

Incremental CLI

Match new CSV records against an existing base dataset:
The incremental CLI handles exact and fuzzy matchkeys separately:
  • Exact matchkeys: Polars join between new and base records (fast)
  • Fuzzy matchkeys: match_one brute-force against the base (thorough)

ANN incremental operations

For embedding-based matching, the ANN index supports incremental updates:
The ANN index is persistent when using database sync mode. Embeddings are computed progressively across runs (100K per run).

Database watch mode

Continuously monitor a database table for new records and match them incrementally:
watch requires --config; it exits with an error if the flag is omitted. It stops gracefully on SIGTERM.

Database sync

Full incremental matching against a live Postgres database:
Features:
  • Incremental sync — only processes records added since last run
  • Hybrid blocking — SQL WHERE clauses for exact fields + FAISS ANN for semantic fields
  • Persistent ANN index — disk cache + DB source of truth
  • Golden record versioning — append-only with is_current flag

run_stream

Run a streaming pipeline programmatically: run_stream takes a source_fn polling callable (not a record list) and returns a StreamProcessor that runs a polling loop. source_fn is called every poll_interval seconds and returns new records as list[dict].

Architecture

For database mode: