Anchor

Anchor takes a text query and searches a Postgres table for the closest stored chunks. When the best match clears a similarity floor, it returns the matching chunks with their provenance, the record of which source each chunk came from. When nothing clears the floor, it returns an empty result flagged refused, with the floor and the best similarity it saw, so the caller can tell a real miss from a weak guess.

Facts

Corpus
A synthetic real-estate dataset of invented placeholders: 16 projects, 5 builders, 4 localities, 4 infra items and 31 points of interest, 60 rows in all.
Threshold
A cosine similarity floor of 0.30, set by hand and not yet calibrated against this corpus.
Code
github.com/ykstorm/anchor, Apache 2.0.

Open the playgroundRead the code on GitHub