DedupQ

Check for duplicate task

Semantic task-level deduplication pipeline: Redis hash cache → Supabase exact hash → advisory lock check → OpenAI vector similarity search. Returns hit, miss, or in_progress. Costs 1 credit.

post/api/dedupq/check

Request

  • Base URL: https://plith.ai
  • URL: https://plith.ai/api/dedupq/check
  • Auth: none required

Request body

contentstring required

Task content to check for duplicates.

task_idstring

Optional caller task ID for tracing and lock correlation.

hash_onlyboolean

Skip vector similarity search; use hash matching only.

similarity_thresholdnumber

Cosine similarity threshold for semantic match. Default 0.92.

Response

Dedup result

status'hit' | 'miss' | 'in_progress'

hit — duplicate found; miss — no duplicate, proceed; in_progress — another worker holds the lock.

cache_hit'redis' | 'db_exact' | 'vector'

Which cache layer produced the hit. Present when status is 'hit'.

cached_atstring date-time

When the cached result was stored. Present on hits.

cache_age_secondsinteger

Age of the cached result in seconds. Present on hits.

lock_holder_task_idstring

Task ID currently holding the advisory lock. Present when status is 'in_progress'.

content_hashstring

SHA-256 of the content. Present when status is 'miss'.

messagestring
cross_productunknown
request_idstring
credits_usedinteger
credits_remaininginteger
fallback_behaviorstring

Example response

{
  "request_id": "req_a1b2c3d4e5f6",
  "credits_used": 1,
  "credits_remaining": 4999,
  "fallback_behavior": "proceed_without_dedup"
}

Changes

No recorded changes to this operation across all 1 revision of this API.