Skip to main content

Dedup index

Sellable product

This capability is granted by an API key scoped to the `` product (product face). See the product reference below.

Near-duplicate detection capability — a durable, org-scoped, multi-worker-COHERENT 64-bit SimHash index. One check-and-store API + a per-org Hamming threshold, so products stop each re-rolling a per-worker in-memory dedup index (which split-brains across workers, letting duplicates through). The near-dup scan is serialized per org (advisory lock) against ONE shared store so decisions are coherent across every worker/replica. I4: own Postgres store, never a product Mongo.

  • Group: Content & media
  • Contract: contracts/dedup-index/v1/openapi.yaml
  • Public base: https://api.vagarylabs.com (the consolidated API gateway — one host, per-brand sibling api.<zone>)
  • Auth: a product API key (vgk_…) issued from the console — Authorization: Bearer vgk_…
  • Product face (customer-keyed):
    • https://api.vagarylabs.com/product/v1/dedup/check

Endpoints

MethodPathSummary
POST/v1/dedup/checkCompute a SimHash, find near-duplicates in the org's index, and (optionally) store it
GET/v1/dedup/statsFingerprint count + effective Hamming threshold for the caller's org
PUT/v1/dedup/thresholdSet the org's Hamming threshold (persisted to the shared per-org row — worker-coherent)
GET/v1/dedup/fingerprints/&#123;article_id&#125;The stored SimHash fingerprint for one article (or 404)
GET/healthliveness
GET/metricsPrometheus

Schemas

CheckRequest

FieldTypeDescription
organization_idstringproduct-tier tenant (I6)
article_idstringidentifier (platform canonical_url)
textstringthe content to fingerprint
thresholdintegerper-request Hamming override; omit to use the org threshold
storebooleanpersist the fingerprint (false = check-only)

CheckResult

FieldTypeDescription
fingerprintstringunsigned 64-bit SimHash as a decimal string (exceeds JS safe-int / signed BSON)
is_duplicateboolean
near_duplicatesarray

Stats

FieldTypeDescription
fingerprint_countinteger
hamming_thresholdinteger

ThresholdRequest

FieldTypeDescription
organization_idstringproduct-tier tenant (I6)
thresholdinteger

ThresholdResult

FieldTypeDescription
hamming_thresholdinteger

Fingerprint

FieldTypeDescription
article_idstring
fingerprintstring

Error

FieldTypeDescription
errorstring

Generated by scripts/gen-capability-docs.py from contracts/dedup-index/v1/openapi.yaml — the contract IS the source of truth; edit the contract, not this page.