{"uid":"cap_AOoXOa1N1OBlQnwpK3nCj","slug":"gate402-semantic-vector-cache-dedup-c479db18","name":"gate402 Semantic Vector Cache (Dedup)","description":"Semantic vector cache: exact-match Map shortcut, then 0.88 cosine similarity on hash embeddings. Sub-10ms hits.","url":"https://gate402.app/v1/dedup","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"query":{"type":"string","description":"Text to look up"},"vector":{"type":"array","items":{"type":"number"},"description":"Optional embedding to store on miss"},"namespace":{"type":"string"},"storeOnMiss":{"type":"boolean"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_E4Ib3cPvhzt_n6qrns8Zq","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Checks whether a query has been seen before using exact-match lookup then 0.88 cosine similarity on hash embeddings, returning a cache hit or miss in under 10ms.","exampleAgentPrompt":"Before calling the LLM, check the semantic cache to see if 'What is the capital of France?' has been asked before in the 'general-qa' namespace — store the embedding if it's a miss.","exampleUseCases":[{"title":"LLM cost reduction in chatbot","prompt":"Before sending this user message to GPT, check the cache in namespace 'support-bot' to see if a semantically similar question was already answered — if it's a miss, store the embedding so future hits are fast."},{"title":"Deduplicating agent task queue","prompt":"I'm running a task queue where agents submit queries like 'summarize Q3 earnings' — check if this exact or near-identical task already exists in the 'task-dedup' namespace before spawning a new agent."},{"title":"Preventing duplicate form submissions","prompt":"A user just submitted the feedback 'Your app crashes on login every time' — check the 'feedback' namespace to see if we've already captured a semantically identical complaint and skip storing it if similarity is above threshold."}],"resultDescription":"Returns a cache hit or miss result: on a hit, includes the matched query text and cosine similarity score (>= 0.88); on a miss, optionally stores the provided embedding vector for future lookups. Sub-10ms latency for hits.","failureModes":["Missing 'query' field returns a 400 validation error","Namespace not found may return empty results or auto-create namespace","Vector dimension mismatch if provided embedding doesn't match stored dimension","Similarity threshold not met returns a miss even for close paraphrases","storeOnMiss=true without providing a vector may fail or be ignored","Rate limit exceeded returns 429","Payment failure via x402 returns 402"],"whenToPreferThis":"Choose this endpoint when you need sub-10ms semantic deduplication of text queries before invoking expensive downstream APIs or LLMs. Ideal for agent pipelines that need to short-circuit repeated or paraphrased requests without a full vector database. Prefer this over full vector DB queries when you only need a hit/miss signal with optional storage, and latency is critical.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:38:48.489Z","isFirstParty":false}